Rev 227 |
Blame |
Last modification |
View Log
| RSS feed
/***************************************************************************
* Copyright (C) 2008 by Manuel Schrape *
* manuel.schrape@gmx.de *
* *
* 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 2 of the License. *
* *
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef MKTOOL_H
#define MKTOOL_H
#include <QMainWindow>
#include <QSettings>
#include <QString>
#include <QTimer>
#include <QComboBox>
#include <QIcon>
#include <QProcess>
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <qwt_legend.h>
#include <qwt_plot.h>
#include <qwt_compass.h>
#include <qwt_compass_rose.h>
#include <qwt_dial_needle.h>
#include "ui_mktool.h"
#include "wdg_Settings.h"
#include "dlg_LCD.h"
#include "../SerialPort/ManageSerialPort.h"
#include "../Classes/cSettings.h"
#include "../Classes/cServer.h"
#include "../Classes/cQMK_Server.h"
#include "../Classes/cAttitude.h"
#include "../Classes/cSpeedMeter.h"
#include "../Logger/Logger.h"
class QextSerialPort;
class MKTool : public QMainWindow, public Ui::dlg_mktool_UI
{
Q_OBJECT
public:
MKTool();
~MKTool();
private:
int aa;
bool AllowSend;
// Object für Serielport
ManageSerialPort *serialPort;
// Settings-Object (Programmeinstellungen)
cSettings *Settings;
// Settings-Widget (FC-Settings)
wdg_Settings *f_Settings;
// HTTP-Server-Object für Google Earth
cServer *Server;
// QMK-Serverobjekt
cQMK_Server *MyServer;
// LCD-Dialog
dlg_LCD *f_LCD;
//TCP-Socket
QTcpSocket *TcpSocket;
// Default-Ticker
QTimer *Ticker;
// Kopie der Tabs des Hauptfensters
QWidget *TabWidgets[7];
// Analogwert-Beschreibungen
QLabel *lb_Analog[MaxAnalog];
// Analogwerte
int AnalogData[MaxAnalog];
// Plots für die Analogwerte
QwtPlotCurve *Plot[MaxAnalog];
// Datenspeicher für die Plots
double aData[MaxAnalog][MaxPlot];
double aID[MaxPlot];
int NextPlot;
AttitudeIndicator *Attitude;
cSpeedMeter * SpeedMeter;
// Ticker-Event-Array
bool TickerEvent[MaxTickerEvents];
bool TickerDiv;
// Aktuelle und Max-Anzahl der LCD-Seiten
int LCD_Page;
int LCD_MAX_Page;
//Logger für CVS und andere
Logger * logger;
sMode Mode;
sRxData RxData;
sNaviData Navi;
QString RXS;
QString LastSend;
// Softwareupdate
QProcess *Update;
// Sendedatenbuffer
char TX_Data[150];
// FC-Settings
int FCSettings[MaxParameter];
// Programm Initialisieren
void init_GUI();
void init_Objects();
void init_Connections();
void init_Arrays();
void init_Plot();
// Daten-Plotter
void update_Plot();
void config_Plot();
void new_NaviData(sRxData RX);
// void new_Debugdata();
// Daten Senden, Empfangen und verarbeiten
void send_Data(char CMD, int Address, char Data[150],unsigned int Length, bool Resend = true);
void new_RXData(sRxData RX);
// Debugdaten anzeigen und speichern.
void show_DebugData();
void update_Log();
// Programmeinstellungen speichern
void set_Preferences();
private slots:
void slot_QMKS_Connect();
void slot_QMKS_Connected();
void slot_QMKS_Disconnected(int Error);
void slot_ac_Hardware();
void slot_rb_Hardware();
void slot_ac_StartServer();
void slot_Test();
void slot_ac_Config();
void slot_ac_Preferences();
void slot_ac_StartPlotter();
void slot_ac_View();
void slot_ac_FastDebug();
void slot_ac_NoDebug();
void slot_ac_FastNavi();
void slot_ac_NoNavi();
void slot_ac_About();
void slot_ac_GetLabels();
void slot_ac_Motortest();
void slot_ac_LCD();
void slot_pb_HexFile();
// Default-Ticker
void slot_Ticker();
// LCD-Seite vor / zurück
void slot_LCD_UP();
void slot_LCD_DOWN();
void slot_Motortest(int Motor1, int Motor2, int Motor3, int Motor4);
// Firmeware-Update
void slot_pb_Update();
void slot_UpdateShell();
// Seriell-Port Slots
void slot_newDataReceived(const QByteArray &dataReceived);
void slot_OpenPort();
void slot_TabChanged(int Tab);
void slot_RecordLog();
void slot_ScrollPlot(int Pos);
// FC-Settings lesen / Schreiben
void slot_GetFCSettings();
void slot_SetFCSettings();
};
#endif