⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 settings.h

📁 QAM module to use in Java with an easy interface and powerful performance
💻 H
字号:
//License: GNU
//
//
//
//    J-QAM sound card modem
//
//    Copyright (C) 2007-2008  Jonti Olds
//
//
//
//    This program is free software: you can redistribute it and/or modify
//
//    it under the terms of the GNU General Public License as published by
//
//    the Free Software Foundation, either version 3 of the License, or
//
//    (at your option) any later version.
//
//
//
//    This program is distributed in the hope that it will be useful,
//
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//
//    GNU General Public License for more details.
//
//
//
//    You should have received a copy of the GNU General Public License
//
//    along with this program.  If not, see <http://www.gnu.org/licenses/>
//---------------------------------------------------------------------------

#ifndef SettingsH
#define SettingsH
//---------------------------------------------------------------------------
#include "Constants.h"
#include <SyncObjs.hpp>
#include <math.h>
#include <Controls.hpp>
#include <vector>
#include <Classes.hpp>


using namespace std;
//---------------------------------------------------------------------------


class SettingsClass
{
public:
        void __fastcall SetDemodMajor
        (
                bool Active,
                int ConstalationSize,
                double Alpha,
                double Gamma,
                int Firsize,
                double Freq,
                int InterleavingLength,
                int RSErrorPercent,
                int FramePriod
        );
        void __fastcall SetModMajor
        (
                bool Active,
                int ConstalationSize,
                double Alpha,
                double Gamma,
                int Firsize,
                double Freq,
                int InterleavingLength,
                int RSErrorPercent,
                int FramePriod
        );

        struct SDemodMajorSettings
        {
                bool Active;    // demod on
                double Freq;        //carrer frequency
                double Symbol_Freq; // symbol frequency
                int ConstalationSize;  //16 or 64
                double Alpha;   //bandwidth of envelope 0 is brick wall and 1 is nothing but cosine
                double Gamma; // amount of wave for 1 symbol. must be between 0.5 and 1
                int Firsize;  // fir size

                int InterleavingLength;
                int RSErrorPercent;
                int FramePriod;

                vector<double> CMapQAMAmps;
                int CMapQAMAmpsSize;
                vector<PtComplex> Cmap;

                double BetaSquared;
        };

        struct SDemodMinorSettings
        {
                bool SlowLock;
                bool Locked;
                bool Ama;
                bool DCD;
                AnsiString Status;
                bool StatusChanged;
                AcquisitionStage Acquisitionstage;
                bool Unrealon;
                double ActualRxFreq;
        };

        struct SModMajorSettings
        {
                bool Active;    // mod on
                double Freq;        //carrer frequency
                double Symbol_Freq; // symbol frequency
                int ConstalationSize;  //16 or 64
                double Alpha;   //bandwidth of envelope 0 is brick wall and 1 is nothing but cosine
                double Gamma; // amount of wave for 1 symbol. must be between 0.5 and 1
                int Firsize;  // fir size

                int InterleavingLength;
                int RSErrorPercent;
                int FramePriod;

                vector<double> CMapQAMAmps;
                int CMapQAMAmpsSize;
                vector<PtComplex> Cmap;

                double BetaSquared;
        };

        struct SModMinorSettings
        {
                bool Webserveron;
                bool Unrealon;
                bool CM_SENDNEXTWEBPACKET_is_handled;
                int IdleThreshold;
        };

        struct SCommonSettings
        {
                double Samplerate;
        };

        struct STrig
        {
                vector<double> SinWT;
                vector<double> CosWT;
                vector<double> CosINV;
        };

        __fastcall SettingsClass();

        SCommonSettings      Common;
        SDemodMajorSettings  DemodMajor;
        SDemodMinorSettings  DemodMinor;
        SModMajorSettings    ModMajor;
        SModMinorSettings    ModMinor;
        STrig                Trig;

        void __fastcall DemodMajorAddCallBackNotificationFuction(void (__closure __fastcall *CallBack)(NotificationEventType WhatHasChanged));
        void __fastcall DemodMajorRemoveCallBackNotificationFunction(void (__closure __fastcall *CallBack)(NotificationEventType WhatHasChanged));

        void __fastcall ModMajorAddCallBackNotificationFuction(void (__closure __fastcall *CallBack)(NotificationEventType WhatHasChanged));
        void __fastcall ModMajorRemoveCallBackNotificationFunction(void (__closure __fastcall *CallBack)(NotificationEventType WhatHasChanged));
        __fastcall ~SettingsClass();

        TCriticalSection *DemodMajorCriticalsection;
        TCriticalSection *ModMajorCriticalsection;

        bool __fastcall IsEmpty(void);
        int  __fastcall DemodCallBackCount(void);
        int  __fastcall ModCallBackCount(void);
        void __fastcall SaveBufferToDisk(AnsiString Section, AnsiString Name, char* Buf, int Size);
        int __fastcall LoadBufferFromDisk(AnsiString Section, AnsiString Name, char* Buf);
        void __fastcall SetSampleRate(double SampleRate);

        unsigned __int64 NumOfBadPkts;
        unsigned __int64 NumOfPkts;
        unsigned __int64 NumOfWebPkts;
        unsigned __int64 NumOfUnrealPkts;
        unsigned __int64 NumOfUDPPkts;
        unsigned __int64 NumOfRS232Pkts;

        unsigned __int64 TXNumOfBadPkts;
        unsigned __int64 TXNumOfPkts;
        unsigned __int64 TXNumOfWebPkts;
        unsigned __int64 TXNumOfUnrealPkts;
        unsigned __int64 TXNumOfUDPPkts;
        unsigned __int64 TXNumOfRS232Pkts;

        TStringList *SoundCardDevs;
        TStringList *RS232Ports;

        HWND Handle;
private:

        struct NotificationCallBack
        {
                void (__closure __fastcall *CallBack)(NotificationEventType WhatHasChanged);
        };

        vector <NotificationCallBack> DemodMajorCallBackNotificationOfChangeFunctions;
        void __fastcall DemodMajorNotifyAllPeopleThatWantNotificationWhenSettingsAreChanged(NotificationEventType WhatHasChanged);

        vector <NotificationCallBack> ModMajorCallBackNotificationOfChangeFunctions;
        void __fastcall ModMajorNotifyAllPeopleThatWantNotificationWhenSettingsAreChanged(NotificationEventType WhatHasChanged);

};

extern SettingsClass gSettings;

#endif




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -