432 lines
8.7 KiB
C++
432 lines
8.7 KiB
C++
#ifndef WIDGET_H
|
|
#define WIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QMenuBar>
|
|
#include <QKeyEvent>
|
|
#include <QTimer>
|
|
#include <QClipboard>
|
|
#include <QtNetwork/QUdpSocket>
|
|
#include <QFont>
|
|
#include <QFile>
|
|
#include <QBitArray>
|
|
|
|
#include "menubarmod.h"
|
|
#include "geo.h"
|
|
#include "graphicsviewmod.h"
|
|
#include "graphicsarcitem.h"
|
|
#include "graphicslineitem.h"
|
|
#include <QGraphicsColorizeEffect>
|
|
#include "grairobject.h"
|
|
|
|
#include <QDateTime>
|
|
#include <QGraphicsTextItem>
|
|
|
|
|
|
|
|
#include "meteosred.h"
|
|
#include "vvodma.h"
|
|
#include "vvodms.h"
|
|
#include "nastrel.h"
|
|
#include "tempzar.h"
|
|
#include "errorsza.h"
|
|
#include "zerkus.h"
|
|
#include "ownadr.h"
|
|
|
|
#include "gag.h"
|
|
|
|
#include "vvodts.h"
|
|
#include "vvodreper.h"
|
|
#include "geotogk.h"
|
|
#include "gktogeo.h"
|
|
#include "gktogk.h"
|
|
|
|
#include "vvodsectazim.h"
|
|
#include "vvodsectugol.h"
|
|
#include "vvodsectotvet.h"
|
|
#include "vvodautozadef.h"
|
|
|
|
#include "vvodbk.h"
|
|
#include "vvoddko.h"
|
|
#include "vvodkcu.h"
|
|
#include "vvodready.h"
|
|
|
|
#include "vvod2z.h"
|
|
|
|
#include "showcrc.h"
|
|
#include "texit.h"
|
|
|
|
namespace Ui {
|
|
class Widget;
|
|
}
|
|
|
|
class Widget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit Widget(QWidget *parent = 0);
|
|
~Widget();
|
|
|
|
QUdpSocket *udpSocket, *udpSend, *udpKeybRead;
|
|
|
|
|
|
QWidget *openWidget;
|
|
|
|
MenuBarMod *menu, *menu1;
|
|
GraphicsViewMod *gV;
|
|
QGraphicsScene *gsc;
|
|
|
|
QMenu *mTrenag;
|
|
QMenu *mTopo;
|
|
QMenu *mGAG;
|
|
QMenu *mPodgotovka;
|
|
QMenu *mSost;
|
|
QMenu *mStrelba;
|
|
QMenu *mCVS;
|
|
QMenu *mOtogd;
|
|
QMenu *mReg;
|
|
QMenu *mExit;
|
|
// Ìåíþ "Òðåíàæ"
|
|
QAction *m1Source;
|
|
QAction *m1Trace;
|
|
|
|
QMenu *m1Manevr;
|
|
QAction *m1RazvorotL;
|
|
QAction *m1RazvorotR;
|
|
QAction *m1Barrazh;
|
|
QAction *m1Pikir;
|
|
QAction *m1Kabrir;
|
|
QAction *m1Speed;
|
|
QAction *m1JumpHeli;
|
|
|
|
|
|
|
|
QAction *m1Reset;
|
|
QAction *m1Load;
|
|
QAction *m1Save;
|
|
QAction *m1Start;
|
|
QAction *m1Stop;
|
|
QAction *m1SectorVvod;
|
|
QAction *m1SectorEnable;
|
|
QAction *m1SectorReset;
|
|
|
|
QMenu *m1OperatorTren;
|
|
QAction *m1Rezhim;
|
|
QAction *m1ShowMark;
|
|
QAction *m1ResetCourse;
|
|
QAction *m1ResetMark;
|
|
QAction *m1Timer;
|
|
// Ìåíþ "Òîïî"
|
|
QAction *m2Reper;
|
|
QAction *m2Mestopol;
|
|
QMenu *m2Pereschet;
|
|
QAction *m2Geo_GK;
|
|
QAction *m2GK_Geo;
|
|
QAction *m2GK_GK;
|
|
// Ìåíþ "ÃÀÃ"
|
|
QAction *m3GAG;
|
|
// Ìåíþ "Ïîäãîòîâêà"
|
|
QAction *m4RezhimMA;
|
|
QAction *m4Bulletin;
|
|
QAction *m4Nastrel;
|
|
QAction *m4Temperature;
|
|
QAction *m4Errors;
|
|
QAction *m4Data;
|
|
QAction *m4RezhimZerk;
|
|
QAction *m4Adress;
|
|
// Ìåíþ "Ñîñòîÿíèå"
|
|
QAction *m5VvodBK;
|
|
QMenu *m5Reports;
|
|
QAction *m5Ready;
|
|
QAction *m5TargDestr;
|
|
QAction *m5TargMissed;
|
|
QAction *m5DKO;
|
|
QAction *m5PeriodicFK;
|
|
QAction *m5CtrlSum;
|
|
|
|
// Ìåíþ "Ñòðåëüáà"
|
|
QAction *m6SectAzim;
|
|
QAction *m6SectUgol;
|
|
QAction *m6SectOtv;
|
|
QAction *m6ManualZA;
|
|
QAction *m6AutoZA;
|
|
|
|
// Ìåíþ "ÖÂÑ"
|
|
QAction *m7Default;
|
|
QAction *m7BR;
|
|
QAction *m7FK;
|
|
QAction *m7TRU;
|
|
QAction *m7CU;
|
|
QAction *m7CUDenied;
|
|
|
|
// Ìåíþ "Îòîæä"
|
|
QAction *m8Reset;
|
|
QAction *m8Param;
|
|
|
|
// Ìåíþ "Ðåã"
|
|
QAction *m9Oscil;
|
|
QAction *m9View;
|
|
|
|
// Ìåíþ "Âûõîä"
|
|
QAction *m0Reboot;
|
|
QAction *m0Shutdown;
|
|
|
|
bool readFile();
|
|
void writeFile();
|
|
void createMenu();
|
|
void createActions();
|
|
void initBtnUIDs();
|
|
void initParams();
|
|
void setGraph();
|
|
|
|
void setVCU(int id);
|
|
void clearVCU();
|
|
int findTargetFromId(int id);
|
|
void addTargets();
|
|
void addTarget(int id, int aType, int gType, qreal cX, qreal cY, qreal cH, qreal vX, qreal vY);
|
|
// ïðèçíàê ðàáîòû â êîìïëåêñíîé òðåíèðîâêå (ñ ÌÐÓ)
|
|
bool MRUmode;
|
|
// èñõîäíûå äàííûå ïî ðàêåòàì
|
|
qreal rckV0, rckV, rckT0, rckTmax, rckD0;
|
|
qreal rckHmax, rckHmin, rckDmax, rckDmin;
|
|
qreal rckAngle;
|
|
// ñëàéäåð ïóñêà ðàêåò
|
|
QGraphicsScene *gscRckt;
|
|
QGraphicsView *gvRckt;
|
|
|
|
QGraphicsRectItem *grRckt1, *grRckt2;
|
|
|
|
// ñëàéäåð loading
|
|
QGraphicsScene *tmpGS;
|
|
QGraphicsTextItem *grLoadDate, *grLoadLogin, *grLoadPass;
|
|
|
|
QString strLoadDate, strLoadLogin, strLoadPass;
|
|
qint16 curPosition;
|
|
|
|
qint16 keybMaxDelay;
|
|
bool quickLoad;
|
|
bool silentMode;
|
|
|
|
// ïåðåìåííûå äëÿ òàáëèö è îêîí
|
|
qreal zoomKoef[9];
|
|
|
|
qint8 pwrCVS[3];
|
|
bool pwrMon, pwrMonPrev;
|
|
bool resetCVS[3];
|
|
|
|
int splashIsOn;
|
|
|
|
bool meteoAvtonom, meteoSred;
|
|
void setMeteo(bool m1, bool m2);
|
|
|
|
|
|
int rezhimGAG;
|
|
QString rezhimGAGtxt[4];
|
|
int GAGmdu, GAGdu;
|
|
int GAGmdu0, GAGdu0;
|
|
void setRezhimGAG(int pos);
|
|
|
|
int rezhimZerk;
|
|
|
|
T_geoPoint ts, reper;
|
|
T_metAv metAv;
|
|
QString metSr;
|
|
|
|
int errZAgor[9];
|
|
int errZAver[7];
|
|
int errZAdB;
|
|
|
|
int currentNum;
|
|
|
|
int findNextNum(int n);
|
|
|
|
int sectAzLow1, sectAzLow2, sectAzHigh1, sectAzHigh2;
|
|
int sectUgLow1, sectUgLow2, sectUgHigh1, sectUgHigh2;
|
|
|
|
int grViewSetting;
|
|
|
|
T_sectOtv ownSect;
|
|
graphicsArcItem *grOwnSect;
|
|
T_sectOtv kzsSect;
|
|
graphicsArcItem *grKzsSect;
|
|
qreal azimutGUN, azimutGUNprev;
|
|
qreal ugolGUN, ugolGUNprev;
|
|
graphicsLineItem *grAzimutGUN;
|
|
|
|
int umMissTur;
|
|
int basePoxod; // 1 - ïîõîä, 2- ÐåæèìÐ, 3 - ÏóñêÐ
|
|
|
|
// t1 - âðåìÿ äî âõîäà â çîíó, t2 - âðåìÿ íàõîæäåíèÿ â çîíå
|
|
// AS - àâòîñîïðîâîæäåíèå, VCU - öåëåóêàçàíèå, R_N - ñòðåëüáà ðàêåòîé íàâñòðå÷ó,
|
|
// R_V - ñòðåëüáà ðàêåòîé âäîãîí
|
|
|
|
qreal AS_t1, AS_t2, VCU_t1, VCU_t2, R_N_t1, R_N_t2, R_V_t1, R_V_t2;
|
|
qreal AS_par;
|
|
|
|
// qreal grCrossAzim, grCrossDist;
|
|
// QGraphicsItem grCross;
|
|
|
|
|
|
qreal azimutRLS;
|
|
graphicsLineItem *grAzimutRLS;
|
|
graphicsLineItem *grAzimutRLSnormal;
|
|
|
|
qreal azimutKurs;
|
|
graphicsLineItem *grAzimutKurs;
|
|
|
|
grAirObject *grAir[100];
|
|
int targetsIds[100];
|
|
qreal globalScale;
|
|
int targetsCount;
|
|
|
|
int VCUnumTarget;
|
|
int ASnumTarget;
|
|
graphicsLineItem *grVCU;
|
|
int lastKO;
|
|
|
|
|
|
bool autoZAdefault;
|
|
|
|
int BK[5]; // 0-3 ñòâîëû íë, âë, íï, âï ; 4- êîëè÷åñòâî ðàêåò
|
|
|
|
bool readyBoegotov;
|
|
|
|
int ZAtempZar;
|
|
int ZAnastrel;
|
|
|
|
|
|
QTimer *loadScreenTmr;
|
|
int loadingPos;
|
|
int loadingShift;
|
|
|
|
void keybReadDatagrams(int d1, int d2, int d3, int d4, int d5);
|
|
|
|
// ïåðåìåííûå äëÿ îáùåíèÿ ñ ñåðâåðîì
|
|
|
|
QUdpSocket *udpNewTask, *udpOptServer, *udpOptServer2;
|
|
QUdpSocket *udpTarget, *udpCU;
|
|
char currentTaskNum;
|
|
|
|
public slots:
|
|
void changeOpenWidget(QObject* p);
|
|
void clearOpenWidget();
|
|
|
|
void catcher(int);
|
|
void catchel(int);
|
|
void switchWidget(int);
|
|
|
|
void showSplash(int d=1);
|
|
void hideSplash() {showSplash(0);};
|
|
|
|
void msMeteoSredShow(void);
|
|
void msVvodMA(void);
|
|
void msBulletinShow(void);
|
|
void msNastrel(void);
|
|
void msTempZar(void);
|
|
void msErrorZA(void);
|
|
void msZerkuS(void);
|
|
void msOwnAdr(void);
|
|
|
|
void msGAG(void);
|
|
|
|
void msVvodReper();
|
|
void msVvodTS();
|
|
void msGeoToGK();
|
|
void msGKToGeo();
|
|
void msGKToGK();
|
|
|
|
void msVvodSectAzim();
|
|
void msVvodSectUgol();
|
|
void msVvodSectOtvet();
|
|
void msVvodAutoZA();
|
|
void msVvodManualZA();
|
|
|
|
void msVvodBK();
|
|
void msVvodDKO();
|
|
void msVvodKCancel();
|
|
void msVvodKZapret();
|
|
void msVvodKKill();
|
|
void msVvodKMiss();
|
|
|
|
void msVvodCU_N();
|
|
void msVvodCU_N2(int NC, int z2Z=0);
|
|
|
|
void msVvodReady();
|
|
|
|
void msShowCRC();
|
|
|
|
void msVvod2z();
|
|
|
|
|
|
void closeSlot();
|
|
void reCalculate();
|
|
|
|
void processSendingDatagrams(QByteArray buf, int port=45460);
|
|
void sendReport();
|
|
private slots:
|
|
void setSector(qint8 zoneType, float anglStart, float anglEnd);
|
|
|
|
void processPendingDatagrams();
|
|
|
|
void clearOldTarget(QBitArray &subAr);
|
|
void process_TargetKDG();
|
|
void process_CU_KRU_KDG();
|
|
|
|
void newOptServerData();
|
|
|
|
void newOptServerData2();
|
|
|
|
void synhrTimeout();
|
|
|
|
void newTaskReadDatagrams();
|
|
|
|
void msTickGraph();
|
|
|
|
void on_pushButton_8_clicked();
|
|
|
|
void on_pushButton_10_clicked();
|
|
|
|
void on_pushButton_14_clicked();
|
|
|
|
void on_pushButton_12_clicked();
|
|
|
|
void on_pushButton_13_clicked();
|
|
|
|
void on_pushButton_7_clicked();
|
|
|
|
void on_comboBox_2_currentIndexChanged(int index);
|
|
|
|
void on_pushButton_4_clicked();
|
|
|
|
void on_comboBox_currentIndexChanged(int index);
|
|
|
|
void on_pushButton_11_clicked();
|
|
|
|
void loadScreenTick();
|
|
|
|
void focusSS(QWidget*, QWidget*);
|
|
|
|
void activateWindow(int);
|
|
|
|
void putLogin();
|
|
|
|
void getFocus();
|
|
|
|
void on_pushButton_9_clicked();
|
|
|
|
private:
|
|
void putDate();
|
|
|
|
|
|
virtual void keyPressEvent ( QKeyEvent * e );
|
|
|
|
Ui::Widget *ui;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
#endif // WIDGET_H
|