Subversion Repositories Projects

Rev

Blame | Last modification | View Log | RSS feed

/***************************************************************************
 *   Copyright (C) 2009 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 DLG_MAIN_H
#define DLG_MAIN_H

#include <QtGui/QMainWindow>
#include <QTcpServer>
#include <QTcpSocket>
#include <QComboBox>
#include <QToolButton>
#include <QTimer>

#include "ui_dlg_Main.h"

#include "dlg_MotorMixer.h"

#include "../Defines.h"
#include "../TypeDefs.h"

#include "../Classes/cSettings.h"

class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI
{
    Q_OBJECT

    public:
        dlg_Main();
        ~dlg_Main();

    private:
        QTimer *o_Timer;

        // Info über die Hardware
        s_Hardware gs_Version;

        // Settings-Object
        cSettings *o_Settings;

        // MotorMixer GUI
        dlg_MotorMixer *f_MotorMixer;

        char c_Data[150];

        // Programm-Initialisirungen
        void init_GUI();
        void init_Connections();

        void init_Directorys();
        s_Directorys s_Dir;

        void set_LED(QToolButton *ToolButton, bool On = false);
        int get_Value(QComboBox *Combo);
        QComboBox *setCombo(QComboBox *Combo, int Wert);

        void show_MK_Settings(s_MK_Settings t_Set);
        s_MK_Settings get_MK_Settings();

    private slots:
        void slot_Timer();

        void slot_ac_About();
        void slot_ac_Toolbar();

        void slot_ConnectionStatus(int li_Status);
        void slot_MK_Version(s_Hardware ls_Version);
        void slot_MK_ReadSettings(s_MK_Settings ps_MK_Settings);
        void slot_MK_WriteSettings(int pi_ID);
        void slot_MK_ReadMotorMixer(s_MK_Mixer ps_MK_MotorMixer);
        void slot_MK_WriteMotorMixer(int pi_ID);
        void slot_MK_PPMData(s_MK_PPM_Data ps_PPMData);

        void slot_ac_Write();
        void slot_ac_Read();
        void slot_ac_Save();
        void slot_ac_Load();

        void slot_ac_MotorMixer();

        void slot_PageChange(int Page);

        void slot_LEDtoValue();
        void slot_ValuetoLED16(int Wert);
        void slot_ValuetoLED17(int Wert);
        void slot_ValuetoLED16A(int Wert);
        void slot_ValuetoLED17A(int Wert);

        void slot_tbUp();
        void slot_tbDown();
        void slot_tbLeft();
        void slot_tbRight();
};

#endif // DLG_MAIN_H