Subversion Repositories Projects

Compare Revisions

Regard whitespace Rev 815 → Rev 816

/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_HandlerIP/HandlerIP.cpp
0,0 → 1,30
/***************************************************************************
* 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. *
***************************************************************************/
#include "HandlerIP.h"
 
HandlerIP::HandlerIP()
{
}
 
// IP-Datenpacket zusammenbauen
// todo: CRC einbauen
QString HandlerIP::make_Frame(int t_ID, int t_CMD, QString t_Data)
{
return QString(QString("$:%1").arg(t_ID) + QString(":%1:").arg(t_CMD) + t_Data + ":0\r");
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_HandlerIP/HandlerIP.h
0,0 → 1,40
/***************************************************************************
* 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 HANDLERIP_H
#define HANDLERIP_H
 
#include <QString>
 
static const int ID_COMMUNICATOR = 1;
static const int ID_SCOPE = 11;
static const int ID_SETTINGS = 12;
static const int ID_MAPS = 13;
static const int ID_VOICE = 14;
static const int ID_LOGGER = 15;
static const int ID_SERVER = 100;
 
 
class HandlerIP
{
public:
HandlerIP();
static QString make_Frame(int t_ID, int t_CMD, QString t_Data);
};
 
#endif // HANDLERIP_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_HandlerKML/HandlerKML.cpp
0,0 → 1,65
/***************************************************************************
* 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. *
***************************************************************************/
 
#include "HandlerKML.h"
 
HandlerKML::HandlerKML()
{
}
 
QString HandlerKML::get_Header(QString Name)
{
QString block;
block = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<kml xmlns=\"http://earth.google.com/kml/2.2\">\n"
" <Document>\n"
" <name>" + Name + "</name>\n"
" <Style id=\"MK_gps-style\">\n"
" <LineStyle>\n"
" <color>ff0000ff</color>\n"
" <width>2</width>\n"
" </LineStyle>\n"
" </Style>\n"
" <Placemark>\n"
" <LookAt>\n"
" <range>400</range>\n"
" <tilt>45</tilt>\n"
" </LookAt>\n"
" <name>Flight</name>\n"
" <styleUrl>#MK_gps-style</styleUrl>\n"
" <LineString>\n"
" <extrude>1</extrude>\n"
" <tessellate>1</tessellate>\n"
" <altitudeMode>absolute</altitudeMode>\n"
" <coordinates>\n";
 
return block;
}
 
QString HandlerKML::get_Footer()
{
QString block;
block = " </coordinates>\n"
" </LineString>\n"
" </Placemark>\n"
" </Document>\n"
"</kml>\n";
 
return block;
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_HandlerKML/HandlerKML.h
0,0 → 1,34
/***************************************************************************
* 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 HANDLERKML_H
#define HANDLERKML_H
 
#include <QString>
 
class HandlerKML
{
public:
HandlerKML();
 
static QString get_Header(QString Name = "Mikrokopter");
static QString get_Footer();
};
 
#endif // HANDLERKML_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_HandlerMK/HandlerMK.cpp
0,0 → 1,232
/***************************************************************************
* 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. *
***************************************************************************/
#include "HandlerMK.h"
 
HandlerMK::HandlerMK()
{
}
 
// Datensatz nach 16bit Integer
int HandlerMK::Data2Int(unsigned char Data[160] , int Start, bool is_signed)
{
int Out = (Data[Start+1]<<8) | (Data[Start+0]);
 
if ((Out > 32767) && (is_signed))
Out = Out - 65536;
 
return Out;
 
}
 
// Datensatz nach QString
QString HandlerMK::Data2QString(unsigned char Data[150], int Start, int End)
{
char String[150];
for (int a = Start; a < End; a++)
{
String[a - Start] = Data[a];
}
String[End - Start] = '\0';
 
return QString(String);
}
 
double HandlerMK::Int2Double(int32_t Wert, int Count)
{
QString Temp, s_Wert;
 
s_Wert = QString("%1").arg(Wert);
 
Temp = s_Wert.left(s_Wert.length() - Count) + QString(".") + s_Wert.right(Count);
 
return Temp.toDouble();
}
 
QString HandlerMK::add_CRC(QString TXString)
{
unsigned int tmpCRC = 0;
 
char *TXBuff;
char CRC[2];
 
TXBuff = TXString.toLatin1().data();
 
for(int i = 0; i < TXString.length(); i++)
{
tmpCRC += TXBuff[i];
}
 
tmpCRC %= 4096;
 
CRC[0] = '=' + tmpCRC / 64;
CRC[1] = '=' + tmpCRC % 64;
CRC[2] = '\0';
 
QString Return = TXString + QString(CRC);
 
return Return;
}
 
bool HandlerMK::Check_CRC(char *t_InData, int Length)
{
int CRC = 0;
 
if (t_InData[1] == 127)
t_InData[1] = 0;
 
for(int i=0; i < Length-2; i++)
CRC+=t_InData[i];
 
CRC = CRC % 4096;
 
if(t_InData[Length - 2] != ('=' + (CRC / 64)))
return false;
 
if(t_InData[Length - 1] != ('=' + CRC % 64))
return false;
 
return true;
}
 
int HandlerMK::Decode_64(char *t_InData, int Length, unsigned char *t_OutData)
{
unsigned char a,b,c,d;
unsigned char ptr = 0;
unsigned char x,y,z;
 
int Offset = 3;
 
if (t_InData[Offset] == 0)
{
return 0;
}
 
while(Length != 0)
{
a = t_InData[Offset++] - '=';
b = t_InData[Offset++] - '=';
c = t_InData[Offset++] - '=';
d = t_InData[Offset++] - '=';
 
// if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden
 
x = (a << 2) | (b >> 4);
y = ((b & 0x0f) << 4) | (c >> 2);
z = ((c & 0x03) << 6) | d;
 
if(Length--) t_OutData[ptr++] = x; else break;
if(Length--) t_OutData[ptr++] = y; else break;
if(Length--) t_OutData[ptr++] = z; else break;
}
 
return ptr;
}
 
// Base64 Encoder
QString HandlerMK::Encode64(char Data[160],unsigned int Length)
{
unsigned int pt = 0;
unsigned char a,b,c;
unsigned char ptr = 0;
 
char TX_Buff[160];
 
while(Length > 0)
{
if(Length) { a = Data[ptr++]; Length--;} else a = 0;
if(Length) { b = Data[ptr++]; Length--;} else b = 0;
if(Length) { c = Data[ptr++]; Length--;} else c = 0;
 
TX_Buff[pt++] = '=' + (a >> 2);
TX_Buff[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4));
TX_Buff[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6));
TX_Buff[pt++] = '=' + ( c & 0x3f);
}
TX_Buff[pt] = 0;
 
return QString(TX_Buff);
}
 
QString HandlerMK::make_Frame(char t_CMD, int t_Adress, char t_Data[160], unsigned int t_Length)
{
QString tx_Data = Encode64(t_Data, t_Length);
 
tx_Data = add_CRC(QString("#" + QString('a' + t_Adress) + QString(t_CMD) + tx_Data)) + "\r";
 
return tx_Data;
}
 
QString HandlerMK::get_SelectNC()
{
char t_Data[6];
 
t_Data[0] = 0x1B;
t_Data[1] = 0x1B;
t_Data[2] = 0x55;
t_Data[3] = 0xAA;
t_Data[4] = 0x00;
t_Data[5] = '\r';
 
QString tx_Data = QString(t_Data);
 
return tx_Data;
}
 
QString HandlerMK::get_SelectFC()
{
char t_Data[1];
 
t_Data[0] = 0;
 
QString tx_Data = Encode64(t_Data, 1);
 
tx_Data = add_CRC(QString("#" + QString('a' + ADDRESS_NC) + QString("u") + tx_Data)) + "\r";
 
return tx_Data;
}
 
QString HandlerMK::get_SelectMK3MAG()
{
char t_Data[1];
 
t_Data[0] = 1;
 
QString tx_Data = Encode64(t_Data, 1);
 
tx_Data = add_CRC(QString("#" + QString('a' + ADDRESS_NC) + QString("u") + tx_Data)) + "\r";
 
return tx_Data;
}
 
s_Hardware HandlerMK::parse_Version(unsigned char *t_Data, int Adress)
{
s_Hardware t_Hardware;
 
t_Hardware.ID = Adress;
t_Hardware.VERSION_MAJOR = t_Data[0];
t_Hardware.VERSION_MINOR = t_Data[1];
t_Hardware.VERSION_PATCH = t_Data[4];
t_Hardware.VERSION_SERIAL_MAJOR = t_Data[2];
t_Hardware.VERSION_SERIAL_MINOR = t_Data[3];
t_Hardware.Hardware = HardwareType[t_Hardware.ID];
t_Hardware.Version = QString("%1").arg(t_Data[0]) + "." + QString("%1").arg(t_Data[1]) + QString(t_Data[4] + 'a');
t_Hardware.VersionShort = QString("%1").arg(t_Data[0]) + QString("%1").arg(t_Data[1]) + QString(t_Data[4] + 'a');
 
return t_Hardware;
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_HandlerMK/HandlerMK.h
0,0 → 1,65
/***************************************************************************
* 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 HANDLERMK_H
#define HANDLERMK_H
 
#include <QString>
 
#include "../Kopter.h"
#include "../MK_Datatypes.h"
 
struct s_Hardware
{
int ID;
int VERSION_MAJOR;
int VERSION_MINOR;
int VERSION_PATCH;
int VERSION_SERIAL_MAJOR;
int VERSION_SERIAL_MINOR;
QString Hardware;
QString Version;
QString VersionShort;
};
 
 
class HandlerMK
{
public:
HandlerMK();
 
static int Data2Int(unsigned char Data[150], int Start, bool is_signed = true);
static QString Data2QString(unsigned char Data[160], int Start, int End);
 
static QString add_CRC(QString TXString);
static bool Check_CRC(char *t_InData, int Length);
 
static int Decode_64(char *t_InData, int Length, unsigned char *t_OutData);
static QString Encode64(char Data[160],unsigned int Length);
static QString make_Frame(char t_CMD, int t_Adress, char t_Data[160], unsigned int t_Length);
 
static QString get_SelectFC();
static QString get_SelectNC();
static QString get_SelectMK3MAG();
 
static s_Hardware parse_Version(unsigned char *t_Data, int Adress);
 
static double Int2Double(int32_t Wert, int Count);
};
 
#endif // HANDLERMK_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_Input/Input.cpp
0,0 → 1,60
/***************************************************************************
* 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. *
***************************************************************************/
#include "Input.h"
 
void Input::Init()
{
}
 
bool Input::Open(set_Input s_Input)
{
s_Input = s_Input;
return false;
}
 
bool Input::IsOpen()
{
return false;
}
 
bool Input::Close()
{
return false;
}
 
void Input::send_Data(QString t_Data, int ID)
{
t_Data = t_Data;
ID = ID;
}
 
void Input::send_RawData(char *t_Data)
{
t_Data = t_Data;
}
 
void Input::stop_Resend(int ID)
{
ID = ID;
}
 
eMode Input::Mode()
{
return NONE;
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_Input/Input.h
0,0 → 1,65
/***************************************************************************
* 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 INPUT_H
#define INPUT_H
 
#include <QObject>
 
enum eMode {NONE, TCP, TTY};
 
struct set_Input
{
QString Main;
QString Sub;
};
 
struct s_Resend
{
bool ID;
QString Data;
};
 
static const int CLOSED = 0;
static const int REFUSED = 1;
static const int REMOTECLOSED = 2;
 
static const int MAX_Confirm = 11;
 
class Input : public QObject
{
Q_OBJECT
 
public:
virtual void Init();
virtual bool Open(set_Input s_Input);
virtual bool IsOpen();
virtual bool Close();
virtual void send_Data(QString t_Data, int ID = 0);
virtual void send_RawData(char *t_Data);
virtual void stop_Resend(int ID);
virtual eMode Mode();
 
signals:
virtual void sig_NewData(QString Data);
 
// private:
 
};
 
#endif // INPUT_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_Input/Input_TCP.cpp
0,0 → 1,197
/***************************************************************************
* 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. *
***************************************************************************/
#include "Input_TCP.h"
 
void Input_TCP::Init()
{
b_Open = false;
Timer = new QTimer();
s_Buffer = "";
connect(Timer, SIGNAL(timeout()), this, SLOT(slot_Timer()));
 
for (int z = 0; z < MAX_Confirm; z++)
{
Confirm[z].ID = false;
}
}
 
bool Input_TCP::Open(set_Input s_Input)
{
TCP_Socket = new(QTcpSocket);
TCP_Socket->connectToHost (s_Input.Main, s_Input.Sub.toInt());
 
connect(TCP_Socket, SIGNAL(connected()), this, SLOT(slot_TCP_Connected()) );
connect(TCP_Socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(slot_TCP_Error(QAbstractSocket::SocketError)));
 
return true;
}
 
bool Input_TCP::IsOpen()
{
return b_Open;
}
 
bool Input_TCP::Close()
{
TCP_Socket->disconnectFromHost();
disconnect(TCP_Socket, SIGNAL(connected()), 0, 0);
disconnect(TCP_Socket, SIGNAL(readyRead()), 0, 0);
disconnect(TCP_Socket, SIGNAL(disconnected()), 0, 0);
 
b_Open = false;
Timer->stop();
 
return true;
}
 
void Input_TCP::send_Data(QString t_Data, int ID)
{
if ((ID > 0) && (ID < MAX_Confirm))
{
Timer->start(2500);
Confirm[ID].ID = true;
Confirm[ID].Data = t_Data;
}
 
if (b_Open)
{
usleep(50000);
 
if (t_Data[t_Data.length() - 1] != '\r')
{
t_Data = t_Data + "\r";
}
 
QByteArray Temp;
Temp = QByteArray(QString(t_Data + "\n").toAscii());
 
TCP_Socket->write(Temp);
TCP_Socket->flush();
 
// qDebug(t_Data.toLatin1().data());
}
}
 
void Input_TCP::send_RawData(char *t_Data)
{
t_Data = t_Data;
}
 
void Input_TCP::stop_Resend(int ID)
{
if ((ID > 0) && (ID < MAX_Confirm))
{
Confirm[ID].ID = false;
Confirm[ID].Data = "";
}
}
 
void Input_TCP::slot_Timer()
{
bool Active = false;
 
for (int x = 0; x < MAX_Confirm; x++)
{
if (Confirm[x].ID)
{
Active = true;
send_Data(Confirm[x].Data);
}
}
 
if (Active == false)
{
Timer->stop();
}
}
 
void Input_TCP::slot_TCP_Connected()
{
b_Open = true;
connect(TCP_Socket, SIGNAL(readyRead()), SLOT(slot_TCP_ReadLine()));
connect(TCP_Socket, SIGNAL(disconnected()),TCP_Socket, SLOT(deleteLater()));
connect(TCP_Socket, SIGNAL(disconnected()),this, SLOT(slot_TCP_Disconnect()));
 
emit sig_Connected();
}
 
void Input_TCP::slot_TCP_Disconnect()
{
disconnect(TCP_Socket, SIGNAL(disconnected()), 0, 0);
disconnect(TCP_Socket, SIGNAL(readyRead()), 0, 0);
// emit sig_Disconnected(1);
}
 
void Input_TCP::slot_TCP_ReadLine()
{
// QString t_Data = QString(TCP_Socket->readLine(TCP_Socket->bytesAvailable())).remove(QChar('\n'));
QString t_Data = s_Buffer + QString(TCP_Socket->readAll()).remove(QChar('\n'));
 
s_Buffer = "";
 
t_Data = t_Data.replace('\r', "\r\n");
 
QStringList l_Data;
l_Data = t_Data.split('\n');
 
for (int z = 0; z < l_Data.count(); z++)
{
 
if ((l_Data[z][l_Data[z].length() - 1] == '\r'))
{
emit(sig_NewData(l_Data[z]));
// qDebug(QString("DATA: _" + l_Data[z] + "_ < END").toLatin1().data());
}
else
{
s_Buffer = s_Buffer + l_Data[z];
}
}
}
 
void Input_TCP::slot_TCP_Error(QAbstractSocket::SocketError Error)
{
b_Open = false;
 
disconnect(TCP_Socket, SIGNAL(disconnected()), 0, 0);
disconnect(TCP_Socket, SIGNAL(error(QAbstractSocket::SocketError)), 0, 0);
disconnect(TCP_Socket, SIGNAL(connected()), 0, 0);
disconnect(TCP_Socket, SIGNAL(readyRead()), 0, 0);
 
// qDebug("Error");
switch (Error)
{
case QAbstractSocket::ConnectionRefusedError:
emit sig_Disconnected(REFUSED);
break;
case QAbstractSocket::RemoteHostClosedError:
emit sig_Disconnected(REMOTECLOSED);
break;
default:
emit sig_Disconnected(CLOSED);
break;
}
// emit sig_Disconnected(CLOSED);
}
 
eMode Input_TCP::Mode()
{
return TCP;
}
 
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_Input/Input_TCP.h
0,0 → 1,67
/***************************************************************************
* 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 INPUT_TCP_H
#define INPUT_TCP_H
 
#include <QObject>
#include <QTcpServer>
#include <QTcpSocket>
#include <QTimer>
#include <QStringList>
 
#include "Input.h"
 
class Input_TCP : public Input
{
Q_OBJECT
 
public:
void Init();
bool Open(set_Input s_Input);
bool IsOpen();
bool Close();
void send_Data(QString t_Data, int ID = 0);
void send_RawData(char *t_Data);
void stop_Resend(int ID);
eMode Mode();
 
private:
// TCP Server und Socket.
QTcpServer *TCP_Server;
QTcpSocket *TCP_Socket;
QTimer *Timer;
bool b_Open;
s_Resend Confirm[MAX_Confirm];
QString s_Buffer;
 
private slots:
// void slot_newDataReceived(const QByteArray &dataReceived);
void slot_TCP_Connected();
void slot_TCP_Disconnect();
void slot_TCP_ReadLine();
void slot_TCP_Error(QAbstractSocket::SocketError Error);
void slot_Timer();
 
signals:
void sig_NewData(QString);
void sig_Disconnected(int);
void sig_Connected();
};
 
#endif // INPUT_TCP_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_Input/Input_TTY.cpp
0,0 → 1,160
/***************************************************************************
* 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. *
***************************************************************************/
#include "Input_TTY.h"
 
void Input_TTY::Init()
{
Timer = new QTimer();
connect(Timer, SIGNAL(timeout()), this, SLOT(slot_Timer()));
 
for (int z = 0; z < MAX_Confirm; z++)
{
Confirm[z].ID = false;
}
}
 
bool Input_TTY::Open(set_Input s_Input)
{
o_TTY = new ManageSerialPort;
 
o_TTY->setBaudRate(BAUD57600); //BaudRate
o_TTY->setDataBits(DATA_8); //DataBits
o_TTY->setParity(PAR_NONE); //Parity
o_TTY->setStopBits(STOP_1); //StopBits
o_TTY->setFlowControl(FLOW_OFF); //FlowControl
 
o_TTY->setTimeout(0, 10);
o_TTY->enableSending();
o_TTY->enableReceiving();
 
o_TTY->setPort(s_Input.Main); //Port
o_TTY->open();
 
if (o_TTY->isOpen())
{
connect(o_TTY, SIGNAL(newDataReceived(const QByteArray &)), this, SLOT(slot_Receive(const QByteArray &)));
 
o_TTY->receiveData();
// qDebug(QString("Open Input-TTY " + s_Input.Main).toLatin1().data());
 
return true;
}
return false;
}
 
bool Input_TTY::IsOpen()
{
return o_TTY->isOpen();
}
 
bool Input_TTY::Close()
{
o_TTY->close();
 
disconnect(o_TTY, SIGNAL(newDataReceived(const QByteArray &)), this, 0);
 
Timer->stop();
 
return o_TTY->isOpen();
}
 
void Input_TTY::send_Data(QString t_Data, int ID)
{
if ((ID > 0) && (ID < MAX_Confirm))
{
Timer->start(2500);
Confirm[ID].ID = true;
Confirm[ID].Data = t_Data;
}
 
if (o_TTY->isOpen())
{
if (t_Data[t_Data.length() - 1] != '\r')
{
t_Data = t_Data + "\r";
}
 
QByteArray Temp;
 
Temp = QByteArray(t_Data.toAscii());
 
o_TTY->sendData(Temp);
 
// qDebug(t_Data.toLatin1().data());
}
}
 
void Input_TTY::send_RawData(char *t_Data)
{
t_Data = t_Data;
}
 
void Input_TTY::slot_Receive(const QByteArray &dataReceived)
{
const char *RX;
RX = dataReceived.data();
int a = 0;
 
while (RX[a] != '\0')
{
if (RX[a] == '\r')
{
emit(sig_NewData(s_RX));
s_RX = QString("");
}
else
{
s_RX = s_RX + QString(RX[a]);
}
a++;
}
}
 
void Input_TTY::stop_Resend(int ID)
{
if ((ID > 0) && (ID < MAX_Confirm))
{
Confirm[ID].ID = false;
Confirm[ID].Data = "";
}
}
 
void Input_TTY::slot_Timer()
{
bool Active = false;
 
for (int x = 0; x < MAX_Confirm; x++)
{
if (Confirm[x].ID)
{
Active = true;
send_Data(Confirm[x].Data);
}
}
 
if (Active == false)
{
Timer->stop();
}
}
 
eMode Input_TTY::Mode()
{
return TTY;
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_Input/Input_TTY.h
0,0 → 1,57
/***************************************************************************
* 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 INPUT_TTY_H
#define INPUT_TTY_H
 
#include <QObject>
#include <QTimer>
 
#include "Input.h"
#include "../Class_SerialPort/ManageSerialPort.h"
 
class Input_TTY : public Input
{
Q_OBJECT
 
public:
void Init();
bool Open(set_Input s_Input);
bool IsOpen();
bool Close();
void send_Data(QString t_Data, int ID = 0);
void send_RawData(char *t_Data);
void stop_Resend(int ID);
eMode Mode();
 
private:
ManageSerialPort *o_TTY;
QString s_RX;
QTimer *Timer;
s_Resend Confirm[MAX_Confirm];
 
private slots:
void slot_Receive(const QByteArray &dataReceived);
void slot_Timer();
 
signals:
void sig_NewData(QString Data);
 
};
 
#endif // INPUT_TTY_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/circlepoint.cpp
0,0 → 1,72
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "circlepoint.h"
namespace qmapcontrol
{
CirclePoint::CirclePoint(qreal x, qreal y, int radius, QString name, Alignment alignment, QPen* pen)
: Point(x, y, name, alignment)
{
size = QSize(radius, radius);
mypixmap = new QPixmap(radius+1, radius+1);
mypixmap->fill(Qt::transparent);
QPainter painter(mypixmap);
if (pen != 0)
{
painter.setPen(*pen);
}
painter.drawEllipse(0,0,radius, radius);
}
 
CirclePoint::CirclePoint(qreal x, qreal y, QString name, Alignment alignment, QPen* pen)
: Point(x, y, name, alignment)
{
int radius = 10;
size = QSize(radius, radius);
mypixmap = new QPixmap(radius+1, radius+1);
mypixmap->fill(Qt::transparent);
QPainter painter(mypixmap);
if (pen != 0)
{
painter.setPen(*pen);
}
painter.drawEllipse(0,0,radius, radius);
}
 
CirclePoint::~CirclePoint()
{
delete mypixmap;
}
 
void CirclePoint::setPen(QPen* pen)
{
mypen = pen;
mypixmap = new QPixmap(size.width()+1, size.height()+1);
mypixmap->fill(Qt::transparent);
QPainter painter(mypixmap);
painter.setPen(*pen);
painter.drawEllipse(0,0, size.width(), size.height());
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/circlepoint.h
0,0 → 1,77
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef CIRCLEPOINT_H
#define CIRCLEPOINT_H
 
#include "point.h"
 
namespace qmapcontrol
{
//! Draws a circle into the map
/*! This is a conveniece class for Point.
* It configures the pixmap of a Point to draw a circle.
* A QPen could be used to change the color or line-width of the circle
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
class CirclePoint : public Point
{
public:
//!
/*!
*
* @param x longitude
* @param y latitude
* @param name name of the circle point
* @param alignment alignment (Middle or TopLeft)
* @param pen QPen for drawing
*/
CirclePoint(qreal x, qreal y, QString name = QString(), Alignment alignment = Middle, QPen* pen=0);
 
//!
/*!
*
* @param x longitude
* @param y latitude
* @param radius the radius of the circle
* @param name name of the circle point
* @param alignment alignment (Middle or TopLeft)
* @param pen QPen for drawing
*/
CirclePoint(qreal x, qreal y, int radius = 10, QString name = QString(), Alignment alignment = Middle, QPen* pen=0);
virtual ~CirclePoint();
 
//! sets the QPen which is used for drawing the circle
/*!
* A QPen can be used to modify the look of the drawn circle
* @param pen the QPen which should be used for drawing
* @see http://doc.trolltech.com/4.3/qpen.html
*/
virtual void setPen(QPen* pen);
 
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/curve.cpp
0,0 → 1,41
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "curve.h"
namespace qmapcontrol
{
Curve::Curve(QString name)
: Geometry(name)
{
}
 
 
Curve::~Curve()
{
}
}
// Geometry Curve::Clone(){}
 
// QRectF Curve::GetBoundingBox(){}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/curve.h
0,0 → 1,65
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef CURVE_H
#define CURVE_H
 
#include "geometry.h"
#include "point.h"
 
namespace qmapcontrol
{
//! A Curve Geometry, implemented to fullfil OGC Spec
/*!
* The Curve class is used by LineString as parent class.
* This class could not be used directly.
*
* From the OGC Candidate Implementation Specification:
* "A Curve is a 1-dimensional geometric object usually stored as a sequence of Points, with the subtype of Curve
* specifying the form of the interpolation between Points. This specification defines only one subclass of Curve,
* LineString, which uses a linear interpolation between Points."
* @author Kai Winter <kaiwinter@gmx.de>
*/
class Curve : public Geometry
{
Q_OBJECT
public:
virtual ~Curve();
 
double Length;
 
// virtual Geometry Clone();
// virtual QRectF GetBoundingBox();
 
// virtual Point EndPoint() = 0;
// virtual Point StartPoint() = 0;
// virtual Point Value() = 0;
 
protected:
Curve(QString name = QString());
virtual void draw(QPainter* painter, const MapAdapter* mapadapter, const QRect &screensize, const QPoint offset) = 0;
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/emptymapadapter.cpp
0,0 → 1,117
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "emptymapadapter.h"
namespace qmapcontrol
{
EmptyMapAdapter::EmptyMapAdapter(int tileSize, int minZoom, int maxZoom)
:MapAdapter("", "", 256, minZoom, maxZoom)
{
PI = acos(-1.0);
 
numberOfTiles = tilesonzoomlevel(minZoom);
}
 
EmptyMapAdapter::~EmptyMapAdapter()
{
}
 
void EmptyMapAdapter::zoom_in()
{
if (current_zoom < max_zoom)
{
current_zoom = current_zoom + 1;
}
numberOfTiles = tilesonzoomlevel(current_zoom);
}
 
void EmptyMapAdapter::zoom_out()
{
if (current_zoom > min_zoom)
{
current_zoom = current_zoom - 1;
}
numberOfTiles = tilesonzoomlevel(current_zoom);
}
 
qreal EmptyMapAdapter::deg_rad(qreal x) const
{
return x * (PI/180.0);
}
qreal EmptyMapAdapter::rad_deg(qreal x) const
{
return x * (180/PI);
}
 
QString EmptyMapAdapter::query(int x, int y, int z) const
{
return "";
}
 
QPoint EmptyMapAdapter::coordinateToDisplay(const QPointF& coordinate) const
{
qreal x = (coordinate.x()+180) * (numberOfTiles*mytilesize)/360.; // coord to pixel!
qreal y = (1-(log(tan(PI/4+deg_rad(coordinate.y())/2)) /PI)) /2 * (numberOfTiles*mytilesize);
 
return QPoint(int(x), int(y));
}
 
QPointF EmptyMapAdapter::displayToCoordinate(const QPoint& point) const
{
qreal longitude = (point.x()*(360/(numberOfTiles*mytilesize)))-180;
qreal latitude = rad_deg(atan(sinh((1-point.y()*(2/(numberOfTiles*mytilesize)))*PI)));
 
return QPointF(longitude, latitude);
 
}
 
bool EmptyMapAdapter::isValid(int x, int y, int z) const
{
if (max_zoom < min_zoom)
{
z= min_zoom - z;
}
 
if (x<0 || x>pow(2,z)-1 ||
y<0 || y>pow(2,z)-1)
{
return false;
}
return true;
 
}
int EmptyMapAdapter::tilesonzoomlevel(int zoomlevel) const
{
return int(pow(2, zoomlevel));
}
int EmptyMapAdapter::xoffset(int x) const
{
return x;
}
int EmptyMapAdapter::yoffset(int y) const
{
return y;
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/emptymapadapter.h
0,0 → 1,73
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef EMPTYMAPADAPTER_H
#define EMPTYMAPADAPTER_H
 
#include "mapadapter.h"
 
namespace qmapcontrol
{
//! MapAdapter which do not load map tiles.
/*!
* The EmptyMapAdapter can be used if QMapControl should not load any map tiles. This is useful if you
* only want to display an image through a FixedImageOverlay e.g.
* @author Kai Winter <kaiwinter@gmx.de>
*/
class EmptyMapAdapter : public MapAdapter
{
Q_OBJECT
public:
//! Constructor.
/*!
* @param tileSize This parameter seems unnecessary for this type of MapAdaper on first sight. But since
* this parameter defines the size of the offscreen image it could be used for a little performance
* tuning (larger offscreen-images have to be redrawed less times).
* @param minZoom the minimum zoom level
* @param maxZoom the maximum zoom level
*/
EmptyMapAdapter(int tileSize = 256, int minZoom = 0, int maxZoom = 17);
 
virtual ~EmptyMapAdapter();
 
virtual QPoint coordinateToDisplay(const QPointF&) const;
virtual QPointF displayToCoordinate(const QPoint&) const;
 
qreal PI;
 
protected:
qreal rad_deg(qreal) const;
qreal deg_rad(qreal) const;
 
virtual bool isValid(int x, int y, int z) const;
virtual void zoom_in();
virtual void zoom_out();
virtual QString query(int x, int y, int z) const;
virtual int tilesonzoomlevel(int zoomlevel) const;
virtual int xoffset(int x) const;
virtual int yoffset(int y) const;
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/fixedimageoverlay.cpp
0,0 → 1,69
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2009 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "fixedimageoverlay.h"
namespace qmapcontrol
{
FixedImageOverlay::FixedImageOverlay(qreal x_upperleft, qreal y_upperleft, qreal x_lowerright, qreal y_lowerright, QString filename, QString name)
: ImagePoint(x_upperleft, y_upperleft, filename, name, TopLeft),
x_lowerright(x_lowerright), y_lowerright(y_lowerright)
{
//qDebug() << "loading image: " << filename;
mypixmap = new QPixmap(filename);
size = mypixmap->size();
//qDebug() << "image size: " << size;
}
 
FixedImageOverlay::FixedImageOverlay(qreal x_upperleft, qreal y_upperleft, qreal x_lowerright, qreal y_lowerright, QPixmap* pixmap, QString name)
: ImagePoint(x_upperleft, y_upperleft, pixmap, name, TopLeft),
x_lowerright(x_lowerright), y_lowerright(y_lowerright)
{
mypixmap = pixmap;
size = mypixmap->size();
}
 
void FixedImageOverlay::draw(QPainter* painter, const MapAdapter* mapadapter, const QRect &viewport, const QPoint offset)
{
if (!visible)
return;
 
if (mypixmap !=0)
{
const QPointF c = QPointF(X, Y);
QPoint topleft = mapadapter->coordinateToDisplay(c);
 
const QPointF c2 = QPointF(x_lowerright, y_lowerright);
QPoint lowerright = mapadapter->coordinateToDisplay(c2);
 
painter->drawPixmap(topleft.x(), topleft.y(), lowerright.x()-topleft.x(), lowerright.y()-topleft.y(), *mypixmap);
}
 
 
}
 
FixedImageOverlay::~FixedImageOverlay()
{
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/fixedimageoverlay.h
0,0 → 1,80
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2009 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef FIXEDIMAGEOVERLAY_H
#define FIXEDIMAGEOVERLAY_H
 
#include "imagepoint.h"
 
namespace qmapcontrol
{
 
//! Draws a fixed image into the map.
/*!
* This class draws a image overlay onto a map, whose upper left and lower
* right corners lay always on the given coordinates. The methods
* setBaselevel, setMaxsize and setMinsize have no effect for this class.
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
class FixedImageOverlay : public ImagePoint
{
public:
//! Creates an image overlay which loads and displays the given image file
/*!
* Use this contructor to load the given image file and let the point
* display it.
* When you want multiple points to display the same image, use the
* other contructor and pass a pointer to that image.
* @param x_upperleft the coordinate of the upper left corner where the image should be aligned
* @param y_upperleft the coordinate of the upper left corner where the image should be aligned
* @param x_lowerright the coordinate of the lower right corner where the image should be aligned
* @param y_lowerright the coordinate of the lower right corner where the image should be aligned
* @param filename the file which should be loaded and displayed
* @param name the name of the image point
*/
FixedImageOverlay(qreal x_upperleft, qreal y_upperleft, qreal x_lowerright, qreal y_lowerright, QString filename, QString name = QString());
 
//! Creates an image overlay which displays the given image
/*!
* Use this contructor to display the given image.
* @param x_upperleft the coordinate of the upper left corner where the image should be aligned
* @param y_upperleft the coordinate of the upper left corner where the image should be aligned
* @param x_lowerright the coordinate of the lower right corner where the image should be aligned
* @param y_lowerright the coordinate of the lower right corner where the image should be aligned
* @param pixmap pointer to the image pixmap
* @param name the name of the image point
*/
FixedImageOverlay(qreal x_upperleft, qreal y_upperleft, qreal x_lowerright, qreal y_lowerright, QPixmap* pixmap, QString name = QString());
 
virtual void draw(QPainter* painter, const MapAdapter* mapadapter, const QRect &viewport, const QPoint offset);
virtual ~FixedImageOverlay();
 
private:
qreal x_lowerright;
qreal y_lowerright;
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/geometry.cpp
0,0 → 1,88
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "geometry.h"
namespace qmapcontrol
{
Geometry::Geometry(QString name)
: GeometryType("Geometry"), myparentGeometry(0), mypen(0), visible(true), myname(name)
{
}
 
 
Geometry::~Geometry()
{
}
 
QString Geometry::name() const
{
return myname;
}
Geometry* Geometry::parentGeometry() const
{
return myparentGeometry;
}
void Geometry::setParentGeometry(Geometry* geom)
{
myparentGeometry = geom;
}
bool Geometry::hasPoints() const
{
return false;
}
bool Geometry::hasClickedPoints() const
{
return false;
}
QList<Geometry*> Geometry::clickedPoints()
{
QList<Geometry*> tmp;
return tmp;
}
 
bool Geometry::isVisible() const
{
return visible;
}
void Geometry::setVisible(bool visible)
{
this->visible = visible;
emit(updateRequest(boundingBox()));
}
 
void Geometry::setName(QString name)
{
myname = name;
}
 
void Geometry::setPen(QPen* pen)
{
mypen = pen;
}
QPen* Geometry::pen() const
{
return mypen;
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/geometry.h
0,0 → 1,154
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef GEOMETRY_H
#define GEOMETRY_H
#include <QObject>
#include <QPainter>
#include <QDebug>
#include "mapadapter.h"
 
namespace qmapcontrol
{
class Point;
//! Main class for objects that should be painted in maps
/*!
* Geometry is the root class of the hierarchy. Geometry is an abstract (non-instantiable) class.
*
* This class and the derived classes Point, Curve and LineString are leant on the Simple
* Feature Specification of the Open Geospatial Consortium.
* @see www.opengeospatial.com
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
class Geometry : public QObject
{
friend class LineString;
Q_OBJECT
public:
explicit Geometry(QString name = QString());
virtual ~Geometry();
 
QString GeometryType;
 
//!
/*! returns true if the given Geometry is equal to this Geometry
* not implemented yet!
* @param geom The Geometry to be tested
* @return true if the given Geometry is equal to this
*/
bool Equals(Geometry* geom);
 
//! returns a String representation of this Geometry
/*!
* not implemented yet!
* @return a String representation of this Geometry
*/
QString toString();
 
//! returns the name of this Geometry
/*!
* @return the name of this Geometry
*/
QString name() const;
 
//! returns the parent Geometry of this Geometry
/*!
* A LineString is a composition of many Points. This methods returns the parent (the LineString) of a Point
* @return the parent Geometry of this Geometry
*/
Geometry* parentGeometry() const;
 
//! returns true if this Geometry is visible
/*!
* @return true if this Geometry is visible
*/
bool isVisible() const;
 
//! sets the name of the geometry
/*!
* @param name the new name of the geometry
*/
void setName(QString name);
 
//! returns the QPen which is used on drawing
/*!
* The pen is set depending on the Geometry. A CirclePoint for example takes one with the constructor.
* @return the QPen which is used for drawing
*/
QPen* pen() const;
 
//! returns the BoundingBox
/*!
* The bounding box in world coordinates
* @return the BoundingBox
*/
virtual QRectF boundingBox()=0;
virtual bool Touches(Point* geom, const MapAdapter* mapadapter)=0;
virtual void draw(QPainter* painter, const MapAdapter* mapadapter, const QRect &viewport, const QPoint offset)=0;
virtual bool hasPoints() const;
virtual bool hasClickedPoints() const;
virtual void setPen(QPen* pen);
virtual QList<Geometry*> clickedPoints();
virtual QList<Point*> points()=0;
 
private:
Geometry* myparentGeometry;
Geometry(const Geometry& old);
Geometry& operator=(const Geometry& rhs);
 
protected:
QPen* mypen;
bool visible;
QString myname;
void setParentGeometry(Geometry* geom);
 
signals:
void updateRequest(Geometry* geom);
void updateRequest(QRectF rect);
//! This signal is emitted when a Geometry is clicked
/*!
* A Geometry is clickable, if the containing layer is clickable.
* The objects emits a signal if it gets clicked
* @param geometry The clicked Geometry
* @param point -unused-
*/
void geometryClicked(Geometry* geometry, QPoint point);
 
//! A Geometry emits this signal, when its position gets changed
/*!
* @param geom the Geometry
*/
void positionChanged(Geometry* geom);
 
public slots:
//! if visible is true, the layer is made visible
/*!
* @param visible if the layer should be visible
*/
virtual void setVisible(bool visible);
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/geometrylayer.cpp
0,0 → 1,38
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "geometrylayer.h"
namespace qmapcontrol
{
GeometryLayer::GeometryLayer(QString layername, MapAdapter* mapadapter, bool takeevents)
: Layer(layername, mapadapter, Layer::GeometryLayer, takeevents)
{
}
 
 
GeometryLayer::~GeometryLayer()
{
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/geometrylayer.h
0,0 → 1,65
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef GEOMETRYLAYER_H
#define GEOMETRYLAYER_H
 
#include "layer.h"
 
namespace qmapcontrol
{
//! GeometryLayer class
/*!
* There are two different layer types:
* - MapLayer: Displays Maps, but also Geometries. The configuration for displaying maps have to be done in the MapAdapter
* - GeometryLayer: Only displays Geometry objects.
*
* MapLayers also can display Geometry objects. The difference to the GeometryLayer is the repainting. Objects that are
* added to a MapLayer are "baken" on the map. This means, when you change it´s position for example the changes are
* not visible until a new offscreen image has been drawn. If you have "static" Geometries which won´t change their
* position this is fine. But if you want to change the objects position or pen you should use a GeometryLayer. Those
* are repainted immediately on changes.
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
class GeometryLayer : public Layer
{
Q_OBJECT
 
public:
//! GeometryLayer constructor
/*!
* This is used to construct a map layer.
*
* @param layername The name of the Layer
* @param mapadapter The MapAdapter which does coordinate translation and Query-String-Forming
* @param takeevents Should the Layer receive MouseEvents? This is set to true by default. Setting it to false could
* be something like a "speed up hint"
*/
GeometryLayer(QString layername, MapAdapter* mapadapter, bool takeevents=true);
virtual ~GeometryLayer();
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/googlemapadapter.cpp
0,0 → 1,39
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "googlemapadapter.h"
namespace qmapcontrol
{
GoogleMapAdapter::GoogleMapAdapter()
: TileMapAdapter("mt1.google.com", "/vt/lyrs=m@120&hl=de&x=%2&y=%3&z=%1&s=", 256, 0, 17)
// : TileMapAdapter("mt1.google.com", "/mt?n=404&x=%2&y=%3&zoom=%1", 256, 17, 0)
// : TileMapAdapter("server.arcgisonline.com", "/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/tile/%1/%3/%2", 512, 0, 17)
{
}
 
GoogleMapAdapter::~GoogleMapAdapter()
{
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/googlemapadapter.h
0,0 → 1,51
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef GOOGLEMAPADAPTER_H
#define GOOGLEMAPADAPTER_H
 
#include "tilemapadapter.h"
 
namespace qmapcontrol
{
//! MapAdapter for Google
/*!
* This is a conveniece class, which extends and configures a TileMapAdapter
* @author Kai Winter <kaiwinter@gmx.de>
*/
class GoogleMapAdapter : public TileMapAdapter
{
Q_OBJECT
 
public:
//! constructor
/*!
* This construct a Google Adapter
*/
GoogleMapAdapter();
virtual ~GoogleMapAdapter();
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/googlesatmapadapter.cpp
0,0 → 1,37
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "googlesatmapadapter.h"
namespace qmapcontrol
{
GoogleSatMapAdapter::GoogleSatMapAdapter()
: TileMapAdapter("khm1.google.com", "/kh/v=57&hl=de&x=%2&y=%3&z=%1&s=", 256, 0, 20)
{
}
 
GoogleSatMapAdapter::~GoogleSatMapAdapter()
{
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/googlesatmapadapter.h
0,0 → 1,51
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef GOOGLESATMAPADAPTER_H
#define GOOGLESATMAPADAPTER_H
 
#include "tilemapadapter.h"
 
namespace qmapcontrol
{
//! MapAdapter for Google
/*!
* This is a conveniece class, which extends and configures a TileMapAdapter
* @author Kai Winter <kaiwinter@gmx.de>
*/
class GoogleSatMapAdapter : public TileMapAdapter
{
Q_OBJECT
 
public:
//! constructor
/*!
* This construct a Google Adapter
*/
GoogleSatMapAdapter();
virtual ~GoogleSatMapAdapter();
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/gps_position.cpp
0,0 → 1,33
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "gps_position.h"
namespace qmapcontrol
{
GPS_Position::GPS_Position(float time, float longitude, QString longitude_dir, float latitude, QString latitude_dir)
:time(time), longitude(longitude), latitude(latitude), longitude_dir(longitude_dir), latitude_dir(latitude_dir)
{
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/gps_position.h
0,0 → 1,52
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef GPS_POSITION_H
#define GPS_POSITION_H
 
#include <QString>
 
namespace qmapcontrol
{
//! Represents a coordinate from a GPS receiver
/*!
* This class is used to represent a coordinate which has been parsed from a NMEA string.
* This is not fully integrated in the API. An example which uses this data type can be found under Samples.
* @author Kai Winter
*/
class GPS_Position
{
public:
GPS_Position(float time, float longitude, QString longitude_dir, float latitude, QString latitude_dir);
float time; /*!< time of the string*/
float longitude; /*!< longitude coordinate*/
float latitude; /*!< latitude coordinate*/
 
private:
QString longitude_dir;
QString latitude_dir;
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/imagemanager.cpp
0,0 → 1,182
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "imagemanager.h"
namespace qmapcontrol
{
ImageManager* ImageManager::m_Instance = 0;
ImageManager::ImageManager(QObject* parent)
:QObject(parent), emptyPixmap(QPixmap(1,1)), net(new MapNetwork(this)), doPersistentCaching(false)
{
emptyPixmap.fill(Qt::transparent);
 
if (QPixmapCache::cacheLimit() <= 20000)
{
QPixmapCache::setCacheLimit(20000); // in kb
}
}
 
 
ImageManager::~ImageManager()
{
if (ImageManager::m_Instance != 0)
{
delete ImageManager::m_Instance;
}
delete net;
}
 
QPixmap ImageManager::getImage(const QString& host, const QString& url)
{
//qDebug() << "ImageManager::getImage";
QPixmap pm;
//pm.fill(Qt::black);
 
//is image cached (memory) or currently loading?
if (!QPixmapCache::find(url, pm) && !net->imageIsLoading(url))
// if (!images.contains(url) && !net->imageIsLoading(url))
{
//image cached (persistent)?
if (doPersistentCaching && tileExist(url))
{
loadTile(url,pm);
QPixmapCache::insert(url.toAscii().toBase64(), pm);
}
else
{
//load from net, add empty image
net->loadImage(host, url);
//QPixmapCache::insert(url, emptyPixmap);
return emptyPixmap;
}
}
return pm;
}
 
QPixmap ImageManager::prefetchImage(const QString& host, const QString& url)
{
#ifdef Q_WS_QWS
// on mobile devices we don´t want the display resfreshing when tiles are received which are
// prefetched... This is a performance issue, because mobile devices are very slow in
// repainting the screen
prefetch.append(url);
#endif
return getImage(host, url);
}
 
void ImageManager::receivedImage(const QPixmap pixmap, const QString& url)
{
//qDebug() << "ImageManager::receivedImage";
QPixmapCache::insert(url, pixmap);
//images[url] = pixmap;
 
// needed?
if (doPersistentCaching && !tileExist(url) )
saveTile(url,pixmap);
 
//((Layer*)this->parent())->imageReceived();
 
if (!prefetch.contains(url))
{
emit(imageReceived());
}
else
{
 
#ifdef Q_WS_QWS
prefetch.remove(prefetch.indexOf(url));
#endif
}
}
 
void ImageManager::loadingQueueEmpty()
{
emit(loadingFinished());
//((Layer*)this->parent())->removeZoomImage();
//qDebug() << "size of image-map: " << images.size();
//qDebug() << "size: " << QPixmapCache::cacheLimit();
}
 
void ImageManager::abortLoading()
{
net->abortLoading();
}
void ImageManager::setProxy(QString host, int port)
{
net->setProxy(host, port);
}
 
void ImageManager::setCacheDir(const QDir& path)
{
doPersistentCaching = true;
cacheDir = path;
if (!cacheDir.exists())
{
cacheDir.mkpath(cacheDir.absolutePath());
}
}
 
bool ImageManager::saveTile(QString tileName,QPixmap tileData)
{
tileName.replace("/","-");
 
QFile file(cacheDir.absolutePath() + "/" + tileName.toAscii().toBase64());
 
//qDebug() << "writing: " << file.fileName();
if (!file.open(QIODevice::ReadWrite )){
qDebug()<<"error reading file";
return false;
}
QByteArray bytes;
QBuffer buffer(&bytes);
buffer.open(QIODevice::WriteOnly);
tileData.save(&buffer, "PNG");
 
file.write(bytes);
file.close();
return true;
}
bool ImageManager::loadTile(QString tileName,QPixmap &tileData)
{
tileName.replace("/","-");
QFile file(cacheDir.absolutePath() + "/" + tileName.toAscii().toBase64());
if (!file.open(QIODevice::ReadOnly )) {
return false;
}
tileData.loadFromData( file.readAll() );
 
file.close();
return true;
}
bool ImageManager::tileExist(QString tileName)
{
tileName.replace("/","-");
QFile file(cacheDir.absolutePath() + "/" + tileName.toAscii().toBase64());
if (file.exists())
return true;
else
return false;
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/imagemanager.h
0,0 → 1,125
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef IMAGEMANAGER_H
#define IMAGEMANAGER_H
 
#include <QObject>
#include <QPixmapCache>
#include <QDebug>
#include <QMutex>
#include <QFile>
#include <QBuffer>
#include <QDir>
#include "mapnetwork.h"
 
namespace qmapcontrol
{
class MapNetwork;
/**
@author Kai Winter <kaiwinter@gmx.de>
*/
class ImageManager : public QObject
{
Q_OBJECT;
 
public:
static ImageManager* instance()
{
if(!m_Instance)
{
m_Instance = new ImageManager;
}
return m_Instance;
}
 
~ImageManager();
//! returns a QPixmap of the asked image
/*!
* If this component doesn´t have the image a network query gets started to load it.
* @param host the host of the image
* @param path the path to the image
* @return the pixmap of the asked image
*/
QPixmap getImage(const QString& host, const QString& path);
 
QPixmap prefetchImage(const QString& host, const QString& path);
 
void receivedImage(const QPixmap pixmap, const QString& url);
 
/*!
* This method is called by MapNetwork, after all images in its queue were loaded.
* The ImageManager emits a signal, which is used in MapControl to remove the zoom image.
* The zoom image should be removed on Tile Images with transparency.
* Else the zoom image stay visible behind the newly loaded tiles.
*/
void loadingQueueEmpty();
 
/*!
* Aborts all current loading threads.
* This is useful when changing the zoom-factor, though newly needed images loads faster
*/
void abortLoading();
 
//! sets the proxy for HTTP connections
/*!
* This method sets the proxy for HTTP connections.
* This is not provided by the current Qtopia version!
* @param host the proxy´s hostname or ip
* @param port the proxy´s port
*/
void setProxy(QString host, int port);
 
//! sets the cache directory for persistently saving map tiles
/*!
*
* @param path the path where map tiles should be stored
* @todo add maximum size
*/
void setCacheDir(const QDir& path);
 
private:
ImageManager(QObject* parent = 0);
ImageManager(const ImageManager&);
ImageManager& operator=(const ImageManager&);
QPixmap emptyPixmap;
MapNetwork* net;
QVector<QString> prefetch;
QDir cacheDir;
bool doPersistentCaching;
 
static ImageManager* m_Instance;
 
bool saveTile(QString tileName,QPixmap tileData);
bool loadTile(QString tileName,QPixmap &tileData);
bool tileExist(QString tileName);
 
signals:
void imageReceived();
void loadingFinished();
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/imagepoint.cpp
0,0 → 1,49
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "imagepoint.h"
namespace qmapcontrol
{
ImagePoint::ImagePoint(qreal x, qreal y, QString filename, QString name, Alignment alignment)
: Point(x, y, name, alignment)
{
//qDebug() << "loading image: " << filename;
mypixmap = new QPixmap(filename);
size = mypixmap->size();
//qDebug() << "image size: " << size;
}
 
ImagePoint::ImagePoint(qreal x, qreal y, QPixmap* pixmap, QString name, Alignment alignment)
: Point(x, y, name, alignment)
{
mypixmap = pixmap;
size = mypixmap->size();
}
 
 
ImagePoint::~ImagePoint()
{
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/imagepoint.h
0,0 → 1,70
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef IMAGEPOINT_H
#define IMAGEPOINT_H
 
#include "point.h"
 
namespace qmapcontrol
{
 
//! Draws an image into the map
/*! This is a convenience class for Point.
* It configures the pixmap of a Point to draw the given image.
* The image will be loaded from the given path and written in the points pixmap.
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
class ImagePoint : public Point
{
public:
//! Creates a point which loads and displays the given image file
/*!
* Use this contructor to load the given image file and let the point display it.
* When you want multiple points to display the same image, use the other contructor and pass a pointer to that image.
* @param x longitude
* @param y latitude
* @param filename the file which should be loaded and displayed
* @param name the name of the image point
* @param alignment alignment (Middle or TopLeft)
*/
ImagePoint(qreal x, qreal y, QString filename, QString name = QString(), Alignment alignment = Middle);
 
//! Creates a point which displays the given image
/*!
* Use this contructor to display the given image.
* You have to load that image yourself, but can use it for multiple points.
* @param x longitude
* @param y latitude
* @param pixmap pointer to the image pixmap
* @param name the name of the image point
* @param alignment alignment (Middle or TopLeft)
*/
ImagePoint(qreal x, qreal y, QPixmap* pixmap, QString name = QString(), Alignment alignment = Middle);
virtual ~ImagePoint();
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/layer.cpp
0,0 → 1,307
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "layer.h"
namespace qmapcontrol
{
Layer::Layer(QString layername, MapAdapter* mapadapter, enum LayerType layertype, bool takeevents)
:visible(true), mylayername(layername), mylayertype(layertype), mapAdapter(mapadapter), takeevents(takeevents), myoffscreenViewport(QRect(0,0,0,0))
{
//qDebug() << "creating new Layer: " << layername << ", type: " << contents;
//qDebug() << this->layertype;
}
 
Layer::~Layer()
{
delete mapAdapter;
}
 
void Layer::setSize(QSize size)
{
this->size = size;
screenmiddle = QPoint(size.width()/2, size.height()/2);
//QMatrix mat;
//mat.translate(480/2, 640/2);
//mat.rotate(45);
//mat.translate(-480/2,-640/2);
//screenmiddle = mat.map(screenmiddle);
}
 
QString Layer::layername() const
{
return mylayername;
}
 
const MapAdapter* Layer::mapadapter() const
{
return mapAdapter;
}
 
void Layer::setVisible(bool visible)
{
this->visible = visible;
emit(updateRequest());
}
 
void Layer::addGeometry(Geometry* geom)
{
//qDebug() << geom->getName() << ", " << geom->getPoints().at(0)->getWidget();
 
geometries.append(geom);
emit(updateRequest(geom->boundingBox()));
//a geometry can request a redraw, e.g. when its position has been changed
connect(geom, SIGNAL(updateRequest(QRectF)),
this, SIGNAL(updateRequest(QRectF)));
}
void Layer::removeGeometry(Geometry* geometry)
{
for (int i=0; i<geometries.count(); i++)
{
if (geometry == geometries.at(i))
{
disconnect(geometry);
geometries.removeAt(i);
//delete geometry;
}
}
}
 
void Layer::clearGeometries()
{
foreach(Geometry *geometry, geometries){
disconnect(geometry);
}
geometries.clear();
}
 
bool Layer::isVisible() const
{
return visible;
}
void Layer::zoomIn() const
{
mapAdapter->zoom_in();
}
void Layer::zoomOut() const
{
mapAdapter->zoom_out();
}
 
void Layer::mouseEvent(const QMouseEvent* evnt, const QPoint mapmiddle_px)
{
if (takesMouseEvents())
{
if (evnt->button() == Qt::LeftButton && evnt->type() == QEvent::MouseButtonPress)
{
// check for collision
QPointF c = mapAdapter->displayToCoordinate(QPoint(evnt->x()-screenmiddle.x()+mapmiddle_px.x(),
evnt->y()-screenmiddle.y()+mapmiddle_px.y()));
Point* tmppoint = new Point(c.x(), c.y());
for (int i=0; i<geometries.count(); i++)
{
if (geometries.at(i)->isVisible() && geometries.at(i)->Touches(tmppoint, mapAdapter))
 
//if (geometries.at(i)->Touches(c, mapAdapter))
{
emit(geometryClicked(geometries.at(i), QPoint(evnt->x(), evnt->y())));
}
}
delete tmppoint;
}
}
}
 
bool Layer::takesMouseEvents() const
{
return takeevents;
}
 
void Layer::drawYourImage(QPainter* painter, const QPoint mapmiddle_px) const
{
if (mylayertype == MapLayer)
{
//qDebug() << ":: " << mapmiddle_px;
//QMatrix mat;
//mat.translate(480/2, 640/2);
//mat.rotate(45);
//mat.translate(-480/2,-640/2);
 
//mapmiddle_px = mat.map(mapmiddle_px);
//qDebug() << ":: " << mapmiddle_px;
_draw(painter, mapmiddle_px);
}
 
drawYourGeometries(painter, QPoint(mapmiddle_px.x()-screenmiddle.x(), mapmiddle_px.y()-screenmiddle.y()), myoffscreenViewport);
}
void Layer::drawYourGeometries(QPainter* painter, const QPoint mapmiddle_px, QRect viewport) const
{
QPoint offset;
if (mylayertype == MapLayer)
offset = mapmiddle_px;
else
offset = mapmiddle_px-screenmiddle;
 
painter->translate(-mapmiddle_px+screenmiddle);
for (int i=0; i<geometries.count(); i++)
{
geometries.at(i)->draw(painter, mapAdapter, viewport, offset);
}
painter->translate(mapmiddle_px-screenmiddle);
 
}
void Layer::_draw(QPainter* painter, const QPoint mapmiddle_px) const
{
// screen middle rotieren...
 
int tilesize = mapAdapter->tilesize();
int cross_x = int(mapmiddle_px.x())%tilesize; // position on middle tile
int cross_y = int(mapmiddle_px.y())%tilesize;
//qDebug() << screenmiddle << " - " << cross_x << ", " << cross_y;
 
// calculate how many surrounding tiles have to be drawn to fill the display
int space_left = screenmiddle.x() - cross_x;
int tiles_left = space_left/tilesize;
if (space_left>0)
tiles_left+=1;
 
int space_above = screenmiddle.y() - cross_y;
int tiles_above = space_above/tilesize;
if (space_above>0)
tiles_above+=1;
 
int space_right = screenmiddle.x() - (tilesize-cross_x);
int tiles_right = space_right/tilesize;
if (space_right>0)
tiles_right+=1;
 
int space_bottom = screenmiddle.y() - (tilesize-cross_y);
int tiles_bottom = space_bottom/tilesize;
if (space_bottom>0)
tiles_bottom+=1;
 
//int tiles_displayed = 0;
int mapmiddle_tile_x = mapmiddle_px.x()/tilesize;
int mapmiddle_tile_y = mapmiddle_px.y()/tilesize;
 
const QPoint from = QPoint((-tiles_left+mapmiddle_tile_x)*tilesize, (-tiles_above+mapmiddle_tile_y)*tilesize);
const QPoint to = QPoint((tiles_right+mapmiddle_tile_x+1)*tilesize, (tiles_bottom+mapmiddle_tile_y+1)*tilesize);
 
myoffscreenViewport = QRect(from, to);
 
// for the EmptyMapAdapter no tiles should be loaded and painted.
if (mapAdapter->host() == "")
{
return;
}
 
if (mapAdapter->isValid(mapmiddle_tile_x, mapmiddle_tile_y, mapAdapter->currentZoom()))
{
painter->drawPixmap(-cross_x+size.width(),
-cross_y+size.height(),
ImageManager::instance()->getImage(mapAdapter->host(), mapAdapter->query(mapmiddle_tile_x, mapmiddle_tile_y, mapAdapter->currentZoom())));
}
 
for (int i=-tiles_left+mapmiddle_tile_x; i<=tiles_right+mapmiddle_tile_x; i++)
{
for (int j=-tiles_above+mapmiddle_tile_y; j<=tiles_bottom+mapmiddle_tile_y; j++)
{
// check if image is valid
if (!(i==mapmiddle_tile_x && j==mapmiddle_tile_y))
if (mapAdapter->isValid(i, j, mapAdapter->currentZoom()))
{
 
painter->drawPixmap(((i-mapmiddle_tile_x)*tilesize)-cross_x+size.width(),
((j-mapmiddle_tile_y)*tilesize)-cross_y+size.height(),
ImageManager::instance()->getImage(mapAdapter->host(), mapAdapter->query(i, j, mapAdapter->currentZoom())));
//if (QCoreApplication::hasPendingEvents())
// QCoreApplication::processEvents();
}
}
}
 
 
// PREFETCHING
int upper = mapmiddle_tile_y-tiles_above-1;
int right = mapmiddle_tile_x+tiles_right+1;
int left = mapmiddle_tile_x-tiles_right-1;
int lower = mapmiddle_tile_y+tiles_bottom+1;
 
int j = upper;
for (int i=left; i<=right; i++)
{
if (mapAdapter->isValid(i, j, mapAdapter->currentZoom()))
ImageManager::instance()->prefetchImage(mapAdapter->host(), mapAdapter->query(i, j, mapAdapter->currentZoom()));
}
j = lower;
for (int i=left; i<=right; i++)
{
if (mapAdapter->isValid(i, j, mapAdapter->currentZoom()))
ImageManager::instance()->prefetchImage(mapAdapter->host(), mapAdapter->query(i, j, mapAdapter->currentZoom()));
}
int i = left;
for (int j=upper+1; j<=lower-1; j++)
{
if (mapAdapter->isValid(i, j, mapAdapter->currentZoom()))
ImageManager::instance()->prefetchImage(mapAdapter->host(), mapAdapter->query(i, j, mapAdapter->currentZoom()));
}
i = right;
for (int j=upper+1; j<=lower-1; j++)
{
if (mapAdapter->isValid(i, j, mapAdapter->currentZoom()))
ImageManager::instance()->prefetchImage(mapAdapter->host(), mapAdapter->query(i, j, mapAdapter->currentZoom()));
}
}
 
QRect Layer::offscreenViewport() const
{
return myoffscreenViewport;
}
 
void Layer::moveWidgets(const QPoint mapmiddle_px) const
{
for (int i=0; i<geometries.count(); i++)
{
const Geometry* geom = geometries.at(i);
if (geom->GeometryType == "Point")
{
if (((Point*)geom)->widget()!=0)
{
QPoint topleft_relative = QPoint(mapmiddle_px-screenmiddle);
((Point*)geom)->drawWidget(mapAdapter, topleft_relative);
}
}
}
}
Layer::LayerType Layer::layertype() const
{
return mylayertype;
}
 
void Layer::setMapAdapter(MapAdapter* mapadapter)
{
 
mapAdapter = mapadapter;
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/layer.h
0,0 → 1,182
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef LAYER_H
#define LAYER_H
 
#include <QObject>
#include <QDebug>
#include <QPainter>
#include <QMouseEvent>
 
#include "mapadapter.h"
#include "layermanager.h"
#include "geometry.h"
#include "point.h"
 
#include "wmsmapadapter.h"
#include "tilemapadapter.h"
 
namespace qmapcontrol
{
//! Layer class
/*!
* There are two different layer types:
* - MapLayer: Displays Maps, but also Geometries. The configuration for displaying maps have to be done in the MapAdapter
* - GeometryLayer: Only displays Geometry objects.
*
* MapLayers also can display Geometry objects. The difference to the GeometryLayer is the repainting. Objects that are
* added to a MapLayer are "baken" on the map. This means, when you change it´s position for example the changes are
* not visible until a new offscreen image has been drawn. If you have "static" Geometries which won´t change their
* position this is fine. But if you want to change the objects position or pen you should use a GeometryLayer. Those
* are repainted immediately on changes.
* You can either use this class and give a layertype on creation or you can use the classes MapLayer and GeometryLayer.
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
class Layer : public QObject
{
Q_OBJECT
 
public:
friend class LayerManager;
 
//! sets the type of a layer, see Layer class doc for further information
enum LayerType
{
MapLayer, /*!< uses the MapAdapter to display maps, only gets refreshed when a new offscreen image is needed */
GeometryLayer /*!< gets refreshed everytime when a geometry changes */
};
 
//! Layer constructor
/*!
* This is used to construct a layer.
*
* @param layername The name of the Layer
* @param mapadapter The MapAdapter which does coordinate translation and Query-String-Forming
* @param layertype The above explained LayerType
* @param takeevents Should the Layer receive MouseEvents? This is set to true by default. Setting it to false could
* be something like a "speed up hint"
*/
Layer(QString layername, MapAdapter* mapadapter, enum LayerType layertype, bool takeevents=true);
virtual ~Layer();
 
//! returns the layer's name
/*!
* @return the name of this layer
*/
QString layername() const;
 
//! returns the layer´s MapAdapter
/*!
* This method returns the MapAdapter of this Layer, which can be useful
* to do coordinate transformations.
* @return the MapAdapter which us used by this Layer
*/
const MapAdapter* mapadapter() const;
 
//! adds a Geometry object to this Layer
/*!
* Please notice the different LayerTypes (MapLayer and GeometryLayer) and the differences
* @param geometry the new Geometry
*/
void addGeometry(Geometry* geometry);
 
//! removes the Geometry object from this Layer
/*!
* This method removes a Geometry object from this Layer.
*/
void removeGeometry(Geometry* geometry);
 
//! removes all Geometry objects from this Layer
/*!
* This method removes all Geometry objects from this Layer.
*/
void clearGeometries();
 
//! return true if the layer is visible
/*!
* @return if the layer is visible
*/
bool isVisible() const;
 
//! returns the LayerType of the Layer
/*!
* There are two LayerTypes: MapLayer and GeometryLayer
* @return the LayerType of this Layer
*/
Layer::LayerType layertype() const;
 
void setMapAdapter(MapAdapter* mapadapter);
 
Layer& operator=(const Layer& rhs);
Layer(const Layer& old);
 
private:
void moveWidgets(const QPoint mapmiddle_px) const;
void drawYourImage(QPainter* painter, const QPoint mapmiddle_px) const;
void drawYourGeometries(QPainter* painter, const QPoint mapmiddle_px, QRect viewport) const;
void setSize(QSize size);
QRect offscreenViewport() const;
bool takesMouseEvents() const;
void mouseEvent(const QMouseEvent*, const QPoint mapmiddle_px);
void zoomIn() const;
void zoomOut() const;
void _draw(QPainter* painter, const QPoint mapmiddle_px) const;
 
bool visible;
QString mylayername;
LayerType mylayertype;
QSize size;
QPoint screenmiddle;
 
QList<Geometry*> geometries;
MapAdapter* mapAdapter;
bool takeevents;
mutable QRect myoffscreenViewport;
 
signals:
//! This signal is emitted when a Geometry is clicked
/*!
* A Geometry is clickable, if the containing layer is clickable.
* The layer emits a signal for every clicked geometry
* @param geometry The clicked Geometry
* @param point The coordinate (in widget coordinates) of the click
*/
void geometryClicked(Geometry* geometry, QPoint point);
 
void updateRequest(QRectF rect);
void updateRequest();
 
public slots:
//! if visible is true, the layer is made visible
/*!
* @param visible if the layer should be visible
*/
void setVisible(bool visible);
 
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/layermanager.cpp
0,0 → 1,456
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "layermanager.h"
namespace qmapcontrol
{
LayerManager::LayerManager(MapControl* mapcontrol, QSize size)
:mapcontrol(mapcontrol), scroll(QPoint(0,0)), size(size), whilenewscroll(QPoint(0,0))
{
// genauer berechnen?
offSize = size *2;
composedOffscreenImage = QPixmap(offSize);
composedOffscreenImage2 = QPixmap(offSize);
zoomImage = QPixmap(size);
zoomImage.fill(Qt::white);
screenmiddle = QPoint(size.width()/2, size.height()/2);
}
 
 
LayerManager::~LayerManager()
{
mylayers.clear();
}
 
QPointF LayerManager::currentCoordinate() const
{
return mapmiddle;
}
 
QPixmap LayerManager::getImage() const
{
return composedOffscreenImage;
}
 
Layer* LayerManager::layer() const
{
Q_ASSERT_X(mylayers.size()>0, "LayerManager::getLayer()", "No layers were added!");
return mylayers.first();
}
 
Layer* LayerManager::layer(const QString& layername) const
{
QListIterator<Layer*> layerit(mylayers);
while (layerit.hasNext())
{
Layer* l = layerit.next();
if (l->layername() == layername)
return l;
}
return 0;
}
 
QList<QString> LayerManager::layers() const
{
QList<QString> keys;
QListIterator<Layer*> layerit(mylayers);
while (layerit.hasNext())
{
keys.append(layerit.next()->layername());
}
return keys;
}
 
 
void LayerManager::scrollView(const QPoint& point)
{
scroll += point;
zoomImageScroll+=point;
mapmiddle_px += point;
 
mapmiddle = layer()->mapadapter()->displayToCoordinate(mapmiddle_px);
if (!checkOffscreen())
{
newOffscreenImage();
}
else
{
moveWidgets();
}
}
 
void LayerManager::moveWidgets()
{
QListIterator<Layer*> it(mylayers);
while (it.hasNext())
{
it.next()->moveWidgets(mapmiddle_px);
}
}
 
void LayerManager::setView(const QPointF& coordinate)
{
mapmiddle_px = layer()->mapadapter()->coordinateToDisplay(coordinate);
mapmiddle = coordinate;
 
//TODO: muss wegen moveTo() raus
if (!checkOffscreen())
{
newOffscreenImage();
}
else
{
//TODO:
// verschiebung ausrechnen
// oder immer neues offscreenimage
newOffscreenImage();
}
}
 
void LayerManager::setView(QList<QPointF> coordinates)
{
setMiddle(coordinates);
// mapcontrol->update();
}
 
void LayerManager::setViewAndZoomIn(const QList<QPointF> coordinates)
{
while (containsAll(coordinates))
{
setMiddle(coordinates);
zoomIn();
}
 
 
if (!containsAll(coordinates))
{
zoomOut();
}
 
mapcontrol->update();
}
 
void LayerManager::setMiddle(QList<QPointF> coordinates)
{
int sum_x = 0;
int sum_y = 0;
for (int i=0; i<coordinates.size(); i++)
{
// mitte muss in px umgerechnet werden, da aufgrund der projektion die mittebestimmung aus koordinaten ungenau ist
QPoint p = layer()->mapadapter()->coordinateToDisplay(coordinates.at(i));
sum_x += p.x();
sum_y += p.y();
}
QPointF middle = layer()->mapadapter()->displayToCoordinate(QPoint(sum_x/coordinates.size(), sum_y/coordinates.size()));
// middle in px rechnen!
 
setView(middle);
}
 
bool LayerManager::containsAll(QList<QPointF> coordinates) const
{
QRectF bb = getViewport();
bool containsall = true;
for (int i=0; i<coordinates.size(); i++)
{
if (!bb.contains(coordinates.at(i)))
return false;
}
return containsall;
}
QPoint LayerManager::getMapmiddle_px() const
{
return mapmiddle_px;
}
 
QRectF LayerManager::getViewport() const
{
QPoint upperLeft = QPoint(mapmiddle_px.x()-screenmiddle.x(), mapmiddle_px.y()+screenmiddle.y());
QPoint lowerRight = QPoint(mapmiddle_px.x()+screenmiddle.x(), mapmiddle_px.y()-screenmiddle.y());
 
QPointF ulCoord = layer()->mapadapter()->displayToCoordinate(upperLeft);
QPointF lrCoord = layer()->mapadapter()->displayToCoordinate(lowerRight);
 
QRectF coordinateBB = QRectF(ulCoord, QSizeF( (lrCoord-ulCoord).x(), (lrCoord-ulCoord).y()));
return coordinateBB;
}
 
void LayerManager::addLayer(Layer* layer)
{
mylayers.append(layer);
 
layer->setSize(size);
 
connect(layer, SIGNAL(updateRequest(QRectF)),
this, SLOT(updateRequest(QRectF)));
connect(layer, SIGNAL(updateRequest()),
this, SLOT(updateRequest()));
 
if (mylayers.size()==1)
{
setView(QPointF(0,0));
}
}
 
void LayerManager::newOffscreenImage(bool clearImage, bool showZoomImage)
{
// qDebug() << "LayerManager::newOffscreenImage()";
whilenewscroll = mapmiddle_px;
 
if (clearImage)
{
composedOffscreenImage2.fill(Qt::white);
}
 
QPainter painter(&composedOffscreenImage2);
if (showZoomImage)
{
painter.drawPixmap(screenmiddle.x()-zoomImageScroll.x(), screenmiddle.y()-zoomImageScroll.y(),zoomImage);
}
//only draw basemaps
for (int i=0; i<mylayers.count(); i++)
{
Layer* l = mylayers.at(i);
if (l->isVisible())
{
if (l->layertype() == Layer::MapLayer)
{
l->drawYourImage(&painter, whilenewscroll);
}
}
}
 
composedOffscreenImage = composedOffscreenImage2;
scroll = mapmiddle_px-whilenewscroll;
 
mapcontrol->update();
}
 
void LayerManager::zoomIn()
{
QCoreApplication::processEvents();
 
ImageManager::instance()->abortLoading();
// layer rendern abbrechen?
zoomImageScroll = QPoint(0,0);
 
zoomImage.fill(Qt::white);
QPixmap tmpImg = composedOffscreenImage.copy(screenmiddle.x()+scroll.x(),screenmiddle.y()+scroll.y(), size.width(), size.height());
 
QPainter painter(&zoomImage);
painter.translate(screenmiddle);
painter.scale(2, 2);
painter.translate(-screenmiddle);
 
painter.drawPixmap(0,0,tmpImg);
 
QListIterator<Layer*> it(mylayers);
//TODO: remove hack, that mapadapters wont get set zoom multiple times
QList<const MapAdapter*> doneadapters;
while (it.hasNext())
{
Layer* l = it.next();
if (!doneadapters.contains(l->mapadapter()))
{
l->zoomIn();
doneadapters.append(l->mapadapter());
}
}
mapmiddle_px = layer()->mapadapter()->coordinateToDisplay(mapmiddle);
whilenewscroll = mapmiddle_px;
 
newOffscreenImage();
 
}
 
bool LayerManager::checkOffscreen() const
{
// calculate offscreenImage dimension (px)
QPoint upperLeft = mapmiddle_px - screenmiddle;
QPoint lowerRight = mapmiddle_px + screenmiddle;
QRect viewport = QRect(upperLeft, lowerRight);
 
QRect testRect = layer()->offscreenViewport();
 
if (!testRect.contains(viewport))
{
return false;
}
 
return true;
}
void LayerManager::zoomOut()
{
QCoreApplication::processEvents();
ImageManager::instance()->abortLoading();
zoomImageScroll = QPoint(0,0);
zoomImage.fill(Qt::white);
QPixmap tmpImg = composedOffscreenImage.copy(screenmiddle.x()+scroll.x(),screenmiddle.y()+scroll.y(), size.width(), size.height());
QPainter painter(&zoomImage);
painter.translate(screenmiddle);
painter.scale(0.500001,0.500001);
painter.translate(-screenmiddle);
painter.drawPixmap(0,0,tmpImg);
 
painter.translate(screenmiddle);
painter.scale(2,2);
painter.translate(-screenmiddle);
 
QListIterator<Layer*> it(mylayers);
//TODO: remove hack, that mapadapters wont get set zoom multiple times
QList<const MapAdapter*> doneadapters;
while (it.hasNext())
{
Layer* l = it.next();
if (!doneadapters.contains(l->mapadapter()))
{
l->zoomOut();
doneadapters.append(l->mapadapter());
}
}
mapmiddle_px = layer()->mapadapter()->coordinateToDisplay(mapmiddle);
whilenewscroll = mapmiddle_px;
newOffscreenImage();
}
 
void LayerManager::setZoom(int zoomlevel)
{
int current_zoom;
if (layer()->mapadapter()->minZoom() < layer()->mapadapter()->maxZoom())
{
current_zoom = layer()->mapadapter()->currentZoom();
}
else
{
current_zoom = layer()->mapadapter()->minZoom() - layer()->mapadapter()->currentZoom();
}
 
 
if (zoomlevel < current_zoom)
{
for (int i=current_zoom; i>zoomlevel; i--)
{
zoomOut();
}
}
else
{
for (int i=current_zoom; i<zoomlevel; i++)
{
zoomIn();
}
}
}
 
void LayerManager::mouseEvent(const QMouseEvent* evnt)
{
QListIterator<Layer*> it(mylayers);
while (it.hasNext())
{
Layer* l = it.next();
if (l->isVisible())
{
l->mouseEvent(evnt, mapmiddle_px);
}
}
}
 
void LayerManager::updateRequest(QRectF rect)
{
const QPoint topleft = mapmiddle_px - screenmiddle;
 
QPointF c = rect.topLeft();
 
if (getViewport().contains(c) || getViewport().contains(rect.bottomRight()))
{
// QPoint point = getLayer()->getMapAdapter()->coordinateToDisplay(c);
// QPoint finalpoint = point-topleft;
// QRect rect_px = QRect(int(finalpoint.x()-(rect.width()-1)/2), int(finalpoint.y()-(rect.height()-1)/2),
// int(rect.width()+1), int(rect.height()+1));
//
// mapcontrol->updateRequest(rect_px);
mapcontrol->update();
// newOffscreenImage();
}
}
void LayerManager::updateRequest()
{
newOffscreenImage();
}
void LayerManager::forceRedraw()
{
newOffscreenImage();
}
void LayerManager::removeZoomImage()
{
zoomImage.fill(Qt::white);
forceRedraw();
}
 
void LayerManager::drawGeoms(QPainter* painter)
{
QListIterator<Layer*> it(mylayers);
while (it.hasNext())
{
Layer* l = it.next();
if (l->layertype() == Layer::GeometryLayer && l->isVisible())
{
l->drawYourGeometries(painter, mapmiddle_px, layer()->offscreenViewport());
}
}
}
void LayerManager::drawImage(QPainter* painter)
{
painter->drawPixmap(-scroll.x()-screenmiddle.x(),
-scroll.y()-screenmiddle.y(),
composedOffscreenImage);
}
 
int LayerManager::currentZoom() const
{
return layer()->mapadapter()->currentZoom();
}
 
void LayerManager::resize(QSize newSize)
{
size = newSize;
offSize = newSize *2;
composedOffscreenImage = QPixmap(offSize);
composedOffscreenImage2 = QPixmap(offSize);
zoomImage = QPixmap(newSize);
zoomImage.fill(Qt::white);
 
screenmiddle = QPoint(newSize.width()/2, newSize.height()/2);
 
QListIterator<Layer*> it(mylayers);
while (it.hasNext())
{
Layer* l = it.next();
l->setSize(newSize);
}
 
newOffscreenImage();
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/layermanager.h
0,0 → 1,211
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef LAYERMANAGER_H
#define LAYERMANAGER_H
 
#include <QObject>
#include <QMap>
#include <QListIterator>
#include "layer.h"
#include "mapadapter.h"
#include "mapcontrol.h"
 
namespace qmapcontrol
{
class Layer;
class MapAdapter;
class MapControl;
 
class LayerManager;
 
//! Handles Layers and viewport related settings
/*!
* This class handles internally all layers which were added to the MapControl.
* It also stores values for scrolling.
* It initiates the creation of a new offscreen image and on zooming the zoom images gets here created.
* @author Kai Winter <kaiwinter@gmx.de>
*/
class LayerManager : public QObject
{
Q_OBJECT
 
public:
LayerManager(MapControl*, QSize);
~LayerManager();
 
//! returns the coordinate of the center of the map
/*!
* @return returns the coordinate of the middle of the screen
*/
QPointF currentCoordinate() const;
 
//! returns the current offscreen image
/*!
* @return the current offscreen image
*/
QPixmap getImage() const;
 
//! returns the layer with the given name
/*!
* @param layername name of the wanted layer
* @return the layer with the given name
*/
Layer* layer(const QString&) const;
 
//! returns the base layer
/*!
* This will return the base layer of the LayerManager.
* The base layer is the one which is used to do internal coordinate calculations.
* @return the base layer
*/
Layer* layer() const;
 
//! returns the names of all layers
/*!
* @return returns a QList with the names of all layers
*/
QList<QString> layers() const;
 
//! sets the middle of the map to the given coordinate
/*!
* @param coordinate the coordinate which the view´s middle should be set to
*/
void setView(const QPointF& coordinate);
 
//! sets the view, so all coordinates are visible
/*!
* @param coordinates the Coorinates which should be visible
*/
void setView(const QList<QPointF> coordinates);
 
//! sets the view and zooms in, so all coordinates are visible
/*!
* The code of setting the view to multiple coordinates is "brute force" and pretty slow.
* Have to be reworked.
* @param coordinates the Coorinates which should be visible
*/
void setViewAndZoomIn (const QList<QPointF> coordinates);
 
//! zooms in one step
void zoomIn();
 
//! zooms out one step
void zoomOut();
 
//! sets the given zoomlevel
/*!
* @param zoomlevel the zoomlevel
*/
void setZoom(int zoomlevel);
 
//! The Viewport of the display
/*!
* Returns the visible viewport in world coordinates
* @return the visible viewport in world coordinates
*/
QRectF getViewport() const;
 
//! scrolls the view
/*!
* Scrolls the view by the given value in pixels and in display coordinates
* @param offset the distance which the view should be scrolled
*/
void scrollView(const QPoint& offset);
 
//! forwards mouseevents to the layers
/*!
* This method is invoked by the MapControl which receives Mouse Events.
* These events are forwarded to the layers, so they can check for clicked geometries.
* @param evnt the mouse event
*/
void mouseEvent(const QMouseEvent* evnt);
 
//! returns the middle of the map in projection coordinates
/*!
*
* @return the middle of the map in projection coordinates
*/
QPoint getMapmiddle_px() const;
 
void forceRedraw();
void removeZoomImage();
 
//! adds a layer
/*!
* If multiple layers are added, they are painted in the added order.
* @param layer the layer which should be added
*/
void addLayer(Layer* layer);
 
//! returns the current zoom level
/*!
* @return returns the current zoom level
*/
int currentZoom() const;
 
void drawGeoms(QPainter* painter);
void drawImage(QPainter* painter);
 
private:
LayerManager& operator=(const LayerManager& rhs);
LayerManager(const LayerManager& old);
//! This method have to be invoked to draw a new offscreen image
/*!
* @param clearImage if the current offscreeen image should be cleared
* @param showZoomImage if a zoom image should be painted
*/
void newOffscreenImage(bool clearImage=true, bool showZoomImage=true);
inline bool checkOffscreen() const;
inline bool containsAll(QList<QPointF> coordinates) const;
inline void moveWidgets();
inline void setMiddle(QList<QPointF> coordinates);
 
MapControl* mapcontrol;
QPoint screenmiddle; // middle of the screen
QPoint scroll; // scrollvalue of the offscreen image
QPoint zoomImageScroll; // scrollvalue of the zoom image
 
QSize size; // widget size
QSize offSize; // size of the offscreen image
 
QPixmap composedOffscreenImage;
QPixmap composedOffscreenImage2;
QPixmap zoomImage;
 
QList<Layer*> mylayers;
 
QPoint mapmiddle_px; // projection-display coordinates
QPointF mapmiddle; // world coordinate
 
QPoint whilenewscroll;
 
public slots:
void updateRequest(QRectF rect);
void updateRequest();
void resize(QSize newSize);
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/linestring.cpp
0,0 → 1,170
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "linestring.h"
namespace qmapcontrol
{
LineString::LineString()
: Curve()
{
GeometryType = "LineString";
}
 
LineString::LineString(QList<Point*> const points, QString name, QPen* pen)
:Curve(name)
{
mypen = pen;
LineString();
setPoints(points);
}
 
LineString::~LineString()
{
}
 
// Geometry LineString::Clone(){}
 
// Point LineString::EndPoint(){}
// Point LineString::StartPoint(){}
// Point LineString::Value(){}
 
 
void LineString::addPoint(Point* point)
{
vertices.append(point);
}
 
QList<Point*> LineString::points()
{
return vertices;
}
 
void LineString::setPoints(QList<Point*> points)
{
for (int i=0; i<points.size(); i++)
{
points.at(i)->setParentGeometry(this);
}
vertices = points;
}
 
void LineString::draw(QPainter* painter, const MapAdapter* mapadapter, const QRect &screensize, const QPoint offset)
{
if (!visible)
return;
 
QPolygon p = QPolygon();
 
QPointF c;
for (int i=0; i<vertices.size(); i++)
{
c = vertices[i]->coordinate();
p.append(mapadapter->coordinateToDisplay(c));
}
if (mypen != 0)
{
painter->save();
painter->setPen(*mypen);
}
painter->drawPolyline(p);
if (mypen != 0)
{
painter->restore();
}
for (int i=0; i<vertices.size(); i++)
{
vertices[i]->draw(painter, mapadapter, screensize, offset);
}
}
 
int LineString::numberOfPoints() const
{
return vertices.count();
}
bool LineString::Touches(Point* geom, const MapAdapter* mapadapter)
{
// qDebug() << "LineString::Touches Point";
touchedPoints.clear();
bool touches = false;
for (int i=0; i<vertices.count(); i++)
{
// use implementation from Point
if (vertices.at(i)->Touches(geom, mapadapter))
{
touchedPoints.append(vertices.at(i));
 
touches = true;
}
}
if (touches)
{
emit(geometryClicked(this, QPoint(0,0)));
}
return touches;
}
bool LineString::Touches(Geometry* /*geom*/, const MapAdapter* /*mapadapter*/)
{
// qDebug() << "LineString::Touches Geom";
touchedPoints.clear();
 
return false;
}
 
QList<Geometry*> LineString::clickedPoints()
{
return touchedPoints;
}
bool LineString::hasPoints() const
{
return vertices.size() > 0 ? true : false;
}
bool LineString::hasClickedPoints() const
{
return touchedPoints.size() > 0 ? true : false;
}
 
QRectF LineString::boundingBox()
{
qreal minlon=180;
qreal maxlon=-180;
qreal minlat=90;
qreal maxlat=-90;
for (int i=0; i<vertices.size(); i++)
{
Point* tmp = vertices.at(i);
if (tmp->longitude() < minlon) minlon = tmp->longitude();
if (tmp->longitude() > maxlon) maxlon = tmp->longitude();
if (tmp->latitude() < minlat) minlat = tmp->latitude();
if (tmp->latitude() > maxlat) maxlat = tmp->latitude();
}
QPointF min = QPointF(minlon, minlat);
QPointF max = QPointF(maxlon, maxlat);
QPointF dist = max - min;
QSizeF si = QSizeF(dist.x(), dist.y());
 
return QRectF(min, si);
 
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/linestring.h
0,0 → 1,120
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef LINESTRING_H
#define LINESTRING_H
 
#include "curve.h"
 
namespace qmapcontrol
{
//! A collection of Point objects to describe a line
/*!
* A LineString is a Curve with linear interpolation between Points. Each consecutive pair of Points defines a Line segment.
* @author Kai Winter <kaiwinter@gmx.de>
*/
class LineString : public Curve
{
Q_OBJECT
 
public:
LineString();
//! constructor
/*!
* The constructor of a LineString takes a list of Points to form a line.
* @param points a list of points
* @param name the name of the LineString
* @param pen a QPen can be used to modify the look of the line.
* @see http://doc.trolltech.com/4.3/qpen.html
*/
LineString ( QList<Point*> const points, QString name = QString(), QPen* pen = 0 );
virtual ~LineString();
 
//! returns the points of the LineString
/*!
* @return a list with the points of the LineString
*/
QList<Point*> points();
 
//! adds a point at the end of the LineString
/*!
* @param point the point which should be added to the LineString
*/
void addPoint ( Point* point );
 
//! sets the given list as points of the LineString
/*!
* @param points the points which should be set for the LineString
*/
void setPoints ( QList<Point*> points );
 
//! returns the number of Points the LineString consists of
/*!
* @return the number of the LineString´s Points
*/
int numberOfPoints() const;
 
// virtual Geometry Clone();
virtual QRectF boundingBox();
// virtual Point EndPoint();
// virtual Point StartPoint();
// virtual Point Value();
 
//! returns true if the LineString has Childs
/*!
* This is equal to: numberOfPoints() > 0
* @return true it the LineString has Childs (=Points)
* @see clickedPoints()
*/
virtual bool hasPoints() const;
 
//! returns true if the LineString has clicked Points
/*!
* @return true if childs of a LineString were clicked
* @see clickedPoints()
*/
virtual bool hasClickedPoints() const;
 
//! returns the clicked Points
/*!
* If a LineString was clicked it could be neccessary to figure out which of its points where clicked.
* Do do so the methods hasPoints() and clickedPoints() can be used.
* When a point is added to a LineString the Point becomes its child.
* It is possible (depending on the zoomfactor) to click more than one Point of a LineString, so this method returns a list.
* @return the clicked Points of the LineString
*/
virtual QList<Geometry*> clickedPoints();
 
protected:
virtual bool Touches ( Geometry* geom, const MapAdapter* mapadapter );
virtual bool Touches ( Point* geom, const MapAdapter* mapadapter );
virtual void draw ( QPainter* painter, const MapAdapter* mapadapter, const QRect &screensize, const QPoint offset );
 
private:
QList<Point*> vertices;
QList<Geometry*> touchedPoints;
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/mapadapter.cpp
0,0 → 1,69
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "mapadapter.h"
namespace qmapcontrol
{
MapAdapter::MapAdapter(const QString& host, const QString& serverPath, int tilesize, int minZoom, int maxZoom)
:myhost(host), serverPath(serverPath), mytilesize(tilesize), min_zoom(minZoom), max_zoom(maxZoom)
{
current_zoom = min_zoom;
loc = QLocale(QLocale::English);
}
 
MapAdapter::~MapAdapter()
{
}
 
QString MapAdapter::host() const
{
return myhost;
}
 
int MapAdapter::tilesize() const
{
return mytilesize;
}
 
int MapAdapter::minZoom() const
{
return min_zoom;
}
 
int MapAdapter::maxZoom() const
{
return max_zoom;
}
 
int MapAdapter::currentZoom() const
{
return current_zoom;
}
 
int MapAdapter::adaptedZoom() const
{
return max_zoom < min_zoom ? min_zoom - current_zoom : current_zoom;
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/mapadapter.h
0,0 → 1,151
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef MAPADAPTER_H
#define MAPADAPTER_H
 
#include <QObject>
#include <QSize>
#include <QPoint>
#include <QPointF>
#include <QLocale>
#include <QDebug>
#include <cmath>
 
namespace qmapcontrol
{
//! Used to fit map servers into QMapControl
/*!
* MapAdapters are needed to convert between world- and display coordinates.
* This calculations depend on the used map projection.
* There are two ready-made MapAdapters:
* - TileMapAdapter, which is ready to use for OpenStreetMap or Google (Mercator projection)
* - WMSMapAdapter, which could be used for the most WMS-Server (some servers show errors, because of image ratio)
*
* MapAdapters are also needed to form the HTTP-Queries to load the map tiles.
* The maps from WMS Servers are also divided into tiles, because those can be better cached.
*
* @see TileMapAdapter, @see WMSMapAdapter
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
class MapAdapter : public QObject
{
friend class Layer;
 
Q_OBJECT
 
public:
virtual ~MapAdapter();
 
//! returns the host of this MapAdapter
/*!
* @return the host of this MapAdapter
*/
QString host() const;
 
//! returns the size of the tiles
/*!
* @return the size of the tiles
*/
int tilesize() const;
 
//! returns the min zoom value
/*!
* @return the min zoom value
*/
int minZoom() const;
 
//! returns the max zoom value
/*!
* @return the max zoom value
*/
int maxZoom() const;
 
//! returns the current zoom
/*!
* @return the current zoom
*/
int currentZoom() const;
 
virtual int adaptedZoom()const;
 
//! translates a world coordinate to display coordinate
/*!
* The calculations also needs the current zoom. The current zoom is managed by the MapAdapter, so this is no problem.
* To divide model from view the current zoom should be moved to the layers.
* @param coordinate the world coordinate
* @return the display coordinate (in widget coordinates)
*/
virtual QPoint coordinateToDisplay(const QPointF& coordinate) const = 0;
 
//! translates display coordinate to world coordinate
/*!
* The calculations also needs the current zoom. The current zoom is managed by the MapAdapter, so this is no problem.
* To divide model from view the current zoom should be moved to the layers.
* @param point the display coordinate
* @return the world coordinate
*/
virtual QPointF displayToCoordinate(const QPoint& point) const = 0;
 
protected:
MapAdapter(const QString& host, const QString& serverPath, int tilesize, int minZoom = 0, int maxZoom = 0);
virtual void zoom_in() = 0;
virtual void zoom_out() = 0;
virtual bool isValid(int x, int y, int z) const = 0;
virtual QString query(int x, int y, int z) const = 0;
 
QSize size;
QString myhost;
QString serverPath;
int mytilesize;
int min_zoom;
int max_zoom;
int current_zoom;
 
int param1;
int param2;
int param3;
int param4;
int param5;
int param6;
 
QString sub1;
QString sub2;
QString sub3;
QString sub4;
QString sub5;
QString sub6;
 
int order[3][2];
 
int middle_x;
int middle_y;
 
qreal numberOfTiles;
QLocale loc;
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/mapcontrol.cpp
0,0 → 1,414
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "mapcontrol.h"
namespace qmapcontrol
{
MapControl::MapControl(QSize size, MouseMode mousemode)
: size(size), mymousemode(mousemode), scaleVisible(false)
{
layermanager = new LayerManager(this, size);
screen_middle = QPoint(size.width()/2, size.height()/2);
 
mousepressed = false;
 
connect(ImageManager::instance(), SIGNAL(imageReceived()),
this, SLOT(updateRequestNew()));
 
connect(ImageManager::instance(), SIGNAL(loadingFinished()),
this, SLOT(loadingFinished()));
 
this->setMaximumSize(size.width()+1, size.height()+1);
}
 
MapControl::~MapControl()
{
delete layermanager;
}
 
QPointF MapControl::currentCoordinate() const
{
return layermanager->currentCoordinate();
}
 
Layer* MapControl::layer(const QString& layername) const
{
return layermanager->layer(layername);
}
 
QList<QString> MapControl::layers() const
{
return layermanager->layers();
}
 
int MapControl::numberOfLayers() const
{
return layermanager->layers().size();
}
 
void MapControl::followGeometry(const Geometry* geom) const
{
connect(geom, SIGNAL(positionChanged(Geometry*)),
this, SLOT(positionChanged(Geometry*)));
}
 
void MapControl::positionChanged(Geometry* geom)
{
QPoint start = layermanager->layer()->mapadapter()->coordinateToDisplay(currentCoordinate());
QPoint dest = layermanager->layer()->mapadapter()->coordinateToDisplay(((Point*)geom)->coordinate());
 
QPoint step = (dest-start);
 
layermanager->scrollView(step);
 
// setView(geom);
update();
}
 
void MapControl::moveTo(QPointF coordinate)
{
target = coordinate;
steps = 25;
if (moveMutex.tryLock())
{
QTimer::singleShot(40, this, SLOT(tick()));
}
else
{
// stopMove(coordinate);
}
}
void MapControl::tick()
{
QPoint start = layermanager->layer()->mapadapter()->coordinateToDisplay(currentCoordinate());
QPoint dest = layermanager->layer()->mapadapter()->coordinateToDisplay(target);
 
QPoint step = (dest-start)/steps;
QPointF next = currentCoordinate()- step;
 
// setView(Coordinate(next.x(), next.y()));
layermanager->scrollView(step);
 
update();
steps--;
if (steps>0)
{
QTimer::singleShot(40, this, SLOT(tick()));
}
else
{
moveMutex.unlock();
}
}
 
void MapControl::paintEvent(QPaintEvent* evnt)
{
QWidget::paintEvent(evnt);
QPainter painter(this);
 
// painter.translate(150,190);
// painter.scale(0.5,0.5);
 
// painter.setClipRect(0,0, size.width(), size.height());
 
// painter.setViewport(10000000000,0,size.width(),size.height());
 
/*
// rotating
rotation = 45;
painter.translate(256,256);
painter.rotate(rotation);
painter.translate(-256,-256);
*/
 
layermanager->drawImage(&painter);
layermanager->drawGeoms(&painter);
 
// added by wolf
// draw scale
if (scaleVisible)
{
QList<double> distanceList;
distanceList<<5000000<<2000000<<1000000<<1000000<<1000000<<100000<<100000<<50000<<50000<<10000<<10000<<10000<<1000<<1000<<500<<200<<100<<50<<25;
if (currentZoom() >= 0 && distanceList.size() > currentZoom())
{
double line;
line = distanceList.at( currentZoom() ) / pow(2, 18-currentZoom() ) / 0.597164;
 
// draw the scale
painter.setPen(Qt::black);
QPoint p1(10,size.height()-20);
QPoint p2((int)line,size.height()-20);
painter.drawLine(p1,p2);
 
painter.drawLine(10,size.height()-15, 10,size.height()-25);
painter.drawLine((int)line,size.height()-15, (int)line,size.height()-25);
 
QString distance;
if (distanceList.at(currentZoom()) >= 1000)
{
distance = QVariant( distanceList.at(currentZoom())/1000 ) .toString()+ " km";
}
else
{
distance = QVariant( distanceList.at(currentZoom()) ).toString() + " m";
}
 
painter.drawText(QPoint((int)line+10,size.height()-15), distance);
}
}
 
painter.drawLine(screen_middle.x(), screen_middle.y()-10,
screen_middle.x(), screen_middle.y()+10); // |
painter.drawLine(screen_middle.x()-10, screen_middle.y(),
screen_middle.x()+10, screen_middle.y()); // -
 
// int cross_x = int(layermanager->getMapmiddle_px().x())%256;
// int cross_y = int(layermanager->getMapmiddle_px().y())%256;
// painter.drawLine(screen_middle.x()-cross_x+cross_x, screen_middle.y()-cross_y+0,
// screen_middle.x()-cross_x+cross_x, screen_middle.y()-cross_y+256); // |
// painter.drawLine(screen_middle.x()-cross_x+0, screen_middle.y()-cross_y+cross_y,
// screen_middle.x()-cross_x+256, screen_middle.y()-cross_y+cross_y); // -
 
painter.drawRect(0,0, size.width(), size.height());
/*
// rotating
painter.setMatrix(painter.matrix().inverted());
//qt = painter.transform();
qm = painter.combinedMatrix();
*/
 
if (mousepressed && mymousemode == Dragging)
{
QRect rect = QRect(pre_click_px, current_mouse_pos);
painter.drawRect(rect);
}
emit viewChanged(currentCoordinate(), currentZoom());
}
 
// mouse events
void MapControl::mousePressEvent(QMouseEvent* evnt)
{
//rotating (experimental)
// QMouseEvent* me = new QMouseEvent(evnt->type(), qm.map(QPoint(evnt->x(),evnt->y())), evnt->button(), evnt->buttons(), evnt->modifiers());
// evnt = me;
// qDebug() << "evnt: " << evnt->x() << ", " << evnt->y() << ", " << evnt->pos();
 
layermanager->mouseEvent(evnt);
 
if (layermanager->layers().size()>0)
{
if (evnt->button() == 1)
{
mousepressed = true;
pre_click_px = QPoint(evnt->x(), evnt->y());
}
else if (evnt->button() == 2 && mymousemode != None) // zoom in
{
zoomIn();
} else if (evnt->button() == 4 && mymousemode != None) // zoom out
{
zoomOut();
}
}
 
// emit(mouseEvent(evnt));
emit(mouseEventCoordinate(evnt, clickToWorldCoordinate(evnt->pos())));
}
 
void MapControl::mouseReleaseEvent(QMouseEvent* evnt)
{
mousepressed = false;
if (mymousemode == Dragging)
{
QPointF ulCoord = clickToWorldCoordinate(pre_click_px);
QPointF lrCoord = clickToWorldCoordinate(current_mouse_pos);
 
QRectF coordinateBB = QRectF(ulCoord, QSizeF( (lrCoord-ulCoord).x(), (lrCoord-ulCoord).y()));
 
emit(boxDragged(coordinateBB));
}
 
emit(mouseEventCoordinate(evnt, clickToWorldCoordinate(evnt->pos())));
}
 
void MapControl::mouseMoveEvent(QMouseEvent* evnt)
{
// emit(mouseEvent(evnt));
 
/*
// rotating
QMouseEvent* me = new QMouseEvent(evnt->type(), qm.map(QPoint(evnt->x(),evnt->y())), evnt->button(), evnt->buttons(), evnt->modifiers());
evnt = me;
*/
if (mousepressed && mymousemode == Panning)
{
QPoint offset = pre_click_px - QPoint(evnt->x(), evnt->y());
layermanager->scrollView(offset);
pre_click_px = QPoint(evnt->x(), evnt->y());
}
else if (mousepressed && mymousemode == Dragging)
{
current_mouse_pos = QPoint(evnt->x(), evnt->y());
}
// emit(mouseEventCoordinate(evnt, clickToWorldCoordinate(evnt->pos())));
 
update();
// emit(mouseEventCoordinate(evnt, clickToWorldCoordinate(evnt->pos())));
}
 
QPointF MapControl::clickToWorldCoordinate(QPoint click)
{
// click coordinate to image coordinate
QPoint displayToImage= QPoint(click.x()-screen_middle.x()+layermanager->getMapmiddle_px().x(),
click.y()-screen_middle.y()+layermanager->getMapmiddle_px().y());
// image coordinate to world coordinate
return layermanager->layer()->mapadapter()->displayToCoordinate(displayToImage);
}
 
void MapControl::updateRequest(QRect rect)
{
update(rect);
}
void MapControl::updateRequestNew()
{
// qDebug() << "MapControl::updateRequestNew()";
layermanager->forceRedraw();
update();
}
// slots
void MapControl::zoomIn()
{
layermanager->zoomIn();
update();
}
void MapControl::zoomOut()
{
layermanager->zoomOut();
update();
}
void MapControl::setZoom(int zoomlevel)
{
layermanager->setZoom(zoomlevel);
update();
}
int MapControl::currentZoom() const
{
return layermanager->currentZoom();
}
void MapControl::scrollLeft(int pixel)
{
layermanager->scrollView(QPoint(-pixel,0));
update();
}
void MapControl::scrollRight(int pixel)
{
layermanager->scrollView(QPoint(pixel,0));
update();
}
void MapControl::scrollUp(int pixel)
{
layermanager->scrollView(QPoint(0,-pixel));
update();
}
void MapControl::scrollDown(int pixel)
{
layermanager->scrollView(QPoint(0,pixel));
update();
}
void MapControl::scroll(const QPoint scroll)
{
layermanager->scrollView(scroll);
update();
}
 
void MapControl::setView(const QPointF& coordinate) const
{
layermanager->setView(coordinate);
}
 
void MapControl::setView(const QList<QPointF> coordinates) const
{
layermanager->setView(coordinates);
}
 
void MapControl::setViewAndZoomIn(const QList<QPointF> coordinates) const
{
layermanager->setViewAndZoomIn(coordinates);
}
 
void MapControl::setView(const Point* point) const
{
layermanager->setView(point->coordinate());
}
 
void MapControl::loadingFinished()
{
// qDebug() << "MapControl::loadingFinished()";
layermanager->removeZoomImage();
}
void MapControl::addLayer(Layer* layer)
{
layermanager->addLayer(layer);
}
 
void MapControl::setMouseMode(MouseMode mousemode)
{
mymousemode = mousemode;
}
MapControl::MouseMode MapControl::mouseMode()
{
return mymousemode;
}
 
void MapControl::stopFollowing(Geometry* geom)
{
geom->disconnect(SIGNAL(positionChanged(Geometry*)));
}
 
void MapControl::enablePersistentCache(const QDir& path)
{
ImageManager::instance()->setCacheDir(path);
}
 
void MapControl::setProxy(QString host, int port)
{
ImageManager::instance()->setProxy(host, port);
}
 
void MapControl::showScale(bool show)
{
scaleVisible = show;
}
 
void MapControl::resize(const QSize newSize)
{
this->size = newSize;
screen_middle = QPoint(newSize.width()/2, newSize.height()/2);
 
this->setMaximumSize(newSize.width()+1, newSize.height()+1);
layermanager->resize(newSize);
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/mapcontrol.h
0,0 → 1,333
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef MAPCONTROL_H
#define MAPCONTROL_H
 
#include <QtGui>
 
#include "layermanager.h"
#include "layer.h"
#include "mapadapter.h"
#include "geometry.h"
#include "imagemanager.h"
 
//! QMapControl namespace
namespace qmapcontrol
{
class LayerManager;
class MapAdapter;
class Layer;
 
//! The control element of the widget and also the widget itself
/*!
* This is the main widget.
* To this control layers can be added.
* A MapControl have to be instantiated with a QSize which sets the size the widget takes in a layout.
* The given size is also the size, which is asured to be filled with map images.
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
class MapControl : public QWidget
{
Q_OBJECT
 
public:
//! Declares what actions the mouse move has on the map
enum MouseMode
{
Panning, /*!< The map is moved */
Dragging, /*!< A rectangular can be drawn */
None, /*!< Mouse move events have no efect to the map */
};
 
//! The constructor of MapControl
/*!
* The MapControl is the widget which displays the maps.
* The size describes the area, which gets filled with map data
* When you give no MouseMode, the mouse is moving the map.
* You can change the MouseMode on runtime, to e.g. Dragging, which lets the user drag a rectangular box.
* After the dragging a signal with the size of the box is emitted.
* The mousemode ´None´ can be used, to completely define the control of the map yourself.
* @param size the size which the widget should fill with map data
* @param mousemode the way mouseevents are handled
*/
MapControl ( QSize size, MouseMode mousemode = Panning );
 
~MapControl();
 
//! adds a layer
/*!
* If multiple layers are added, they are painted in the added order.
* @param layer the layer which should be added
*/
void addLayer ( Layer* layer );
 
//! returns the layer with the given name
/*!
* @param layername name of the wanted layer
* @return the layer with the given name
*/
Layer* layer ( const QString& layername ) const;
 
//! returns the names of all layers
/*!
* @return returns a QList with the names of all layers
*/
QList<QString> layers() const;
 
//! returns the number of existing layers
/*!
* @return returns the number of existing layers
*/
int numberOfLayers() const;
 
//! returns the coordinate of the center of the map
/*!
* @return returns the coordinate of the middle of the screen
*/
QPointF currentCoordinate() const;
 
//! returns the current zoom level
/*!
* @return returns the current zoom level
*/
int currentZoom() const;
 
//! sets the middle of the map to the given coordinate
/*!
* @param coordinate the coordinate which the view´s middle should be set to
*/
void setView ( const QPointF& coordinate ) const;
 
//! sets the view, so all coordinates are visible
/*!
* @param coordinates the Coorinates which should be visible
*/
void setView ( const QList<QPointF> coordinates ) const;
 
//! sets the view and zooms in, so all coordinates are visible
/*!
* The code of setting the view to multiple coordinates is "brute force" and pretty slow.
* Have to be reworked.
* @param coordinates the Coorinates which should be visible
*/
void setViewAndZoomIn ( const QList<QPointF> coordinates ) const;
 
//! sets the view to the given Point
/*!
*
* @param point the geometric point the view should be set to
*/
void setView ( const Point* point ) const;
 
//! Keeps the center of the map on the Geometry, even when it moves
/*!
* To stop the following the method stopFollowing() have to be called
* @param geometry the Geometry which should stay centered.
*/
void followGeometry ( const Geometry* geometry ) const;
 
//TODO:
// void followGeometry(const QList<Geometry*>) const;
 
//! Stops the following of a Geometry
/*!
* if the view is set to follow a Geometry this method stops the trace.
* See followGeometry().
* @param geometry the Geometry which should not followed anymore
*/
void stopFollowing ( Geometry* geometry );
 
//! Smoothly moves the center of the view to the given Coordinate
/*!
* @param coordinate the Coordinate which the center of the view should moved to
*/
void moveTo ( QPointF coordinate );
 
//! sets the Mouse Mode of the MapControl
/*!
* There are three MouseModes declard by an enum.
* The MouesMode Dragging draws an rectangular in the map while the MouseButton is pressed.
* When the Button is released a boxDragged() signal is emitted.
*
* The second MouseMode (the default) is Panning, which allows to drag the map around.
* @param mousemode the MouseMode
*/
void setMouseMode ( MouseMode mousemode );
 
//! returns the current MouseMode
/*!
* For a explanation for the MouseModes see setMouseMode()
* @return the current MouseMode
*/
MapControl::MouseMode mouseMode();
 
//int rotation;
 
//! Enable persistent caching of map tiles
/*!
* Call this method to allow the QMapControl widget to save map tiles
* persistent (also over application restarts).
* Tiles are stored in the subdirectory "QMapControl.cache" within the
* user's home directory. This can be changed by giving a path.
* @param path the path to the cache directory
*/
void enablePersistentCache ( const QDir& path=QDir::homePath() + "/QMapControl.cache" );
 
 
//! Sets the proxy for HTTP connections
/*!
* This method sets the proxy for HTTP connections.
* This is not provided by the current Qtopia version!
* @param host the proxy´s hostname or ip
* @param port the proxy´s port
*/
void setProxy ( QString host, int port );
 
//! Displays the scale within the widget
/*!
*
* @param show true if the scale should be displayed
*/
void showScale ( bool show );
 
private:
LayerManager* layermanager;
QPoint screen_middle; // middle of the widget (half size)
 
QPoint pre_click_px; // used for scrolling (MouseMode Panning)
QPoint current_mouse_pos; // used for scrolling and dragging (MouseMode Panning/Dragging)
 
QSize size; // size of the widget
 
bool mousepressed;
MouseMode mymousemode;
bool scaleVisible;
 
bool m_loadingFlag;
 
QMutex moveMutex; // used for method moveTo()
QPointF target; // used for method moveTo()
int steps; // used for method moveTo()
 
QPointF clickToWorldCoordinate ( QPoint click );
MapControl& operator= ( const MapControl& rhs );
MapControl ( const MapControl& old );
 
protected:
void paintEvent ( QPaintEvent* evnt );
void mousePressEvent ( QMouseEvent* evnt );
void mouseReleaseEvent ( QMouseEvent* evnt );
void mouseMoveEvent ( QMouseEvent* evnt );
 
signals:
// void mouseEvent(const QMouseEvent* evnt);
 
//! Emitted AFTER a MouseEvent occured
/*!
* This signals allows to receive click events within the MapWidget together with the world coordinate.
* It is emitted on MousePressEvents and MouseReleaseEvents.
* The kind of the event can be obtained by checking the events type.
* @param evnt the QMouseEvent that occured
* @param coordinate the corresponding world coordinate
*/
void mouseEventCoordinate ( const QMouseEvent* evnt, const QPointF coordinate );
 
//! Emitted, after a Rectangular is dragged.
/*!
* It is possible to select a rectangular area in the map, if the MouseMode is set to Dragging.
* The coordinates are in world coordinates
* @param QRectF the dragged Rect
*/
void boxDragged ( const QRectF );
 
//! This signal is emitted, when a Geometry is clicked
/*!
* @param geometry The clicked Geometry object
* @param coord_px The coordinate in pixel coordinates
*/
void geometryClicked ( Geometry* geometry, QPoint coord_px );
 
//! This signal is emitted, after the view have changed
/*!
* @param coordinate The current coordinate
* @param zoom The current zoom
*/
void viewChanged ( const QPointF &coordinate, int zoom );
 
public slots:
//! zooms in one step
void zoomIn();
 
//! zooms out one step
void zoomOut();
 
//! sets the given zoomlevel
/*!
* @param zoomlevel the zoomlevel
*/
void setZoom ( int zoomlevel );
 
//! scrolls the view to the left
void scrollLeft ( int pixel=10 );
 
//! scrolls the view to the right
void scrollRight ( int pixel=10 );
 
//! scrolls the view up
void scrollUp ( int pixel=10 );
 
//! scrolls the view down
void scrollDown ( int pixel=10 );
 
//! scrolls the view by the given point
void scroll ( const QPoint scroll );
 
//! updates the map for the given rect
/*!
* @param rect the area which should be repainted
*/
void updateRequest ( QRect rect );
 
//! updates the hole map by creating a new offscreen image
/*!
*
*/
void updateRequestNew();
 
//! Resizes the map to the given size
/*!
* @param newSize The new size
*/
void resize(const QSize newSize);
 
private slots:
void tick();
void loadingFinished();
void positionChanged ( Geometry* geom );
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/maplayer.cpp
0,0 → 1,38
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "maplayer.h"
namespace qmapcontrol
{
MapLayer::MapLayer(QString layername, MapAdapter* mapadapter, bool takeevents)
: Layer(layername, mapadapter, Layer::MapLayer, takeevents)
{
}
 
 
MapLayer::~MapLayer()
{
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/maplayer.h
0,0 → 1,65
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef MAPLAYER_H
#define MAPLAYER_H
 
#include "layer.h"
 
namespace qmapcontrol
{
//! MapLayer class
/*!
* There are two different layer types:
* - MapLayer: Displays Maps, but also Geometries. The configuration for displaying maps have to be done in the MapAdapter
* - GeometryLayer: Only displays Geometry objects.
*
* MapLayers also can display Geometry objects. The difference to the GeometryLayer is the repainting. Objects that are
* added to a MapLayer are "baken" on the map. This means, when you change it´s position for example the changes are
* not visible until a new offscreen image has been drawn. If you have "static" Geometries which won´t change their
* position this is fine. But if you want to change the objects position or pen you should use a GeometryLayer. Those
* are repainted immediately on changes.
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
class MapLayer : public Layer
{
Q_OBJECT
 
public:
//! MapLayer constructor
/*!
* This is used to construct a map layer.
*
* @param layername The name of the Layer
* @param mapadapter The MapAdapter which does coordinate translation and Query-String-Forming
* @param takeevents Should the Layer receive MouseEvents? This is set to true by default. Setting it to false could
* be something like a "speed up hint"
*/
MapLayer(QString layername, MapAdapter* mapadapter, bool takeevents=true);
virtual ~MapLayer();
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/mapnetwork.cpp
0,0 → 1,136
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "mapnetwork.h"
#include <QWaitCondition>
namespace qmapcontrol
{
MapNetwork::MapNetwork(ImageManager* parent)
:parent(parent), http(new QHttp(this)), loaded(0)
{
connect(http, SIGNAL(requestFinished(int, bool)),
this, SLOT(requestFinished(int, bool)));
}
 
MapNetwork::~MapNetwork()
{
http->clearPendingRequests();
delete http;
}
 
 
void MapNetwork::loadImage(const QString& host, const QString& url)
{
// qDebug() << "getting: " << QString(host).append(url);
// http->setHost(host);
// int getId = http->get(url);
 
http->setHost(host);
QHttpRequestHeader header("GET", url);
header.setValue("User-Agent", "Mozilla");
header.setValue("Host", host);
int getId = http->request(header);
 
if (vectorMutex.tryLock())
{
loadingMap[getId] = url;
vectorMutex.unlock();
}
}
 
void MapNetwork::requestFinished(int id, bool error)
{
// sleep(1);
// qDebug() << "MapNetwork::requestFinished" << http->state() << ", id: " << id;
if (error)
{
qDebug() << "network error: " << http->errorString();
//restart query
 
}
else if (vectorMutex.tryLock())
{
// check if id is in map?
if (loadingMap.contains(id))
{
 
QString url = loadingMap[id];
loadingMap.remove(id);
vectorMutex.unlock();
// qDebug() << "request finished for id: " << id << ", belongs to: " << notifier.url << endl;
QByteArray ax;
 
if (http->bytesAvailable()>0)
{
QPixmap pm;
ax = http->readAll();
 
if (pm.loadFromData(ax))
{
loaded += pm.size().width()*pm.size().height()*pm.depth()/8/1024;
// qDebug() << "Network loaded: " << (loaded);
parent->receivedImage(pm, url);
}
else
{
qDebug() << "NETWORK_PIXMAP_ERROR: " << ax;
}
}
 
}
else
vectorMutex.unlock();
 
}
if (loadingMap.size() == 0)
{
// qDebug () << "all loaded";
parent->loadingQueueEmpty();
}
}
 
void MapNetwork::abortLoading()
{
http->clearPendingRequests();
if (vectorMutex.tryLock())
{
loadingMap.clear();
vectorMutex.unlock();
}
}
 
bool MapNetwork::imageIsLoading(QString url)
{
return loadingMap.values().contains(url);
}
 
void MapNetwork::setProxy(QString host, int port)
{
#ifndef Q_WS_QWS
// do not set proxy on qt/extended
http->setProxy(host, port);
#endif
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/mapnetwork.h
0,0 → 1,78
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef MAPNETWORK_H
#define MAPNETWORK_H
 
#include <QObject>
#include <QDebug>
#include <QHttp>
#include <QVector>
#include <QPixmap>
#include "imagemanager.h"
/**
@author Kai Winter <kaiwinter@gmx.de>
*/
namespace qmapcontrol
{
class ImageManager;
class MapNetwork : QObject
{
Q_OBJECT
 
public:
MapNetwork(ImageManager* parent);
~MapNetwork();
 
void loadImage(const QString& host, const QString& url);
 
/*!
* checks if the given url is already loading
* @param url the url of the image
* @return boolean, if the image is already loading
*/
bool imageIsLoading(QString url);
 
/*!
* Aborts all current loading threads.
* This is useful when changing the zoom-factor, though newly needed images loads faster
*/
void abortLoading();
void setProxy(QString host, int port);
 
private:
ImageManager* parent;
QHttp* http;
QMap<int, QString> loadingMap;
qreal loaded;
QMutex vectorMutex;
MapNetwork& operator=(const MapNetwork& rhs);
MapNetwork(const MapNetwork& old);
 
private slots:
void requestFinished(int id, bool error);
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/openaerialmapadapter.cpp
0,0 → 1,37
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2009 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "openaerialmapadapter.h"
namespace qmapcontrol
{
OpenAerialMapAdapter::OpenAerialMapAdapter()
: TileMapAdapter("tile.openaerialmap.org", "/tiles/1.0.0/openaerialmap-900913/%1/%2/%3.png", 256, 0, 17)
{
}
 
OpenAerialMapAdapter::~OpenAerialMapAdapter()
{
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/openaerialmapadapter.h
0,0 → 1,49
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2009 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef OPENAERIALMAPADAPTER_H
#define OPENAERIALMAPADAPTER_H
 
#include "tilemapadapter.h"
namespace qmapcontrol
{
//! MapAdapter for OpenStreetMap
/*!
* This is a conveniece class, which extends and configures a TileMapAdapter. Source of maps is http://www.openaerialmap.org/
* @author Kai Winter <kaiwinter@gmx.de>
*/
class OpenAerialMapAdapter : public TileMapAdapter
{
Q_OBJECT
public:
//! constructor
/*!
* This construct a OpenAerialMap Adapter
*/
OpenAerialMapAdapter();
virtual ~OpenAerialMapAdapter();
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/osmmapadapter.cpp
0,0 → 1,37
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "osmmapadapter.h"
namespace qmapcontrol
{
OSMMapAdapter::OSMMapAdapter()
: TileMapAdapter("tile.openstreetmap.org", "/%1/%2/%3.png", 256, 0, 17)
{
}
 
OSMMapAdapter::~OSMMapAdapter()
{
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/osmmapadapter.h
0,0 → 1,49
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef OSMMAPADAPTER_H
#define OSMMAPADAPTER_H
 
#include "tilemapadapter.h"
namespace qmapcontrol
{
//! MapAdapter for OpenStreetMap
/*!
* This is a conveniece class, which extends and configures a TileMapAdapter
* @author Kai Winter <kaiwinter@gmx.de>
*/
class OSMMapAdapter : public TileMapAdapter
{
Q_OBJECT
public:
//! constructor
/*!
* This construct a OpenStreetmap Adapter
*/
OSMMapAdapter();
virtual ~OSMMapAdapter();
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/point.cpp
0,0 → 1,330
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "point.h"
namespace qmapcontrol
{
Point::Point()
{}
Point::Point(const Point& point)
:Geometry(point.name()), X(point.longitude()), Y(point.latitude())
{
visible = point.isVisible();
mywidget = 0;
mypixmap = 0;
mypen = point.mypen;
homelevel = -1;
minsize = QSize(-1,-1);
maxsize = QSize(-1,-1);
}
 
Point::Point(qreal x, qreal y, QString name, enum Alignment alignment)
: Geometry(name), X(x), Y(y), myalignment(alignment)
{
GeometryType = "Point";
mywidget = 0;
mypixmap = 0;
visible = true;
homelevel = -1;
minsize = QSize(-1,-1);
maxsize = QSize(-1,-1);
}
 
Point::Point(qreal x, qreal y, QWidget* widget, QString name, enum Alignment alignment)
: Geometry(name), X(x), Y(y), mywidget(widget), myalignment(alignment)
{
// Point(x, y, name, alignment);
GeometryType = "Point";
mypixmap = 0;
visible = true;
size = widget->size();
homelevel = -1;
minsize = QSize(-1,-1);
maxsize = QSize(-1,-1);
mywidget->show();
}
Point::Point(qreal x, qreal y, QPixmap* pixmap, QString name, enum Alignment alignment)
: Geometry(name), X(x), Y(y), mypixmap(pixmap), myalignment(alignment)
{
GeometryType = "Point";
mywidget = 0;
visible = true;
size = pixmap->size();
homelevel = -1;
minsize = QSize(-1,-1);
maxsize = QSize(-1,-1);
}
/*
Point& Point::operator=(const Point& rhs)
{
if (this == &rhs)
return *this;
else
{
X = rhs.X;
Y = rhs.Y;
size = rhs.size;
 
mywidget = rhs.mywidget;
mypixmap = rhs.mypixmap;
alignment = rhs.alignment;
homelevel = rhs.homelevel;
minsize = rhs.minsize;
maxsize = rhs.maxsize;
}
}
*/
Point::~Point()
{
delete mywidget;
delete mypixmap;
}
 
void Point::setVisible(bool visible)
{
this->visible = visible;
if (mywidget !=0)
{
mywidget->setVisible(visible);
}
}
 
QRectF Point::boundingBox()
{
//TODO: have to be calculated in relation to alignment...
return QRectF(QPointF(X, Y), displaysize);
}
 
qreal Point::longitude() const
{
return X;
}
qreal Point::latitude() const
{
return Y;
}
QPointF Point::coordinate() const
{
return QPointF(X, Y);
}
 
void Point::draw(QPainter* painter, const MapAdapter* mapadapter, const QRect &viewport, const QPoint offset)
{
if (!visible)
return;
 
if (homelevel > 0)
{
 
int currentzoom = mapadapter->maxZoom() < mapadapter->minZoom() ? mapadapter->minZoom() - mapadapter->currentZoom() : mapadapter->currentZoom();
 
// int currentzoom = mapadapter->getZoom();
int diffzoom = homelevel-currentzoom;
int viewheight = size.height();
int viewwidth = size.width();
viewheight = int(viewheight / pow(2, diffzoom));
viewwidth = int(viewwidth / pow(2, diffzoom));
 
if (minsize.height()!= -1 && viewheight < minsize.height())
viewheight = minsize.height();
else if (maxsize.height() != -1 && viewheight > maxsize.height())
viewheight = maxsize.height();
 
 
if (minsize.width()!= -1 && viewwidth < minsize.width())
viewwidth = minsize.width();
else if (maxsize.width() != -1 && viewwidth > maxsize.width())
viewwidth = maxsize.width();
 
 
displaysize = QSize(viewwidth, viewheight);
}
else
{
displaysize = size;
}
 
 
if (mypixmap !=0)
{
const QPointF c = QPointF(X, Y);
QPoint point = mapadapter->coordinateToDisplay(c);
 
if (viewport.contains(point))
{
QPoint alignedtopleft = alignedPoint(point);
painter->drawPixmap(alignedtopleft.x(), alignedtopleft.y(), displaysize.width(), displaysize.height(), *mypixmap);
}
 
}
else if (mywidget!=0)
{
drawWidget(mapadapter, offset);
}
 
}
 
void Point::drawWidget(const MapAdapter* mapadapter, const QPoint offset)
{
const QPointF c = QPointF(X, Y);
QPoint point = mapadapter->coordinateToDisplay(c);
point -= offset;
 
QPoint alignedtopleft = alignedPoint(point);
mywidget->setGeometry(alignedtopleft.x(), alignedtopleft.y(), displaysize.width(), displaysize.height());
}
 
QPoint Point::alignedPoint(const QPoint point) const
{
QPoint alignedtopleft;
if (myalignment == Middle)
{
alignedtopleft.setX(point.x()-displaysize.width()/2);
alignedtopleft.setY(point.y()-displaysize.height()/2);
}
else if (myalignment == TopLeft)
{
alignedtopleft.setX(point.x());
alignedtopleft.setY(point.y());
}
else if (myalignment == TopRight)
{
alignedtopleft.setX(point.x()-displaysize.width());
alignedtopleft.setY(point.y());
}
else if (myalignment == BottomLeft)
{
alignedtopleft.setX(point.x());
alignedtopleft.setY(point.y()-displaysize.height());
}
else if (myalignment == BottomRight)
{
alignedtopleft.setX(point.x()-displaysize.width());
alignedtopleft.setY(point.y()-displaysize.height());
}
return alignedtopleft;
}
 
 
bool Point::Touches(Point* p, const MapAdapter* mapadapter)
{
if (this->isVisible() == false)
return false;
if (mypixmap == 0)
return false;
 
QPointF c = p->coordinate();
// coordinate to pixel
QPoint pxOfPoint = mapadapter->coordinateToDisplay(c);
// size/2 Pixel toleranz aufaddieren
QPoint p1;
QPoint p2;
 
switch (myalignment)
{
case Middle:
p1 = pxOfPoint - QPoint(displaysize.width()/2,displaysize.height()/2);
p2 = pxOfPoint + QPoint(displaysize.width()/2,displaysize.height()/2);
break;
case TopLeft:
p1 = pxOfPoint - QPoint(displaysize.width(),displaysize.height());
p2 = pxOfPoint;
break;
case TopRight:
p1 = pxOfPoint - QPoint(0, displaysize.height());
p2 = pxOfPoint + QPoint(displaysize.width(),0);
break;
case BottomLeft:
p1 = pxOfPoint - QPoint(displaysize.width(), 0);
p2 = pxOfPoint + QPoint(0, displaysize.height());
break;
case BottomRight:
p1 = pxOfPoint;
p2 = pxOfPoint + QPoint(displaysize.width(), displaysize.height());
break;
}
 
// calculate "Bounding Box" in coordinates
QPointF c1 = mapadapter->displayToCoordinate(p1);
QPointF c2 = mapadapter->displayToCoordinate(p2);
 
 
if(this->longitude()>=c1.x() && this->longitude()<=c2.x())
{
if (this->latitude()<=c1.y() && this->latitude()>=c2.y())
{
emit(geometryClicked(this, QPoint(0,0)));
return true;
}
}
return false;
}
 
void Point::setCoordinate(QPointF point)
{
// emit(updateRequest(this));
// emit(updateRequest(QRectF(X, Y, size.width(), size.height())));
X = point.x();
Y = point.y();
// emit(updateRequest(this));
emit(updateRequest(QRectF(X, Y, size.width(), size.height())));
 
emit(positionChanged(this));
}
QList<Point*> Point::points()
{
//TODO: assigning temp?!
QList<Point*> points;
points.append(this);
return points;
}
 
QWidget* Point::widget()
{
return mywidget;
}
 
QPixmap* Point::pixmap()
{
return mypixmap;
}
 
void Point::setBaselevel(int zoomlevel)
{
homelevel = zoomlevel;
}
void Point::setMinsize(QSize minsize)
{
this->minsize = minsize;
}
void Point::setMaxsize(QSize maxsize)
{
this->maxsize = maxsize;
}
Point::Alignment Point::alignment() const
{
return myalignment;
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/point.h
0,0 → 1,215
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef POINT_H
#define POINT_H
#include <QWidget>
 
#include "geometry.h"
 
namespace qmapcontrol
{
//! A geometric point to draw objects into maps
/*!
* This class can be used to draw your custom QPixmap or other QWidgets into maps.
* You can instantiate a Point with any Pixmap you want. The objects cares about collision detection (for clickable objects)
*
* When drawing a pixmap, take care you are adding the point to a GeometryLayer.
* You can also add a point to a MapLayer, but this should only be done, if the point is not changing its position or color etc.
* (GeometryLayers are assured to be repainted on any changes at the point. MapLayers only gets repainted, if a new
* offscreenImage is painter. This is a performance issue.)
*
* Points emit click events, if the containing layer receives clickevents (the default)
*
* You can also add a widget into maps. But keep in mind, that widgets always are drawn on top of all layers.
* You also have to handle click events yourself.
*
* To create "zoomable objects" (objects that increases size on zooming), a base level have to be set.
* The base level is the zoom level on which the point´s pixmap gets displayed on full size.
* On lower zoom levels it gets displayed smaller and on higher zoom levels larger.
* A minimal size can be set as well as a maximum size.
* @see setBaselevel, setMinsize, setMaxsize
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
class Point : public Geometry
{
Q_OBJECT
 
public:
friend class Layer;
friend class LineString;
 
//! sets where the point should be aligned
enum Alignment
{
TopLeft, /*!< Align on TopLeft*/
TopRight, /*!< Align on TopRight*/
BottomLeft, /*!< Align on BottomLeft*/
BottomRight,/*!< Align on BottomRight*/
Middle /*!< Align on Middle*/
};
 
Point();
explicit Point(const Point&);
//! Copy Constructor
/*!
* This constructor creates a Point with no image or widget.
* @param x longitude
* @param y latitude
* @param name name of the point
* @param alignment allignment of the point (Middle or TopLeft)
*/
Point(qreal x, qreal y, QString name = QString(), enum Alignment alignment=Middle);
 
//! Constructor
/*!
* This constructor creates a point which will display the given widget.
* You can set an alignment on which corner the widget should be aligned to the coordinate.
* You have to set the size of the widget, before adding it to
* IMPORTANT: You have to set the QMapControl as parent for the widget!
* @param x longitude
* @param y latitude
* @param widget the widget which should be displayed by this point
* @param name name of the point
* @param alignment allignment of the point (Middle or TopLeft)
*/
Point(qreal x, qreal y, QWidget* widget, QString name = QString(), enum Alignment alignment = Middle);
 
//! Constructor
/*!
* This constructor creates a point which will display the give pixmap.
* You can set an alignment on which corner the pixmap should be aligned to the coordinate.
* @param x longitude
* @param y latitude
* @param pixmap the pixmap which should be displayed by this point
* @param name name of the point
* @param alignment allignment of the point (Middle or TopLeft)
*/
Point(qreal x, qreal y, QPixmap* pixmap, QString name = QString(), enum Alignment alignment = Middle);
virtual ~Point();
 
//! returns the bounding box of the point
/*!
* The Bounding contains the coordinate of the point and its size.
* The size is set, if the point contains a pixmap or a widget
* @return the bounding box of the point
*/
virtual QRectF boundingBox();
 
//! returns the longitude of the point
/*!
* @return the longitude of the point
*/
qreal longitude() const;
 
//! returns the latitude of the point
/*!
* @return the latitude of the point
*/
qreal latitude() const;
 
//! returns the coordinate of the point
/*!
* The x component of the returned QPointF is the longitude value,
* the y component the latitude
* @return the coordinate of a point
*/
QPointF coordinate() const;
 
virtual QList<Point*> points();
 
/*! \brief returns the widget of the point
@return the widget of the point
*/
QWidget* widget();
 
//! returns the pixmap of the point
/*!
* @return the pixmap of the point
*/
QPixmap* pixmap();
 
//! Sets the zoom level on which the point�s pixmap gets displayed on full size
/*!
* Use this method to set a zoom level on which the pixmap gets displayed with its real size.
* On zoomlevels below it will be displayed smaller, and on zoom levels thereover it will be displayed larger
* @see setMinsize, setMaxsize
* @param zoomlevel the zoomlevel on which the point will be displayed on full size
*/
void setBaselevel(int zoomlevel);
 
//! sets a minimal size for the pixmap
/*!
* When the point's pixmap should change its size on zooming, this method sets the minimal size.
* @see setBaselevel
* @param minsize the minimal size which the pixmap should have
*/
void setMinsize(QSize minsize);
 
//! sets a maximal size for the pixmap
/*!
* When the point´s pixmap should change its size on zooming, this method sets the maximal size.
* @see setBaselevel
* @param maxsize the maximal size which the pixmap should have
*/
void setMaxsize(QSize maxsize);
 
Point::Alignment alignment() const;
 
protected:
qreal X;
qreal Y;
QSize size;
 
QWidget* mywidget;
QPixmap* mypixmap;
Alignment myalignment;
int homelevel;
QSize displaysize;
QSize minsize;
QSize maxsize;
 
 
void drawWidget(const MapAdapter* mapadapter, const QPoint offset);
// void drawPixmap(QPainter* painter, const MapAdapter* mapadapter, const QRect &viewport, const QPoint versch);
virtual void draw(QPainter* painter, const MapAdapter* mapadapter, const QRect &viewport, const QPoint offset);
QPoint alignedPoint(const QPoint point) const;
 
//! returns true if the given Point touches this Point
/*!
* The collision detection checks for the bounding rectangulars.
* @param geom the other point which should be tested on collision
* @param mapadapter the mapadapter which is used for calculations
* @return
*/
virtual bool Touches(Point* geom, const MapAdapter* mapadapter);
 
public slots:
void setCoordinate(QPointF point);
virtual void setVisible(bool visible);
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/tilemapadapter.cpp
0,0 → 1,185
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "tilemapadapter.h"
namespace qmapcontrol
{
TileMapAdapter::TileMapAdapter(const QString& host, const QString& serverPath, int tilesize, int minZoom, int maxZoom)
:MapAdapter(host, serverPath, tilesize, minZoom, maxZoom)
{
PI = acos(-1.0);
 
/*
Initialize the "substring replace engine". First the string replacement
in getQuery was made by QString().arg() but this was very slow. So this
splits the servers path into substrings and when calling getQuery the
substrings get merged with the parameters of the URL.
Pretty complicated, but fast.
*/
param1 = serverPath.indexOf("%1");
param2 = serverPath.indexOf("%2");
param3 = serverPath.indexOf("%3");
 
int min = param1 < param2 ? param1 : param2;
min = param3 < min ? param3 : min;
 
int max = param1 > param2 ? param1 : param2;
max = param3 > max ? param3 : max;
 
int middle = param1+param2+param3-min-max;
 
order[0][0] = min;
if (min == param1)
order[0][1] = 0;
else if (min == param2)
order[0][1] = 1;
else
order[0][1] = 2;
 
order[1][0] = middle;
if (middle == param1)
order[1][1] = 0;
else if (middle == param2)
order[1][1] = 1;
else
order[1][1] = 2;
 
order[2][0] = max;
if (max == param1)
order[2][1] = 0;
else if(max == param2)
order[2][1] = 1;
else
order[2][1] = 2;
 
int zoom = max_zoom < min_zoom ? min_zoom - current_zoom : current_zoom;
numberOfTiles = tilesonzoomlevel(zoom);
loc.setNumberOptions(QLocale::OmitGroupSeparator);
}
 
TileMapAdapter::~TileMapAdapter()
{
}
//TODO: pull out
void TileMapAdapter::zoom_in()
{
if (min_zoom > max_zoom)
{
//current_zoom = current_zoom-1;
current_zoom = current_zoom > max_zoom ? current_zoom-1 : max_zoom;
}
else if (min_zoom < max_zoom)
{
//current_zoom = current_zoom+1;
current_zoom = current_zoom < max_zoom ? current_zoom+1 : max_zoom;
}
 
int zoom = max_zoom < min_zoom ? min_zoom - current_zoom : current_zoom;
numberOfTiles = tilesonzoomlevel(zoom);
 
}
void TileMapAdapter::zoom_out()
{
if (min_zoom > max_zoom)
{
//current_zoom = current_zoom+1;
current_zoom = current_zoom < min_zoom ? current_zoom+1 : min_zoom;
}
else if (min_zoom < max_zoom)
{
//current_zoom = current_zoom-1;
current_zoom = current_zoom > min_zoom ? current_zoom-1 : min_zoom;
}
 
int zoom = max_zoom < min_zoom ? min_zoom - current_zoom : current_zoom;
numberOfTiles = tilesonzoomlevel(zoom);
}
 
qreal TileMapAdapter::deg_rad(qreal x) const
{
return x * (PI/180.0);
}
qreal TileMapAdapter::rad_deg(qreal x) const
{
return x * (180/PI);
}
 
QString TileMapAdapter::query(int x, int y, int z) const
{
x = xoffset(x);
y = yoffset(y);
 
int a[3] = {z, x, y};
return QString(serverPath).replace(order[2][0],2, loc.toString(a[order[2][1]]))
.replace(order[1][0],2, loc.toString(a[order[1][1]]))
.replace(order[0][0],2, loc.toString(a[order[0][1]]));
 
}
 
QPoint TileMapAdapter::coordinateToDisplay(const QPointF& coordinate) const
{
qreal x = (coordinate.x()+180) * (numberOfTiles*mytilesize)/360.; // coord to pixel!
qreal y = (1-(log(tan(PI/4+deg_rad(coordinate.y())/2)) /PI)) /2 * (numberOfTiles*mytilesize);
 
return QPoint(int(x), int(y));
}
 
QPointF TileMapAdapter::displayToCoordinate(const QPoint& point) const
{
qreal longitude = (point.x()*(360/(numberOfTiles*mytilesize)))-180;
qreal latitude = rad_deg(atan(sinh((1-point.y()*(2/(numberOfTiles*mytilesize)))*PI)));
 
return QPointF(longitude, latitude);
 
}
 
bool TileMapAdapter::isValid(int x, int y, int z) const
{
if (max_zoom < min_zoom)
{
z= min_zoom - z;
}
 
if (x<0 || x>pow(2,z)-1 ||
y<0 || y>pow(2,z)-1)
{
return false;
}
return true;
 
}
int TileMapAdapter::tilesonzoomlevel(int zoomlevel) const
{
return int(pow(2, zoomlevel));
}
int TileMapAdapter::xoffset(int x) const
{
return x;
}
int TileMapAdapter::yoffset(int y) const
{
return y;
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/tilemapadapter.h
0,0 → 1,76
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef TILEMAPADAPTER_H
#define TILEMAPADAPTER_H
 
#include "mapadapter.h"
 
namespace qmapcontrol
{
//! MapAdapter for servers with image tiles
/*!
* Use this derived MapAdapter to display maps from OpenStreetMap
* @author Kai Winter <kaiwinter@gmx.de>
*/
class TileMapAdapter : public MapAdapter
{
Q_OBJECT
public:
//! constructor
/*!
* Sample of a correct initialization of a MapAdapter:<br/>
* TileMapAdapter* ta = new TileMapAdapter("192.168.8.1", "/img/img_cache.php/%1/%2/%3.png", 256, 0,17);<br/>
* The placeholders %1, %2, %3 stands for x, y, z<br/>
* The minZoom is 0 (means the whole world is visible). The maxZoom is 17 (means it is zoomed in to the max)
* @param host The servers URL
* @param serverPath The path to the tiles with placeholders
* @param tilesize the size of the tiles
* @param minZoom the minimum zoom level
* @param maxZoom the maximum zoom level
*/
TileMapAdapter(const QString& host, const QString& serverPath, int tilesize, int minZoom = 0, int maxZoom = 17);
 
virtual ~TileMapAdapter();
 
virtual QPoint coordinateToDisplay(const QPointF&) const;
virtual QPointF displayToCoordinate(const QPoint&) const;
 
qreal PI;
 
protected:
qreal rad_deg(qreal) const;
qreal deg_rad(qreal) const;
 
virtual bool isValid(int x, int y, int z) const;
virtual void zoom_in();
virtual void zoom_out();
virtual QString query(int x, int y, int z) const;
virtual int tilesonzoomlevel(int zoomlevel) const;
virtual int xoffset(int x) const;
virtual int yoffset(int y) const;
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/wmsmapadapter.cpp
0,0 → 1,110
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "wmsmapadapter.h"
namespace qmapcontrol
{
WMSMapAdapter::WMSMapAdapter(QString host, QString serverPath, int tilesize)
: MapAdapter(host, serverPath, tilesize, 0, 17)
{
// param1 = serverPath.indexOf("%1");
// param2 = serverPath.indexOf("%2");
// param3 = serverPath.indexOf("%3");
// param4 = serverPath.indexOf("%4");
// param5 = serverPath.indexOf("%5");
// param6 = serverPath.lastIndexOf("%5");
 
// this->serverPath = serverPath.replace(param6, 2, QString().setNum(tilesize)).replace(param5, 2, QString().setNum(tilesize));
 
// sub1 = serverPath.mid(0, param1);
// sub2 = serverPath.mid(param1+2, param2-param1-2);
// sub3 = serverPath.mid(param2+2, param3-param2-2);
// sub4 = serverPath.mid(param3+2, param4-param3-2);
// sub5 = serverPath.mid(param4+2);
 
this->serverPath.append("&WIDTH=").append(loc.toString(tilesize))
.append("&HEIGHT=").append(loc.toString(tilesize))
.append("&BBOX=");
numberOfTiles = pow(2, current_zoom);
coord_per_x_tile = 360. / numberOfTiles;
coord_per_y_tile = 180. / numberOfTiles;
}
 
 
WMSMapAdapter::~WMSMapAdapter()
{
}
 
QPoint WMSMapAdapter::coordinateToDisplay(const QPointF& coordinate) const
{
qreal x = (coordinate.x()+180) * (numberOfTiles*mytilesize)/360.; // coord to pixel!
qreal y = -1*(coordinate.y()-90) * (numberOfTiles*mytilesize)/180.; // coord to pixel!
return QPoint(int(x), int(y));
}
QPointF WMSMapAdapter::displayToCoordinate(const QPoint& point) const
{
qreal lon = (point.x()*(360./(numberOfTiles*mytilesize)))-180;
qreal lat = -(point.y()*(180./(numberOfTiles*mytilesize)))+90;
return QPointF(lon, lat);
}
void WMSMapAdapter::zoom_in()
{
current_zoom+=1;
numberOfTiles = pow(2, current_zoom);
coord_per_x_tile = 360. / numberOfTiles;
coord_per_y_tile = 180. / numberOfTiles;
}
void WMSMapAdapter::zoom_out()
{
current_zoom-=1;
numberOfTiles = pow(2, current_zoom);
coord_per_x_tile = 360. / numberOfTiles;
coord_per_y_tile = 180. / numberOfTiles;
}
 
bool WMSMapAdapter::isValid(int /*x*/, int /*y*/, int /*z*/) const
{
// if (x>0 && y>0 && z>0)
{
return true;
}
// return false;
}
QString WMSMapAdapter::query(int i, int j, int /*z*/) const
{
return getQ(-180+i*coord_per_x_tile,
90-(j+1)*coord_per_y_tile,
-180+i*coord_per_x_tile+coord_per_x_tile,
90-(j+1)*coord_per_y_tile+coord_per_y_tile);
}
QString WMSMapAdapter::getQ(qreal ux, qreal uy, qreal ox, qreal oy) const
{
return QString().append(serverPath)
.append(loc.toString(ux)).append(",")
.append(loc.toString(uy)).append(",")
.append(loc.toString(ox)).append(",")
.append(loc.toString(oy));
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/wmsmapadapter.h
0,0 → 1,70
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef WMSMAPADAPTER_H
#define WMSMAPADAPTER_H
 
#include "mapadapter.h"
 
namespace qmapcontrol
{
//! MapAdapter for WMS servers
/*!
* Use this derived MapAdapter to display maps from WMS servers
* @author Kai Winter <kaiwinter@gmx.de>
*/
class WMSMapAdapter : public MapAdapter
{
public:
//! constructor
/*!
* Sample of a correct initialization of a MapAdapter:<br/>
* MapAdapter* mapadapter = new WMSMapAdapter("www2.demis.nl", "/wms/wms.asp?wms=WorldMap[...]&BBOX=%1,%2,%3,%4&WIDTH=%5&HEIGHT=%5&TRANSPARENT=TRUE", 256);<br/>
* The placeholders %1, %2, %3, %4 creates the bounding box, %5 is for the tilesize
* The minZoom is 0 (means the whole world is visible). The maxZoom is 17 (means it is zoomed in to the max)
* @param host The servers URL
* @param serverPath The path to the tiles with placeholders
* @param tilesize the size of the tiles
*/
WMSMapAdapter(QString host, QString serverPath, int tilesize = 256);
virtual ~WMSMapAdapter();
 
virtual QPoint coordinateToDisplay(const QPointF&) const;
virtual QPointF displayToCoordinate(const QPoint&) const;
 
protected:
virtual void zoom_in();
virtual void zoom_out();
virtual QString query(int x, int y, int z) const;
virtual bool isValid(int x, int y, int z) const;
 
private:
virtual QString getQ(qreal ux, qreal uy, qreal ox, qreal oy) const;
 
qreal coord_per_x_tile;
qreal coord_per_y_tile;
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/yahoomapadapter.cpp
0,0 → 1,63
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#include "yahoomapadapter.h"
namespace qmapcontrol
{
YahooMapAdapter::YahooMapAdapter()
: TileMapAdapter("png.maps.yimg.com", "/png?v=3.1.0&x=%2&y=%3&z=%1", 256, 17,0)
{
int zoom = max_zoom < min_zoom ? min_zoom - current_zoom : current_zoom;
numberOfTiles = pow(2, zoom+1);
}
YahooMapAdapter::YahooMapAdapter(QString host, QString url)
: TileMapAdapter(host, url, 256, 17,0)
{
int zoom = max_zoom < min_zoom ? min_zoom - current_zoom : current_zoom;
numberOfTiles = pow(2, zoom+1);
}
YahooMapAdapter::~YahooMapAdapter()
{
}
 
bool YahooMapAdapter::isValid(int /*x*/, int /*y*/, int /*z*/) const
{
return true;
}
 
int YahooMapAdapter::tilesonzoomlevel(int zoomlevel) const
{
return int(pow(2, zoomlevel+1));
}
 
int YahooMapAdapter::yoffset(int y) const
{
int zoom = max_zoom < min_zoom ? min_zoom - current_zoom : current_zoom;
 
int tiles = int(pow(2, zoom));
y = y*(-1)+tiles-1;
return int(y);
}
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl/yahoomapadapter.h
0,0 → 1,56
/*
*
* This file is part of QMapControl,
* an open-source cross-platform map widget
*
* Copyright (C) 2007 - 2008 Kai Winter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
*
* Contact e-mail: kaiwinter@gmx.de
* Program URL : http://qmapcontrol.sourceforge.net/
*
*/
 
#ifndef YAHOOMAPADAPTER_H
#define YAHOOMAPADAPTER_H
 
#include "tilemapadapter.h"
 
namespace qmapcontrol
{
//! MapAdapter for Yahoo Maps
/*!
* @author Kai Winter <kaiwinter@gmx.de>
*/
class YahooMapAdapter : public TileMapAdapter
{
Q_OBJECT
 
public:
//! constructor
/*!
* This construct a Yahoo Adapter
*/
YahooMapAdapter();
YahooMapAdapter(QString host, QString url);
virtual ~YahooMapAdapter();
bool isValid(int x, int y, int z) const;
 
protected:
virtual int tilesonzoomlevel(int zoomlevel) const;
virtual int yoffset(int y) const;
};
}
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl.h
0,0 → 1,18
#include "../../Global/Class_QMapControl/mapcontrol.h"
#include "../../Global/Class_QMapControl/gps_position.h"
#include "../../Global/Class_QMapControl/wmsmapadapter.h"
#include "../../Global/Class_QMapControl/geometry.h"
#include "../../Global/Class_QMapControl/point.h"
#include "../../Global/Class_QMapControl/imagepoint.h"
#include "../../Global/Class_QMapControl/circlepoint.h"
#include "../../Global/Class_QMapControl/linestring.h"
#include "../../Global/Class_QMapControl/gps_position.h"
#include "../../Global/Class_QMapControl/osmmapadapter.h"
#include "../../Global/Class_QMapControl/maplayer.h"
#include "../../Global/Class_QMapControl/geometrylayer.h"
#include "../../Global/Class_QMapControl/yahoomapadapter.h"
#include "../../Global/Class_QMapControl/googlemapadapter.h"
#include "../../Global/Class_QMapControl/googlesatmapadapter.h"
#include "../../Global/Class_QMapControl/openaerialmapadapter.h"
#include "../../Global/Class_QMapControl/fixedimageoverlay.h"
#include "../../Global/Class_QMapControl/emptymapadapter.h"
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_QMapControl.pri
0,0 → 1,54
DEPENDPATH += ../Global/Class_QMapControl
INCLUDEPATH += ../Global/Class_QMapControl
 
# Input
HEADERS += curve.h \
geometry.h \
imagemanager.h \
layer.h \
layermanager.h \
linestring.h \
mapadapter.h \
mapcontrol.h \
mapnetwork.h \
point.h \
tilemapadapter.h \
wmsmapadapter.h \
circlepoint.h \
imagepoint.h \
gps_position.h \
osmmapadapter.h \
maplayer.h \
geometrylayer.h \
yahoomapadapter.h \
googlemapadapter.h \
googlesatmapadapter.h \
openaerialmapadapter.h \
fixedimageoverlay.h \
emptymapadapter.h
SOURCES += curve.cpp \
geometry.cpp \
imagemanager.cpp \
layer.cpp \
layermanager.cpp \
linestring.cpp \
mapadapter.cpp \
mapcontrol.cpp \
mapnetwork.cpp \
point.cpp \
tilemapadapter.cpp \
wmsmapadapter.cpp \
circlepoint.cpp \
imagepoint.cpp \
gps_position.cpp \
osmmapadapter.cpp \
maplayer.cpp \
geometrylayer.cpp \
yahoomapadapter.cpp \
googlemapadapter.cpp \
googlesatmapadapter.cpp \
openaerialmapadapter.cpp \
fixedimageoverlay.cpp \
emptymapadapter.cpp
 
QT += network
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_SerialPort/ManageSerialPort.cpp
0,0 → 1,577
/********************************************************************************************************
* PROGRAM : QSerialPortTerminal
* DATE - TIME : vendredi 03 octobre 2008 - 11h15
* AUTHOR : VIANNEY-LIAUD Philippe ( philippe.vianney.liaud gmail.com )
* FILENAME : ManageSerialPort.cpp
* LICENSE : GPL
* COMMENTARY :
********************************************************************************************************/
#include <QtDebug>
#include "ManageSerialPort.h"
 
/********************************************************************************************************
* Classe ManageSerialPort
*****************************************************************************************************/
 
//Constructeur
ManageSerialPort::ManageSerialPort()
{
//Init pointeur a NULL
threadSend = NULL;
threadReceive = NULL;
//Init des bool
sendingEnabled = false;
receivingEnabled = false;
closeCalled = false;
saveStateSendEnabled = false;
saveStateReceivedEnabled = false;
saveStateReceiveData = false;
}
 
ManageSerialPort::ManageSerialPort(const QString &name, const BaudRateType baudRate, \
const DataBitsType dataBits, const ParityType parity, \
const StopBitsType stopBits, const FlowType flowControl, \
ulong seconds, ulong milliseconds)
{
//Init pointeur a NULL
threadSend = NULL;
threadReceive = NULL;
//Init des bool
sendingEnabled = false;
receivingEnabled = false;
closeCalled = false;
saveStateSendEnabled = false;
saveStateReceivedEnabled = false;
saveStateReceiveData = false;
setPort(name);
setBaudRate(baudRate);
setDataBits(dataBits);
setParity(parity);
setStopBits(stopBits);
setFlowControl(flowControl);
setTimeout(seconds, milliseconds);
}
 
//Destructeur
ManageSerialPort::~ManageSerialPort()
{
if (threadSend != NULL)
{
delete threadSend;
threadSend = NULL;
}
if (threadReceive != NULL)
{
delete threadReceive;
threadReceive = NULL;
}
if (isOpen())
extSerialPort.close();
}
 
bool ManageSerialPort::open()
{
bool res = extSerialPort.open(QIODevice::ReadWrite);
if (closeCalled)
{
if (saveStateSendEnabled)
enableSending();
if (saveStateReceivedEnabled)
enableReceiving();
if (saveStateReceiveData)
receiveData();
closeCalled = false;
}
return res;
}
 
bool ManageSerialPort::open(const QString &name, const BaudRateType baudRate, \
const DataBitsType dataBits,const ParityType parity, \
const StopBitsType stopBits, const FlowType flowControl, \
ulong seconds, ulong milliseconds)
{
setPort(name);
setBaudRate(baudRate);
setDataBits(dataBits);
setParity(parity);
setStopBits(stopBits);
setFlowControl(flowControl);
setTimeout(seconds, milliseconds);
bool res = extSerialPort.open(QIODevice::ReadWrite);
return res;
}
 
bool ManageSerialPort::isOpen()
{
return extSerialPort.isOpen();
}
 
void ManageSerialPort::close()
{
closeCalled = true;
saveStateSendEnabled = isSendingEnabled();
saveStateReceivedEnabled = isReceivingEnabled();
disableSending();
disableReceiving();
extSerialPort.close();
}
 
void ManageSerialPort::setPort(const QString &name)
{
extSerialPort.setPortName(name);
}
 
QString ManageSerialPort::getPort()
{
return extSerialPort.portName();
}
 
 
void ManageSerialPort::setBaudRate(const BaudRateType baudRate)
{
extSerialPort.setBaudRate(baudRate);
}
 
QString ManageSerialPort::getBaudRate()
{
switch (extSerialPort.baudRate())
{
case BAUD50:
return QString("50");
case BAUD75:
return QString("75");
case BAUD110:
return QString("110");
case BAUD134:
return QString("134");
case BAUD150:
return QString("150");
case BAUD200:
return QString("200");
case BAUD300:
return QString("300");
case BAUD600:
return QString("600");
case BAUD1200:
return QString("1200");
case BAUD1800:
return QString("1800");
case BAUD2400:
return QString("2400");
case BAUD4800:
return QString("4800");
case BAUD9600:
return QString("9600");
case BAUD14400:
return QString("14400");
case BAUD19200:
return QString("19200");
case BAUD38400:
return QString("38400");
case BAUD56000:
return QString("56000");
case BAUD57600:
return QString("57600");
case BAUD76800:
return QString("76800");
case BAUD115200:
return QString("115200");
case BAUD128000:
return QString("128000");
case BAUD256000:
return QString("256000");
}
return 0;
}
 
 
void ManageSerialPort::setDataBits(const DataBitsType dataBits)
{
extSerialPort.setDataBits(dataBits);
}
 
QChar ManageSerialPort::getDataBits()
{
switch (extSerialPort.dataBits())
{
case DATA_5:
return QChar('5');
case DATA_6:
return QChar('6');
case DATA_7:
return QChar('7');
case DATA_8:
return QChar('8');
}
return 0;
}
 
 
void ManageSerialPort::setParity(const ParityType parity)
{
extSerialPort.setParity(parity);
}
 
QString ManageSerialPort::getParity()
{
switch (extSerialPort.parity())
{
case PAR_NONE:
return QString(tr("None"));
case PAR_ODD:
return QString(tr("Odd"));
case PAR_EVEN:
return QString(tr("Even"));
case PAR_MARK:
return QString(tr("Mark"));
case PAR_SPACE:
return QString(tr("Space"));
}
return 0;
}
 
 
void ManageSerialPort::setStopBits(const StopBitsType stopBits)
{
extSerialPort.setStopBits(stopBits);
}
 
QString ManageSerialPort::getStopBit()
{
switch (extSerialPort.stopBits())
{
case STOP_1:
return QString("1");
case STOP_1_5:
return QString("1.5");
case STOP_2:
return QString("2");
}
return 0;
}
 
 
void ManageSerialPort::setFlowControl(const FlowType flowControl)
{
extSerialPort.setFlowControl(flowControl);
}
 
QString ManageSerialPort::getFlowControl()
{
switch (extSerialPort.flowControl())
{
case FLOW_OFF:
return QString(tr("None"));
case FLOW_HARDWARE :
return QString(tr("Hardware"));
case FLOW_XONXOFF :
return QString(tr("Xon/Xoff"));
}
return 0;
}
 
 
void ManageSerialPort::setTimeout(ulong seconds, ulong milliseconds)
{
extSerialPort.setTimeout(seconds,milliseconds);
}
 
/*
QString ManageSerialPort::getLastErrorToString()
{
ulong res = extSerialPort.lastError();
switch (res)
{
case E_NO_ERROR:
return QString(tr("No Error has occured"));
case E_INVALID_FD:
return QString(tr("Invalid file descriptor (port was not opened correctly)"));
case E_NO_MEMORY:
return QString(tr("Unable to allocate memory tables (POSIX)"));
case E_CAUGHT_NON_BLOCKED_SIGNAL:
return QString(tr("Caught a non-blocked signal (POSIX)"));
case E_PORT_TIMEOUT:
return QString(tr("Operation timed out (POSIX)"));
case E_INVALID_DEVICE:
return QString(tr("The file opened by the port is not a character device (POSIX)"));
case E_BREAK_CONDITION:
return QString(tr("The port detected a break condition"));
case E_FRAMING_ERROR:
return QString(tr("The port detected a framing error (usually caused by incorrect baud rate settings)"));
case E_IO_ERROR:
return QString(tr("There was an I/O error while communicating with the port"));
case E_BUFFER_OVERRUN:
return QString(tr("Character buffer overrun"));
case E_RECEIVE_OVERFLOW:
return QString(tr("Receive buffer overflow"));
case E_RECEIVE_PARITY_ERROR:
return QString(tr("The port detected a parity error in the received data"));
case E_TRANSMIT_OVERFLOW:
return QString(tr("Transmit buffer overflow"));
case E_READ_FAILED:
return QString(tr("General read operation failure"));
case E_WRITE_FAILED:
return QString(tr("General write operation failure"));
}
return 0;
}*/
 
/*
ulong ManageSerialPort::getLastError()
{
return extSerialPort.lastError();
}
*/
 
 
void ManageSerialPort::enableSending()
{
if (!sendingEnabled && threadSend == NULL) //Si l'envoi n'est pas active && si threadSend n'est pas alloue
{
threadSend = new ThreadSend(extSerialPort);
sendingEnabled = true;
}
}
 
void ManageSerialPort::disableSending()
{
if (sendingEnabled && threadSend != NULL) //Si l'envoi est active && si threadSend est alloue
{
delete (threadSend);
threadSend = NULL;
sendingEnabled = false;
}
}
 
bool ManageSerialPort::isSendingEnabled()
{
return sendingEnabled;
}
 
uchar ManageSerialPort::sendData(QByteArray &dataToSend)
{
if (!isOpen()) //Si le port n'est pas ouvert
return 2;
if (!sendingEnabled || threadSend == NULL) //Si l'envoi n'est pas active || si threadSend n'est pas alloue
return 3;
threadSend->addDataToSend(dataToSend); //Ajout des donnees a envoyer
return 1;
}
 
void ManageSerialPort::stopSending()
{
if (!sendingEnabled || threadSend == NULL) //Si l'envoi n'est pas active || si threadSend n'est pas été alloue
return;
if (threadSend->isRunning()) //si un envoi est en cour
{
threadSend->stopSending(); //on donne l'ordre d'arreter l'envoi
 
long tmp = ULONG_MAX;
threadSend->wait(tmp); //on attend l'arret
}
}
 
 
 
void ManageSerialPort::enableReceiving()
{
if (!receivingEnabled && threadReceive == NULL) //Si la reception n'est pas active && si threadReceive n'est pas alloue
{
threadReceive = new ThreadReceive(extSerialPort);
connect(threadReceive, SIGNAL(newDataReceived(const QByteArray &)), this, SIGNAL(newDataReceived(const QByteArray &)));
receivingEnabled = true;
}
}
 
void ManageSerialPort::disableReceiving()
{
if (receivingEnabled && threadReceive != NULL) //Si la reception est pas active && si threadReceive est alloue
{
delete (threadReceive);
threadReceive = NULL;
receivingEnabled = false;
}
}
 
bool ManageSerialPort::isReceivingEnabled()
{
return receivingEnabled;
}
 
uchar ManageSerialPort::receiveData()
{
if (!isOpen()) //Si le port n'est pas ouvert
return 2;
if (!receivingEnabled || threadReceive == NULL) //Si la reception n'est pas active || si threadReceive n'est pas été alloue
return 3;
if (!threadReceive->isRunning())
{
saveStateReceiveData = true;
threadReceive->start(); //Demarrage du thread de reception
}
return 1;
}
 
void ManageSerialPort::stopReceiving()
{
if (!receivingEnabled || threadReceive == NULL) //Si la reception n'est pas active || si threadReceive n'est pas alloue
return;
if (threadReceive->isRunning()) //Si le thread de reception est en fonctionnement
{
saveStateReceiveData = false;
threadReceive->stopReceiving(); //on donne l'ordre d'arreter la reception
 
long tmp = ULONG_MAX;
threadReceive->wait(tmp); //on attend l'arret
}
}
 
 
 
 
 
 
 
 
 
 
 
/********************************************************************************************************
* Classe ThreadSend
*****************************************************************************************************/
 
ThreadSend::ThreadSend(QextSerialPort &addressSerialPort) : extSerialPort(addressSerialPort)
{
dataToSend.clear();
stopped=false;
}
 
ThreadSend::~ThreadSend()
{
if (isRunning())
{
stopSending();
wait();
}
}
 
 
void ThreadSend::addDataToSend(QByteArray &dataToAdd)
{
QMutexLocker locker(&mutexSend);
for (int i=0; i<dataToAdd.size(); i++)
dataToSend.enqueue(QByteArray(1,dataToAdd.at(i)));
if (!isRunning())
start();
}
 
void ThreadSend::stopSending()
{
stopped=true;
}
 
void ThreadSend::run()
{
QByteArray byteArray;
forever
{
if (dataToSend.isEmpty() || stopped)
{
stopped = false;
break;
}
mutexSend.lock();
byteArray = dataToSend.dequeue();
mutexSend.unlock();
extSerialPort.write(byteArray, 1);
}
}
 
 
 
 
 
/********************************************************************************************************
* Classe ThreadReceive - A TERMINER
*****************************************************************************************************/
 
ThreadReceive::ThreadReceive(QextSerialPort &addressSerialPort) : extSerialPort(addressSerialPort)
{
stopped=false;
}
 
ThreadReceive::~ThreadReceive()
{
if (isRunning())
{
stopReceiving();
wait();
}
}
 
void ThreadReceive::stopReceiving()
{
stopped = true;
}
 
void ThreadReceive::run()
{
int numBytes=0;
char data[1024];
QByteArray dataReceived;
forever
{
if (stopped)
{
stopped = false;
break;
}
 
mutexReceive.lock();
 
numBytes = extSerialPort.bytesAvailable();
if (numBytes > 0)
{
extSerialPort.read(data, numBytes);
 
for (int xy=1; xy < numBytes; xy++)
{
if (data[xy] == 0)
{
data[xy] = 'a';
}
}
 
data[numBytes]='\0';
dataReceived = data;
emit newDataReceived(dataReceived);
}
mutexReceive.unlock();
}
}
 
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_SerialPort/ManageSerialPort.h
0,0 → 1,324
/********************************************************************************************************
* PROGRAM : QSerialPortTerminal
* DATE - TIME : vendredi 03 octobre 2008 - 11h15
* AUTHOR : VIANNEY-LIAUD Philippe ( philippe.vianney.liaud gmail.com )
* FILENAME : ManageSerialPort.h
* LICENSE : GPL
* COMMENTARY : Manage qExtSerialPort
********************************************************************************************************/
#ifndef MANAGESERIALPORT_H
#define MANAGESERIALPORT_H
 
#include <QThread>
#include <QQueue>
#include <QMetaType>
#include <QMutex>
#include "qextserialport.h"
 
Q_DECLARE_METATYPE(BaudRateType);
Q_DECLARE_METATYPE(DataBitsType);
Q_DECLARE_METATYPE(ParityType);
Q_DECLARE_METATYPE(StopBitsType);
Q_DECLARE_METATYPE(FlowType);
 
class ThreadSend;
class ThreadReceive;
 
 
class ManageSerialPort : public QObject
{
Q_OBJECT
 
public:
//Constructeurs + destructeur
ManageSerialPort();
ManageSerialPort(const QString &name, const BaudRateType baudRate, const DataBitsType dataBits,\
const ParityType parity, const StopBitsType stopBits, \
const FlowType flowControl, ulong seconds, ulong milliseconds);
~ManageSerialPort();
 
//General
bool open();
bool open(const QString &name, const BaudRateType baudRate, const DataBitsType dataBits,\
const ParityType parity, const StopBitsType stopBits, \
const FlowType flowControl, ulong seconds, ulong milliseconds);
bool isOpen();
void close();
 
//Sets the name of the device associated with the object, e.g. "COM1", or "/dev/ttyS0"
void setPort(const QString &name);
QString getPort();
 
/*Most used : '*' (POSTX & Windows)
RATE Windows Speed POSIX Speed
----------- ------------- -----------
enum BaudRateType{
BAUD50 110 50 //POSIX ONLY
BAUD75 110 75 //POSIX ONLY
*BAUD110 110 110
BAUD134 110 134.5 //POSIX ONLY
BAUD150 110 150 //POSIX ONLY
BAUD200 110 200 //POSIX ONLY
*BAUD300 300 300
*BAUD600 600 600
*BAUD1200 1200 1200
BAUD1800 1200 1800 //POSIX ONLY
*BAUD2400 2400 2400
*BAUD4800 4800 4800
*BAUD9600 9600 9600
BAUD14400 14400 9600 //WINDOWS ONLY
*BAUD19200 19200 19200
*BAUD38400 38400 38400
BAUD56000 56000 38400 //WINDOWS ONLY
*BAUD57600 57600 57600
BAUD76800 57600 76800 //POSIX ONLY
*BAUD115200 115200 115200
BAUD128000 128000 115200 //WINDOWS ONLY
BAUD256000 256000 115200 //WINDOWS ONLY
}*/
void setBaudRate(const BaudRateType baudRate);
 
/*getBaudRate
return "50";
return "75";
return "110";
return "134";
return "150";
return "200";
return "300";
return "600";
return "1200";
return "1800";
return "2400";
return "4800";
return "9600";
return "14400";
return "19200";
return "38400";
return "56000";
return "57600";
return "76800";
return "115200";
return "128000";
return "256000";*/
QString getBaudRate();
 
 
/*enum DataBitsType {
DATA_5
DATA_6
DATA_7
DATA_8
};*/
void setDataBits(const DataBitsType dataBits);
 
/*getDataBits
return '5';
return '6';
return '7';
return '8';*/
QChar getDataBits();
 
 
/*enum ParityType {
PAR_NONE //None means that no parity bit is sent at all
PAR_ODD //Odd
PAR_EVEN //Even
PAR_MARK //Windows only : Mark parity means that the parity bit is always set to the mark signal condition (logical 1)
PAR_SPACE //Space parity always sends the parity bit in the space signal condition
};*/
void setParity(const ParityType parity);
 
/*getParity
return "None";
return "Odd";
return "Even";
return "Mark"; Windows only
return "Space";*/
QString getParity();
 
 
/*enum StopBitsType {
STOP_1
STOP_1_5 //WINDOWS ONLY
STOP_2
};*/
void setStopBits(const StopBitsType stopBits);
 
/*getStopBit
return "1"
return "1.5"
return "2"*/
QString getStopBit();
 
 
/*enum FlowType {
FLOW_OFF
FLOW_HARDWARE
FLOW_XONXOFF
};*/
void setFlowControl(const FlowType flowControl);
 
/*getFlowControl
return "None"
return "Hardware"
return "Xon/Xoff"*/
QString getFlowControl();
 
 
void setTimeout(ulong seconds, ulong milliseconds);
 
/*getLastErrorToString
return "No Error has occured"
return "Invalid file descriptor (port was not opened correctly)"
return "Unable to allocate memory tables (POSIX)"
return "Caught a non-blocked signal (POSIX)"
return "Operation timed out (POSIX)"
return "The file opened by the port is not a character device (POSIX)"
return "The port detected a break condition"
return "The port detected a framing error (usually caused by incorrect baud rate settings)"
 
return "There was an I/O error while communicating with the port"
return "Character buffer overrun"
return "Receive buffer overflow"
return "The port detected a parity error in the received data"
return "Transmit buffer overflow"
return "General read operation failure"
return "General write operation failure"*/
/*QString getLastErrorToString();*/
 
/*getLastError
return 0 : No Error has occured
return 1 : Invalid file descriptor (port was not opened correctly)
return 2 : Unable to allocate memory tables (POSIX)
return 3 : Caught a non-blocked signal (POSIX)
return 4 : Operation timed out (POSIX)
return 5 : The file opened by the port is not a character device (POSIX)
return 6 : The port detected a break condition"
return 7 : The port detected a framing error (usually caused by incorrect baud rate settings)
 
return 8 : There was an I/O error while communicating with the port
return 9 : Character buffer overrun
return 10 : Receive buffer overflow
return 11 : The port detected a parity error in the received data
return 12 : Transmit buffer overflow
return 13 : General read operation failure
return 14 : General write operation failure*/
/*ulong getLastError();*/
 
 
 
//Emission
void enableSending();
void disableSending();
 
/*isSendingEnabled
return 0 : sending is not enable
return 1 : sending is enable*/
bool isSendingEnabled();
 
/*sendData
return 1 : add OK
return 2 : port is not open
return 3 : sending is not enable*/
uchar sendData(QByteArray &dataToSend);
 
void stopSending();
 
//Reception
void enableReceiving();
void disableReceiving();
 
/*isReceivingEnabled
return 0 : receiving is not enable
return 1 : receiving is enable*/
bool isReceivingEnabled();
 
/*receiveData
return 1 : start thread OK
return 2 : port is not open
return 3 : receiving is not enable*/
uchar receiveData();
 
void stopReceiving();
 
signals:
void newDataReceived(const QByteArray &dataReceived);
 
private:
//Variables privees
QextSerialPort extSerialPort;
ThreadSend *threadSend;
ThreadReceive *threadReceive;
 
bool sendingEnabled;
bool receivingEnabled;
 
bool closeCalled;
bool saveStateSendEnabled;
bool saveStateReceivedEnabled;
bool saveStateReceiveData;
 
};
 
//#endif // MANAGESERIALPORT_H
 
 
 
 
 
 
 
 
 
class ThreadSend : public QThread
{
Q_OBJECT
 
public:
ThreadSend(QextSerialPort &addressSerialPort);
~ThreadSend();
void addDataToSend(QByteArray &dataToAdd);
void stopSending();
 
protected:
void run();
 
private:
QMutex mutexSend;
QextSerialPort &extSerialPort;
QQueue<QByteArray> dataToSend;
bool stopped;
};
 
 
 
 
 
 
 
 
 
 
class ThreadReceive : public QThread
{
Q_OBJECT
 
public:
ThreadReceive(QextSerialPort &addressSerialPort);
~ThreadReceive();
void stopReceiving();
 
protected:
void run();
 
private :
QMutex mutexReceive;
QextSerialPort &extSerialPort;
bool stopped;
 
signals:
void newDataReceived(const QByteArray &dataReceived);
};
 
#endif // MANAGESERIALPORT_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_SerialPort/posix_qextserialport.cpp
0,0 → 1,1114
 
/*!
\class Posix_QextSerialPort
\version 1.0.0
\author Stefan Sander
 
A cross-platform serial port class.
This class encapsulates the POSIX portion of QextSerialPort. The user will be notified of errors
and possible portability conflicts at run-time by default - this behavior can be turned off by
defining _TTY_NOWARN_ (to turn off all warnings) or _TTY_NOWARN_PORT_ (to turn off portability
warnings) in the project. Note that _TTY_NOWARN_ will also turn off portability warnings.
*/
 
#include <stdio.h>
#include "posix_qextserialport.h"
 
/*!
\fn Posix_QextSerialPort::Posix_QextSerialPort()
Default constructor. Note that the name of the device used by a QextSerialPort constructed with
this constructor will be determined by #defined constants, or lack thereof - the default behavior
is the same as _TTY_LINUX_. Possible naming conventions and their associated constants are:
 
\verbatim
 
Constant Used By Naming Convention
---------- ------------- ------------------------
_TTY_WIN_ Windows COM1, COM2
_TTY_IRIX_ SGI/IRIX /dev/ttyf1, /dev/ttyf2
_TTY_HPUX_ HP-UX /dev/tty1p0, /dev/tty2p0
_TTY_SUN_ SunOS/Solaris /dev/ttya, /dev/ttyb
_TTY_DIGITAL_ Digital UNIX /dev/tty01, /dev/tty02
_TTY_FREEBSD_ FreeBSD /dev/ttyd0, /dev/ttyd1
_TTY_LINUX_ Linux /dev/ttyS0, /dev/ttyS1
<none> Linux /dev/ttyS0, /dev/ttyS1
\endverbatim
 
This constructor assigns the device name to the name of the first port on the specified system.
See the other constructors if you need to open a different port.
*/
Posix_QextSerialPort::Posix_QextSerialPort()
: QextSerialBase()
{
Posix_File=new QFile();
}
 
/*!
\fn Posix_QextSerialPort::Posix_QextSerialPort(const Posix_QextSerialPort&)
Copy constructor.
*/
Posix_QextSerialPort::Posix_QextSerialPort(const Posix_QextSerialPort& s)
: QextSerialBase(s.port)
{
setOpenMode(s.openMode());
port = s.port;
Settings.BaudRate=s.Settings.BaudRate;
Settings.DataBits=s.Settings.DataBits;
Settings.Parity=s.Settings.Parity;
Settings.StopBits=s.Settings.StopBits;
Settings.FlowControl=s.Settings.FlowControl;
lastErr=s.lastErr;
Posix_File=new QFile();
Posix_File=s.Posix_File;
memcpy(&Posix_Timeout, &s.Posix_Timeout, sizeof(struct timeval));
memcpy(&Posix_Copy_Timeout, &s.Posix_Copy_Timeout, sizeof(struct timeval));
memcpy(&Posix_CommConfig, &s.Posix_CommConfig, sizeof(struct termios));
}
 
/*!
\fn Posix_QextSerialPort::Posix_QextSerialPort(const QString & name)
Constructs a serial port attached to the port specified by name.
name is the name of the device, which is windowsystem-specific,
e.g."COM1" or "/dev/ttyS0".
*/
Posix_QextSerialPort::Posix_QextSerialPort(const QString & name)
: QextSerialBase(name)
{
Posix_File=new QFile();
}
 
/*!
\fn Posix_QextSerialPort::Posix_QextSerialPort(const PortSettings& settings)
Constructs a port with default name and specified settings.
*/
Posix_QextSerialPort::Posix_QextSerialPort(const PortSettings& settings)
: QextSerialBase()
{
setBaudRate(settings.BaudRate);
setDataBits(settings.DataBits);
setParity(settings.Parity);
setStopBits(settings.StopBits);
setFlowControl(settings.FlowControl);
Posix_File=new QFile();
setTimeout(settings.Timeout_Sec, settings.Timeout_Millisec);
}
 
/*!
\fn Posix_QextSerialPort::Posix_QextSerialPort(const QString & name, const PortSettings& settings)
Constructs a port with specified name and settings.
*/
Posix_QextSerialPort::Posix_QextSerialPort(const QString & name, const PortSettings& settings)
: QextSerialBase(name)
{
setBaudRate(settings.BaudRate);
setDataBits(settings.DataBits);
setParity(settings.Parity);
setStopBits(settings.StopBits);
setFlowControl(settings.FlowControl);
Posix_File=new QFile();
setTimeout(settings.Timeout_Sec, settings.Timeout_Millisec);
}
 
/*!
\fn Posix_QextSerialPort& Posix_QextSerialPort::operator=(const Posix_QextSerialPort& s)
Override the = operator.
*/
Posix_QextSerialPort& Posix_QextSerialPort::operator=(const Posix_QextSerialPort& s)
{
setOpenMode(s.openMode());
port = s.port;
Settings.BaudRate=s.Settings.BaudRate;
Settings.DataBits=s.Settings.DataBits;
Settings.Parity=s.Settings.Parity;
Settings.StopBits=s.Settings.StopBits;
Settings.FlowControl=s.Settings.FlowControl;
lastErr=s.lastErr;
Posix_File=s.Posix_File;
memcpy(&Posix_Timeout, &(s.Posix_Timeout), sizeof(struct timeval));
memcpy(&Posix_Copy_Timeout, &(s.Posix_Copy_Timeout), sizeof(struct timeval));
memcpy(&Posix_CommConfig, &(s.Posix_CommConfig), sizeof(struct termios));
return *this;
}
 
/*!
\fn Posix_QextSerialPort::~Posix_QextSerialPort()
Standard destructor.
*/
Posix_QextSerialPort::~Posix_QextSerialPort()
{
if (isOpen()) {
close();
}
Posix_File->close();
delete Posix_File;
}
 
/*!
\fn void Posix_QextSerialPort::setBaudRate(BaudRateType baudRate)
Sets the baud rate of the serial port. Note that not all rates are applicable on
all platforms. The following table shows translations of the various baud rate
constants on Windows(including NT/2000) and POSIX platforms. Speeds marked with an *
are speeds that are usable on both Windows and POSIX.
 
\note
BAUD76800 may not be supported on all POSIX systems. SGI/IRIX systems do not support
BAUD1800.
 
\verbatim
 
RATE Windows Speed POSIX Speed
----------- ------------- -----------
BAUD50 110 50
BAUD75 110 75
*BAUD110 110 110
BAUD134 110 134.5
BAUD150 110 150
BAUD200 110 200
*BAUD300 300 300
*BAUD600 600 600
*BAUD1200 1200 1200
BAUD1800 1200 1800
*BAUD2400 2400 2400
*BAUD4800 4800 4800
*BAUD9600 9600 9600
BAUD14400 14400 9600
*BAUD19200 19200 19200
*BAUD38400 38400 38400
BAUD56000 56000 38400
*BAUD57600 57600 57600
BAUD76800 57600 76800
*BAUD115200 115200 115200
BAUD128000 128000 115200
BAUD256000 256000 115200
\endverbatim
*/
void Posix_QextSerialPort::setBaudRate(BaudRateType baudRate)
{
LOCK_MUTEX();
if (Settings.BaudRate!=baudRate) {
switch (baudRate) {
case BAUD14400:
Settings.BaudRate=BAUD9600;
break;
case BAUD56000:
Settings.BaudRate=BAUD38400;
break;
case BAUD76800:
#ifndef B76800
Settings.BaudRate=BAUD57600;
#else
Settings.BaudRate=baudRate;
#endif
break;
case BAUD128000:
case BAUD256000:
Settings.BaudRate=BAUD115200;
break;
default:
Settings.BaudRate=baudRate;
break;
}
}
if (isOpen()) {
switch (baudRate) {
/*50 baud*/
case BAUD50:
TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows does not support 50 baud operation.");
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B50;
#else
cfsetispeed(&Posix_CommConfig, B50);
cfsetospeed(&Posix_CommConfig, B50);
#endif
break;
/*75 baud*/
case BAUD75:
TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows does not support 75 baud operation.");
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B75;
#else
cfsetispeed(&Posix_CommConfig, B75);
cfsetospeed(&Posix_CommConfig, B75);
#endif
break;
/*110 baud*/
case BAUD110:
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B110;
#else
cfsetispeed(&Posix_CommConfig, B110);
cfsetospeed(&Posix_CommConfig, B110);
#endif
break;
/*134.5 baud*/
case BAUD134:
TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows does not support 134.5 baud operation.");
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B134;
#else
cfsetispeed(&Posix_CommConfig, B134);
cfsetospeed(&Posix_CommConfig, B134);
#endif
break;
/*150 baud*/
case BAUD150:
TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows does not support 150 baud operation.");
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B150;
#else
cfsetispeed(&Posix_CommConfig, B150);
cfsetospeed(&Posix_CommConfig, B150);
#endif
break;
/*200 baud*/
case BAUD200:
TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows does not support 200 baud operation.");
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B200;
#else
cfsetispeed(&Posix_CommConfig, B200);
cfsetospeed(&Posix_CommConfig, B200);
#endif
break;
/*300 baud*/
case BAUD300:
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B300;
#else
cfsetispeed(&Posix_CommConfig, B300);
cfsetospeed(&Posix_CommConfig, B300);
#endif
break;
/*600 baud*/
case BAUD600:
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B600;
#else
cfsetispeed(&Posix_CommConfig, B600);
cfsetospeed(&Posix_CommConfig, B600);
#endif
break;
/*1200 baud*/
case BAUD1200:
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B1200;
#else
cfsetispeed(&Posix_CommConfig, B1200);
cfsetospeed(&Posix_CommConfig, B1200);
#endif
break;
/*1800 baud*/
case BAUD1800:
TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows and IRIX do not support 1800 baud operation.");
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B1800;
#else
cfsetispeed(&Posix_CommConfig, B1800);
cfsetospeed(&Posix_CommConfig, B1800);
#endif
break;
/*2400 baud*/
case BAUD2400:
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B2400;
#else
cfsetispeed(&Posix_CommConfig, B2400);
cfsetospeed(&Posix_CommConfig, B2400);
#endif
break;
/*4800 baud*/
case BAUD4800:
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B4800;
#else
cfsetispeed(&Posix_CommConfig, B4800);
cfsetospeed(&Posix_CommConfig, B4800);
#endif
break;
/*9600 baud*/
case BAUD9600:
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B9600;
#else
cfsetispeed(&Posix_CommConfig, B9600);
cfsetospeed(&Posix_CommConfig, B9600);
#endif
break;
/*14400 baud*/
case BAUD14400:
TTY_WARNING("Posix_QextSerialPort: POSIX does not support 14400 baud operation. Switching to 9600 baud.");
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B9600;
#else
cfsetispeed(&Posix_CommConfig, B9600);
cfsetospeed(&Posix_CommConfig, B9600);
#endif
break;
/*19200 baud*/
case BAUD19200:
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B19200;
#else
cfsetispeed(&Posix_CommConfig, B19200);
cfsetospeed(&Posix_CommConfig, B19200);
#endif
break;
/*38400 baud*/
case BAUD38400:
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B38400;
#else
cfsetispeed(&Posix_CommConfig, B38400);
cfsetospeed(&Posix_CommConfig, B38400);
#endif
break;
/*56000 baud*/
case BAUD56000:
TTY_WARNING("Posix_QextSerialPort: POSIX does not support 56000 baud operation. Switching to 38400 baud.");
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B38400;
#else
cfsetispeed(&Posix_CommConfig, B38400);
cfsetospeed(&Posix_CommConfig, B38400);
#endif
break;
/*57600 baud*/
case BAUD57600:
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B57600;
#else
cfsetispeed(&Posix_CommConfig, B57600);
cfsetospeed(&Posix_CommConfig, B57600);
#endif
break;
/*76800 baud*/
case BAUD76800:
TTY_PORTABILITY_WARNING("Posix_QextSerialPort Portability Warning: Windows and some POSIX systems do not support 76800 baud operation.");
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
#ifdef B76800
Posix_CommConfig.c_cflag|=B76800;
#else
TTY_WARNING("Posix_QextSerialPort: Posix_QextSerialPort was compiled without 76800 baud support. Switching to 57600 baud.");
Posix_CommConfig.c_cflag|=B57600;
#endif //B76800
#else //CBAUD
#ifdef B76800
cfsetispeed(&Posix_CommConfig, B76800);
cfsetospeed(&Posix_CommConfig, B76800);
#else
TTY_WARNING("Posix_QextSerialPort: Posix_QextSerialPort was compiled without 76800 baud support. Switching to 57600 baud.");
cfsetispeed(&Posix_CommConfig, B57600);
cfsetospeed(&Posix_CommConfig, B57600);
#endif //B76800
#endif //CBAUD
break;
/*115200 baud*/
case BAUD115200:
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B115200;
#else
cfsetispeed(&Posix_CommConfig, B115200);
cfsetospeed(&Posix_CommConfig, B115200);
#endif
break;
/*128000 baud*/
case BAUD128000:
TTY_WARNING("Posix_QextSerialPort: POSIX does not support 128000 baud operation. Switching to 115200 baud.");
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B115200;
#else
cfsetispeed(&Posix_CommConfig, B115200);
cfsetospeed(&Posix_CommConfig, B115200);
#endif
break;
/*256000 baud*/
case BAUD256000:
TTY_WARNING("Posix_QextSerialPort: POSIX does not support 256000 baud operation. Switching to 115200 baud.");
#ifdef CBAUD
Posix_CommConfig.c_cflag&=(~CBAUD);
Posix_CommConfig.c_cflag|=B115200;
#else
cfsetispeed(&Posix_CommConfig, B115200);
cfsetospeed(&Posix_CommConfig, B115200);
#endif
break;
}
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Posix_QextSerialPort::setDataBits(DataBitsType dataBits)
Sets the number of data bits used by the serial port. Possible values of dataBits are:
\verbatim
DATA_5 5 data bits
DATA_6 6 data bits
DATA_7 7 data bits
DATA_8 8 data bits
\endverbatim
 
\note
This function is subject to the following restrictions:
\par
5 data bits cannot be used with 2 stop bits.
\par
8 data bits cannot be used with space parity on POSIX systems.
 
*/
void Posix_QextSerialPort::setDataBits(DataBitsType dataBits)
{
LOCK_MUTEX();
if (Settings.DataBits!=dataBits) {
if ((Settings.StopBits==STOP_2 && dataBits==DATA_5) ||
(Settings.StopBits==STOP_1_5 && dataBits!=DATA_5) ||
(Settings.Parity==PAR_SPACE && dataBits==DATA_8)) {
}
else {
Settings.DataBits=dataBits;
}
}
if (isOpen()) {
switch(dataBits) {
/*5 data bits*/
case DATA_5:
if (Settings.StopBits==STOP_2) {
TTY_WARNING("Posix_QextSerialPort: 5 Data bits cannot be used with 2 stop bits.");
}
else {
Settings.DataBits=dataBits;
Posix_CommConfig.c_cflag&=(~CSIZE);
Posix_CommConfig.c_cflag|=CS5;
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
}
break;
/*6 data bits*/
case DATA_6:
if (Settings.StopBits==STOP_1_5) {
TTY_WARNING("Posix_QextSerialPort: 6 Data bits cannot be used with 1.5 stop bits.");
}
else {
Settings.DataBits=dataBits;
Posix_CommConfig.c_cflag&=(~CSIZE);
Posix_CommConfig.c_cflag|=CS6;
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
}
break;
/*7 data bits*/
case DATA_7:
if (Settings.StopBits==STOP_1_5) {
TTY_WARNING("Posix_QextSerialPort: 7 Data bits cannot be used with 1.5 stop bits.");
}
else {
Settings.DataBits=dataBits;
Posix_CommConfig.c_cflag&=(~CSIZE);
Posix_CommConfig.c_cflag|=CS7;
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
}
break;
/*8 data bits*/
case DATA_8:
if (Settings.StopBits==STOP_1_5) {
TTY_WARNING("Posix_QextSerialPort: 8 Data bits cannot be used with 1.5 stop bits.");
}
else {
Settings.DataBits=dataBits;
Posix_CommConfig.c_cflag&=(~CSIZE);
Posix_CommConfig.c_cflag|=CS8;
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
}
break;
}
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Posix_QextSerialPort::setParity(ParityType parity)
Sets the parity associated with the serial port. The possible values of parity are:
\verbatim
PAR_SPACE Space Parity
PAR_MARK Mark Parity
PAR_NONE No Parity
PAR_EVEN Even Parity
PAR_ODD Odd Parity
\endverbatim
 
\note
This function is subject to the following limitations:
\par
POSIX systems do not support mark parity.
\par
POSIX systems support space parity only if tricked into doing so, and only with
fewer than 8 data bits. Use space parity very carefully with POSIX systems.
 
*/
void Posix_QextSerialPort::setParity(ParityType parity)
{
LOCK_MUTEX();
if (Settings.Parity!=parity) {
if (parity==PAR_MARK || (parity==PAR_SPACE && Settings.DataBits==DATA_8)) {
}
else {
Settings.Parity=parity;
}
}
if (isOpen()) {
switch (parity) {
/*space parity*/
case PAR_SPACE:
if (Settings.DataBits==DATA_8) {
TTY_PORTABILITY_WARNING("Posix_QextSerialPort: Space parity is only supported in POSIX with 7 or fewer data bits");
}
else {
/*space parity not directly supported - add an extra data bit to simulate it*/
Posix_CommConfig.c_cflag&=~(PARENB|CSIZE);
switch(Settings.DataBits) {
case DATA_5:
Settings.DataBits=DATA_6;
Posix_CommConfig.c_cflag|=CS6;
break;
case DATA_6:
Settings.DataBits=DATA_7;
Posix_CommConfig.c_cflag|=CS7;
break;
case DATA_7:
Settings.DataBits=DATA_8;
Posix_CommConfig.c_cflag|=CS8;
break;
case DATA_8:
break;
}
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
}
break;
/*mark parity - WINDOWS ONLY*/
case PAR_MARK:
TTY_WARNING("Posix_QextSerialPort: Mark parity is not supported by POSIX.");
break;
/*no parity*/
case PAR_NONE:
Posix_CommConfig.c_cflag&=(~PARENB);
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
break;
/*even parity*/
case PAR_EVEN:
Posix_CommConfig.c_cflag&=(~PARODD);
Posix_CommConfig.c_cflag|=PARENB;
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
break;
/*odd parity*/
case PAR_ODD:
Posix_CommConfig.c_cflag|=(PARENB|PARODD);
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
break;
}
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Posix_QextSerialPort::setStopBits(StopBitsType stopBits)
Sets the number of stop bits used by the serial port. Possible values of stopBits are:
\verbatim
STOP_1 1 stop bit
STOP_1_5 1.5 stop bits
STOP_2 2 stop bits
\endverbatim
\note
This function is subject to the following restrictions:
\par
2 stop bits cannot be used with 5 data bits.
\par
POSIX does not support 1.5 stop bits.
 
*/
void Posix_QextSerialPort::setStopBits(StopBitsType stopBits)
{
LOCK_MUTEX();
if (Settings.StopBits!=stopBits) {
if ((Settings.DataBits==DATA_5 && stopBits==STOP_2) || stopBits==STOP_1_5) {}
else {
Settings.StopBits=stopBits;
}
}
if (isOpen()) {
switch (stopBits) {
/*one stop bit*/
case STOP_1:
Settings.StopBits=stopBits;
Posix_CommConfig.c_cflag&=(~CSTOPB);
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
break;
/*1.5 stop bits*/
case STOP_1_5:
TTY_WARNING("Posix_QextSerialPort: 1.5 stop bit operation is not supported by POSIX.");
break;
/*two stop bits*/
case STOP_2:
if (Settings.DataBits==DATA_5) {
TTY_WARNING("Posix_QextSerialPort: 2 stop bits cannot be used with 5 data bits");
}
else {
Settings.StopBits=stopBits;
Posix_CommConfig.c_cflag|=CSTOPB;
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
}
break;
}
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Posix_QextSerialPort::setFlowControl(FlowType flow)
Sets the flow control used by the port. Possible values of flow are:
\verbatim
FLOW_OFF No flow control
FLOW_HARDWARE Hardware (RTS/CTS) flow control
FLOW_XONXOFF Software (XON/XOFF) flow control
\endverbatim
\note
FLOW_HARDWARE may not be supported on all versions of UNIX. In cases where it is
unsupported, FLOW_HARDWARE is the same as FLOW_OFF.
 
*/
void Posix_QextSerialPort::setFlowControl(FlowType flow)
{
LOCK_MUTEX();
if (Settings.FlowControl!=flow) {
Settings.FlowControl=flow;
}
if (isOpen()) {
switch(flow) {
/*no flow control*/
case FLOW_OFF:
Posix_CommConfig.c_cflag&=(~CRTSCTS);
Posix_CommConfig.c_iflag&=(~(IXON|IXOFF|IXANY));
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
break;
/*software (XON/XOFF) flow control*/
case FLOW_XONXOFF:
Posix_CommConfig.c_cflag&=(~CRTSCTS);
Posix_CommConfig.c_iflag|=(IXON|IXOFF|IXANY);
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
break;
case FLOW_HARDWARE:
Posix_CommConfig.c_cflag|=CRTSCTS;
Posix_CommConfig.c_iflag&=(~(IXON|IXOFF|IXANY));
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
break;
}
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Posix_QextSerialPort::setTimeout(ulong sec, ulong millisec);
Sets the read and write timeouts for the port to sec seconds and millisec milliseconds.
Note that this is a per-character timeout, i.e. the port will wait this long for each
individual character, not for the whole read operation. This timeout also applies to the
bytesWaiting() function.
 
\note
POSIX does not support millisecond-level control for I/O timeout values. Any
timeout set using this function will be set to the next lowest tenth of a second for
the purposes of detecting read or write timeouts. For example a timeout of 550 milliseconds
will be seen by the class as a timeout of 500 milliseconds for the purposes of reading and
writing the port. However millisecond-level control is allowed by the select() system call,
so for example a 550-millisecond timeout will be seen as 550 milliseconds on POSIX systems for
the purpose of detecting available bytes in the read buffer.
 
*/
void Posix_QextSerialPort::setTimeout(ulong sec, ulong millisec)
{
LOCK_MUTEX();
Settings.Timeout_Sec=sec;
Settings.Timeout_Millisec=millisec;
Posix_Copy_Timeout.tv_sec=sec;
Posix_Copy_Timeout.tv_usec=millisec;
if (isOpen()) {
tcgetattr(Posix_File->handle(), &Posix_CommConfig);
Posix_CommConfig.c_cc[VTIME]=sec*10+millisec/100;
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
}
UNLOCK_MUTEX();
}
 
/*!
\fn bool Posix_QextSerialPort::open(OpenMode mode)
Opens the serial port associated to this class.
This function has no effect if the port associated with the class is already open.
The port is also configured to the current settings, as stored in the Settings structure.
*/
bool Posix_QextSerialPort::open(OpenMode mode)
{
LOCK_MUTEX();
if (mode == QIODevice::NotOpen)
return isOpen();
if (!isOpen()) {
/*open the port*/
Posix_File->setFileName(port);
if (Posix_File->open(QIODevice::ReadWrite|QIODevice::Unbuffered)) {
/*set open mode*/
QIODevice::open(mode);
/*configure port settings*/
tcgetattr(Posix_File->handle(), &Posix_CommConfig);
/*set up other port settings*/
Posix_CommConfig.c_cflag|=CREAD|CLOCAL;
Posix_CommConfig.c_lflag&=(~(ICANON|ECHO|ECHOE|ECHOK|ECHONL|ISIG));
Posix_CommConfig.c_iflag&=(~(INPCK|IGNPAR|PARMRK|ISTRIP|ICRNL|IXANY));
Posix_CommConfig.c_oflag&=(~OPOST);
Posix_CommConfig.c_cc[VMIN]=0;
Posix_CommConfig.c_cc[VINTR] = _POSIX_VDISABLE;
Posix_CommConfig.c_cc[VQUIT] = _POSIX_VDISABLE;
Posix_CommConfig.c_cc[VSTART] = _POSIX_VDISABLE;
Posix_CommConfig.c_cc[VSTOP] = _POSIX_VDISABLE;
Posix_CommConfig.c_cc[VSUSP] = _POSIX_VDISABLE;
setBaudRate(Settings.BaudRate);
setDataBits(Settings.DataBits);
setParity(Settings.Parity);
setStopBits(Settings.StopBits);
setFlowControl(Settings.FlowControl);
setTimeout(Settings.Timeout_Sec, Settings.Timeout_Millisec);
tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
} else {
}
}
UNLOCK_MUTEX();
return isOpen();
}
 
/*!
\fn void Posix_QextSerialPort::close()
Closes a serial port. This function has no effect if the serial port associated with the class
is not currently open.
*/
void Posix_QextSerialPort::close()
{
LOCK_MUTEX();
Posix_File->close();
QIODevice::close();
UNLOCK_MUTEX();
}
 
/*!
\fn void Posix_QextSerialPort::flush()
Flushes all pending I/O to the serial port. This function has no effect if the serial port
associated with the class is not currently open.
*/
void Posix_QextSerialPort::flush()
{
LOCK_MUTEX();
if (isOpen()) {
Posix_File->flush();
}
UNLOCK_MUTEX();
}
 
/*!
\fn qint64 Posix_QextSerialPort::size() const
This function will return the number of bytes waiting in the receive queue of the serial port.
It is included primarily to provide a complete QIODevice interface, and will not record errors
in the lastErr member (because it is const). This function is also not thread-safe - in
multithreading situations, use Posix_QextSerialPort::bytesWaiting() instead.
*/
qint64 Posix_QextSerialPort::size() const
{
int numBytes;
if (ioctl(Posix_File->handle(), FIONREAD, &numBytes)<0) {
numBytes=0;
}
return (qint64)numBytes;
}
 
/*!
\fn qint64 Posix_QextSerialPort::bytesAvailable()
Returns the number of bytes waiting in the port's receive queue. This function will return 0 if
the port is not currently open, or -1 on error. Error information can be retrieved by calling
Posix_QextSerialPort::getLastError().
*/
qint64 Posix_QextSerialPort::bytesAvailable()
{
LOCK_MUTEX();
if (isOpen()) {
int bytesQueued;
fd_set fileSet;
FD_ZERO(&fileSet);
FD_SET(Posix_File->handle(), &fileSet);
/*on Linux systems the Posix_Timeout structure will be altered by the select() call.
Make sure we use the right timeout values*/
//memcpy(&Posix_Timeout, &Posix_Copy_Timeout, sizeof(struct timeval));
Posix_Timeout = Posix_Copy_Timeout;
int n=select(Posix_File->handle()+1, &fileSet, NULL, &fileSet, &Posix_Timeout);
if (!n) {
lastErr=E_PORT_TIMEOUT;
UNLOCK_MUTEX();
return -1;
}
if (n==-1 || ioctl(Posix_File->handle(), FIONREAD, &bytesQueued)==-1) {
translateError(errno);
UNLOCK_MUTEX();
return -1;
}
lastErr=E_NO_ERROR;
UNLOCK_MUTEX();
return bytesQueued + QIODevice::bytesAvailable();
}
UNLOCK_MUTEX();
return 0;
}
 
/*!
\fn void Posix_QextSerialPort::ungetChar(char)
This function is included to implement the full QIODevice interface, and currently has no
purpose within this class. This function is meaningless on an unbuffered device and currently
only prints a warning message to that effect.
*/
void Posix_QextSerialPort::ungetChar(char)
{
/*meaningless on unbuffered sequential device - return error and print a warning*/
TTY_WARNING("Posix_QextSerialPort: ungetChar() called on an unbuffered sequential device - operation is meaningless");
}
 
/*!
\fn void Posix_QextSerialPort::translateError(ulong error)
Translates a system-specific error code to a QextSerialPort error code. Used internally.
*/
void Posix_QextSerialPort::translateError(ulong error)
{
switch (error) {
case EBADF:
case ENOTTY:
lastErr=E_INVALID_FD;
break;
case EINTR:
lastErr=E_CAUGHT_NON_BLOCKED_SIGNAL;
break;
case ENOMEM:
lastErr=E_NO_MEMORY;
break;
}
}
 
/*!
\fn void Posix_QextSerialPort::setDtr(bool set)
Sets DTR line to the requested state (high by default). This function will have no effect if
the port associated with the class is not currently open.
*/
void Posix_QextSerialPort::setDtr(bool set)
{
LOCK_MUTEX();
if (isOpen()) {
int status;
ioctl(Posix_File->handle(), TIOCMGET, &status);
if (set) {
status|=TIOCM_DTR;
}
else {
status&=~TIOCM_DTR;
}
ioctl(Posix_File->handle(), TIOCMSET, &status);
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Posix_QextSerialPort::setRts(bool set)
Sets RTS line to the requested state (high by default). This function will have no effect if
the port associated with the class is not currently open.
*/
void Posix_QextSerialPort::setRts(bool set)
{
LOCK_MUTEX();
if (isOpen()) {
int status;
ioctl(Posix_File->handle(), TIOCMGET, &status);
if (set) {
status|=TIOCM_RTS;
}
else {
status&=~TIOCM_RTS;
}
ioctl(Posix_File->handle(), TIOCMSET, &status);
}
UNLOCK_MUTEX();
}
 
/*!
\fn unsigned long Posix_QextSerialPort::lineStatus()
returns the line status as stored by the port function. This function will retrieve the states
of the following lines: DCD, CTS, DSR, and RI. On POSIX systems, the following additional lines
can be monitored: DTR, RTS, Secondary TXD, and Secondary RXD. The value returned is an unsigned
long with specific bits indicating which lines are high. The following constants should be used
to examine the states of individual lines:
 
\verbatim
Mask Line
------ ----
LS_CTS CTS
LS_DSR DSR
LS_DCD DCD
LS_RI RI
LS_RTS RTS (POSIX only)
LS_DTR DTR (POSIX only)
LS_ST Secondary TXD (POSIX only)
LS_SR Secondary RXD (POSIX only)
\endverbatim
 
This function will return 0 if the port associated with the class is not currently open.
*/
unsigned long Posix_QextSerialPort::lineStatus()
{
unsigned long Status=0, Temp=0;
LOCK_MUTEX();
if (isOpen()) {
ioctl(Posix_File->handle(), TIOCMGET, &Temp);
if (Temp&TIOCM_CTS) {
Status|=LS_CTS;
}
if (Temp&TIOCM_DSR) {
Status|=LS_DSR;
}
if (Temp&TIOCM_RI) {
Status|=LS_RI;
}
if (Temp&TIOCM_CD) {
Status|=LS_DCD;
}
if (Temp&TIOCM_DTR) {
Status|=LS_DTR;
}
if (Temp&TIOCM_RTS) {
Status|=LS_RTS;
}
if (Temp&TIOCM_ST) {
Status|=LS_ST;
}
if (Temp&TIOCM_SR) {
Status|=LS_SR;
}
}
UNLOCK_MUTEX();
return Status;
}
 
/*!
\fn qint64 Posix_QextSerialPort::readData(char * data, qint64 maxSize)
Reads a block of data from the serial port. This function will read at most maxSize bytes from
the serial port and place them in the buffer pointed to by data. Return value is the number of
bytes actually read, or -1 on error.
 
\warning before calling this function ensure that serial port associated with this class
is currently open (use isOpen() function to check if port is open).
*/
qint64 Posix_QextSerialPort::readData(char * data, qint64 maxSize)
{
LOCK_MUTEX();
int retVal=0;
retVal=Posix_File->read(data, maxSize);
if (retVal==-1)
lastErr=E_READ_FAILED;
UNLOCK_MUTEX();
return retVal;
}
 
/*!
\fn qint64 Posix_QextSerialPort::writeData(const char * data, qint64 maxSize)
Writes a block of data to the serial port. This function will write maxSize bytes
from the buffer pointed to by data to the serial port. Return value is the number
of bytes actually written, or -1 on error.
 
\warning before calling this function ensure that serial port associated with this class
is currently open (use isOpen() function to check if port is open).
*/
qint64 Posix_QextSerialPort::writeData(const char * data, qint64 maxSize)
{
LOCK_MUTEX();
int retVal=0;
retVal=Posix_File->write(data, maxSize);
if (retVal==-1)
lastErr=E_WRITE_FAILED;
UNLOCK_MUTEX();
flush();
return retVal;
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_SerialPort/posix_qextserialport.h
0,0 → 1,56
 
#ifndef _POSIX_QEXTSERIALPORT_H_
#define _POSIX_QEXTSERIALPORT_H_
 
#include <stdio.h>
#include <termios.h>
#include <errno.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include "qextserialbase.h"
 
class Posix_QextSerialPort:public QextSerialBase {
public:
Posix_QextSerialPort();
Posix_QextSerialPort(const Posix_QextSerialPort& s);
Posix_QextSerialPort(const QString & name);
Posix_QextSerialPort(const PortSettings& settings);
Posix_QextSerialPort(const QString & name, const PortSettings& settings);
Posix_QextSerialPort& operator=(const Posix_QextSerialPort& s);
virtual ~Posix_QextSerialPort();
virtual void setBaudRate(BaudRateType);
virtual void setDataBits(DataBitsType);
virtual void setParity(ParityType);
virtual void setStopBits(StopBitsType);
virtual void setFlowControl(FlowType);
virtual void setTimeout(ulong, ulong);
virtual bool open(OpenMode mode=0);
virtual void close();
virtual void flush();
virtual qint64 size() const;
virtual qint64 bytesAvailable();
virtual void ungetChar(char c);
virtual void translateError(ulong error);
virtual void setDtr(bool set=true);
virtual void setRts(bool set=true);
virtual ulong lineStatus();
protected:
QFile* Posix_File;
struct termios Posix_CommConfig;
struct timeval Posix_Timeout;
struct timeval Posix_Copy_Timeout;
virtual qint64 readData(char * data, qint64 maxSize);
virtual qint64 writeData(const char * data, qint64 maxSize);
};
 
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_SerialPort/qextserialbase.cpp
0,0 → 1,250
 
#include "qextserialbase.h"
 
/*!
\class QextSerialBase
\version 1.0.0
\author Stefan Sander
 
A common base class for Win_QextSerialBase, Posix_QextSerialBase and QextSerialPort.
*/
#ifdef QT_THREAD_SUPPORT
QMutex* QextSerialBase::mutex=NULL;
unsigned long QextSerialBase::refCount=0;
#endif
 
/*!
\fn QextSerialBase::QextSerialBase()
Default constructor.
*/
QextSerialBase::QextSerialBase()
: QIODevice()
{
 
#ifdef _TTY_WIN_
setPortName("COM1");
 
#elif defined(_TTY_IRIX_)
setPortName("/dev/ttyf1");
 
#elif defined(_TTY_HPUX_)
setPortName("/dev/tty1p0");
 
#elif defined(_TTY_SUN_)
setPortName("/dev/ttya");
 
#elif defined(_TTY_DIGITAL_)
setPortName("/dev/tty01");
 
#elif defined(_TTY_FREEBSD_)
setPortName("/dev/ttyd1");
 
#else
setPortName("/dev/ttyS0");
#endif
 
construct();
}
 
/*!
\fn QextSerialBase::QextSerialBase(const QString & name)
Construct a port and assign it to the device specified by the name parameter.
*/
QextSerialBase::QextSerialBase(const QString & name)
: QIODevice()
{
setPortName(name);
construct();
}
 
/*!
\fn QextSerialBase::~QextSerialBase()
Standard destructor.
*/
QextSerialBase::~QextSerialBase()
{
 
#ifdef QT_THREAD_SUPPORT
refCount--;
if (mutex && refCount==0) {
delete mutex;
mutex=NULL;
}
#endif
 
}
 
/*!
\fn void QextSerialBase::construct()
Common constructor function for setting up default port settings.
(9600 Baud, 8N1, no flow control where supported, otherwise no flow control, and 20 ms timeout).
*/
void QextSerialBase::construct()
{
Settings.BaudRate=BAUD9600;
Settings.DataBits=DATA_8;
Settings.Parity=PAR_NONE;
Settings.StopBits=STOP_1;
Settings.FlowControl=FLOW_OFF;
Settings.Timeout_Sec=0;
Settings.Timeout_Millisec=20;
 
#ifdef QT_THREAD_SUPPORT
if (!mutex) {
mutex=new QMutex( QMutex::Recursive );
}
refCount++;
#endif
 
setOpenMode(QIODevice::NotOpen);
}
 
/*!
\fn void QextSerialBase::setPortName(const QString & name)
Sets the name of the device associated with the object, e.g. "COM1", or "/dev/ttyS0".
*/
void QextSerialBase::setPortName(const QString & name)
{
port = name;
}
 
/*!
\fn QString QextSerialBase::portName() const
Returns the name set by setPortName().
*/
QString QextSerialBase::portName() const
{
return port;
}
 
/*!
\fn BaudRateType QextSerialBase::baudRate(void) const
Returns the baud rate of the serial port. For a list of possible return values see
the definition of the enum BaudRateType.
*/
BaudRateType QextSerialBase::baudRate(void) const
{
return Settings.BaudRate;
}
 
/*!
\fn DataBitsType QextSerialBase::dataBits() const
Returns the number of data bits used by the port. For a list of possible values returned by
this function, see the definition of the enum DataBitsType.
*/
DataBitsType QextSerialBase::dataBits() const
{
return Settings.DataBits;
}
 
/*!
\fn ParityType QextSerialBase::parity() const
Returns the type of parity used by the port. For a list of possible values returned by
this function, see the definition of the enum ParityType.
*/
ParityType QextSerialBase::parity() const
{
return Settings.Parity;
}
 
/*!
\fn StopBitsType QextSerialBase::stopBits() const
Returns the number of stop bits used by the port. For a list of possible return values, see
the definition of the enum StopBitsType.
*/
StopBitsType QextSerialBase::stopBits() const
{
return Settings.StopBits;
}
 
/*!
\fn FlowType QextSerialBase::flowControl() const
Returns the type of flow control used by the port. For a list of possible values returned
by this function, see the definition of the enum FlowType.
*/
FlowType QextSerialBase::flowControl() const
{
return Settings.FlowControl;
}
 
/*!
\fn bool QextSerialBase::isSequential() const
Returns true if device is sequential, otherwise returns false. Serial port is sequential device
so this function always returns true. Check QIODevice::isSequential() documentation for more
information.
*/
bool QextSerialBase::isSequential() const
{
return true;
}
 
/*!
\fn bool QextSerialBase::atEnd() const
This function will return true if the input buffer is empty (or on error), and false otherwise.
Call QextSerialBase::lastError() for error information.
*/
bool QextSerialBase::atEnd() const
{
if (size()) {
return true;
}
return false;
}
 
/*!
\fn qint64 QextSerialBase::readLine(char * data, qint64 maxSize)
This function will read a line of buffered input from the port, stopping when either maxSize bytes
have been read, the port has no more data available, or a newline is encountered.
The value returned is the length of the string that was read.
*/
qint64 QextSerialBase::readLine(char * data, qint64 maxSize)
{
qint64 numBytes = bytesAvailable();
char* pData = data;
 
if (maxSize < 2) //maxSize must be larger than 1
return -1;
 
/*read a byte at a time for MIN(bytesAvail, maxSize - 1) iterations, or until a newline*/
while (pData<(data+numBytes) && --maxSize) {
readData(pData, 1);
if (*pData++ == '\n') {
break;
}
}
*pData='\0';
 
/*return size of data read*/
return (pData-data);
}
 
/*!
\fn ulong QextSerialBase::lastError() const
Returns the code for the last error encountered by the port, or E_NO_ERROR if the last port
operation was successful. Possible error codes are:
 
\verbatim
Error Explanation
--------------------------- -------------------------------------------------------------
E_NO_ERROR No Error has occured
E_INVALID_FD Invalid file descriptor (port was not opened correctly)
E_NO_MEMORY Unable to allocate memory tables (POSIX)
E_CAUGHT_NON_BLOCKED_SIGNAL Caught a non-blocked signal (POSIX)
E_PORT_TIMEOUT Operation timed out (POSIX)
E_INVALID_DEVICE The file opened by the port is not a character device (POSIX)
E_BREAK_CONDITION The port detected a break condition
E_FRAMING_ERROR The port detected a framing error
(usually caused by incorrect baud rate settings)
E_IO_ERROR There was an I/O error while communicating with the port
E_BUFFER_OVERRUN Character buffer overrun
E_RECEIVE_OVERFLOW Receive buffer overflow
E_RECEIVE_PARITY_ERROR The port detected a parity error in the received data
E_TRANSMIT_OVERFLOW Transmit buffer overflow
E_READ_FAILED General read operation failure
E_WRITE_FAILED General write operation failure
\endverbatim
*/
ulong QextSerialBase::lastError() const
{
return lastErr;
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_SerialPort/qextserialbase.h
0,0 → 1,196
 
#ifndef _QEXTSERIALBASE_H_
#define _QEXTSERIALBASE_H_
 
#include <QIODevice>
#include <QFile>
 
#ifdef QT_THREAD_SUPPORT
#include <QThread>
#include <QMutex>
#endif
 
/*if all warning messages are turned off, flag portability warnings to be turned off as well*/
#ifdef _TTY_NOWARN_
#define _TTY_NOWARN_PORT_
#endif
 
/*macros for thread support*/
#ifdef QT_THREAD_SUPPORT
#define LOCK_MUTEX() mutex->lock()
#define UNLOCK_MUTEX() mutex->unlock()
#else
#define LOCK_MUTEX()
#define UNLOCK_MUTEX()
#endif
 
/*macros for warning messages*/
#ifdef _TTY_NOWARN_PORT_
#define TTY_PORTABILITY_WARNING(s)
#else
#define TTY_PORTABILITY_WARNING(s) qWarning(s)
#endif
#ifdef _TTY_NOWARN_
#define TTY_WARNING(s)
#else
#define TTY_WARNING(s) qWarning(s)
#endif
 
 
/*line status constants*/
#define LS_CTS 0x01
#define LS_DSR 0x02
#define LS_DCD 0x04
#define LS_RI 0x08
#define LS_RTS 0x10
#define LS_DTR 0x20
#define LS_ST 0x40
#define LS_SR 0x80
 
/*error constants*/
#define E_NO_ERROR 0
#define E_INVALID_FD 1
#define E_NO_MEMORY 2
#define E_CAUGHT_NON_BLOCKED_SIGNAL 3
#define E_PORT_TIMEOUT 4
#define E_INVALID_DEVICE 5
#define E_BREAK_CONDITION 6
#define E_FRAMING_ERROR 7
#define E_IO_ERROR 8
#define E_BUFFER_OVERRUN 9
#define E_RECEIVE_OVERFLOW 10
#define E_RECEIVE_PARITY_ERROR 11
#define E_TRANSMIT_OVERFLOW 12
#define E_READ_FAILED 13
#define E_WRITE_FAILED 14
 
/*enums for port settings*/
enum NamingConvention {
WIN_NAMES,
IRIX_NAMES,
HPUX_NAMES,
SUN_NAMES,
DIGITAL_NAMES,
FREEBSD_NAMES,
LINUX_NAMES
};
 
enum BaudRateType {
BAUD50, //POSIX ONLY
BAUD75, //POSIX ONLY
BAUD110,
BAUD134, //POSIX ONLY
BAUD150, //POSIX ONLY
BAUD200, //POSIX ONLY
BAUD300,
BAUD600,
BAUD1200,
BAUD1800, //POSIX ONLY
BAUD2400,
BAUD4800,
BAUD9600,
BAUD14400, //WINDOWS ONLY
BAUD19200,
BAUD38400,
BAUD56000, //WINDOWS ONLY
BAUD57600,
BAUD76800, //POSIX ONLY
BAUD115200,
BAUD128000, //WINDOWS ONLY
BAUD256000 //WINDOWS ONLY
};
 
enum DataBitsType {
DATA_5,
DATA_6,
DATA_7,
DATA_8
};
 
enum ParityType {
PAR_NONE,
PAR_ODD,
PAR_EVEN,
PAR_MARK, //WINDOWS ONLY
PAR_SPACE
};
 
enum StopBitsType {
STOP_1,
STOP_1_5, //WINDOWS ONLY
STOP_2
};
 
enum FlowType {
FLOW_OFF,
FLOW_HARDWARE,
FLOW_XONXOFF
};
 
/*structure to contain port settings*/
struct PortSettings {
BaudRateType BaudRate;
DataBitsType DataBits;
ParityType Parity;
StopBitsType StopBits;
FlowType FlowControl;
ulong Timeout_Sec;
ulong Timeout_Millisec;
};
 
class QextSerialBase : public QIODevice {
public:
QextSerialBase();
QextSerialBase(const QString & name);
virtual ~QextSerialBase();
virtual void construct();
virtual void setPortName(const QString & name);
virtual QString portName() const;
 
virtual void setBaudRate(BaudRateType)=0;
virtual BaudRateType baudRate() const;
virtual void setDataBits(DataBitsType)=0;
virtual DataBitsType dataBits() const;
virtual void setParity(ParityType)=0;
virtual ParityType parity() const;
virtual void setStopBits(StopBitsType)=0;
virtual StopBitsType stopBits() const;
virtual void setFlowControl(FlowType)=0;
virtual FlowType flowControl() const;
virtual void setTimeout(ulong, ulong)=0;
 
virtual bool open(OpenMode mode=0)=0;
virtual bool isSequential() const;
virtual void close()=0;
virtual void flush()=0;
 
virtual qint64 size() const=0;
virtual qint64 bytesAvailable()=0;
virtual bool atEnd() const;
 
virtual void ungetChar(char c)=0;
virtual qint64 readLine(char * data, qint64 maxSize);
 
virtual ulong lastError() const;
virtual void translateError(ulong error)=0;
 
virtual void setDtr(bool set=true)=0;
virtual void setRts(bool set=true)=0;
virtual ulong lineStatus()=0;
 
protected:
QString port;
PortSettings Settings;
ulong lastErr;
 
#ifdef QT_THREAD_SUPPORT
static QMutex* mutex;
static ulong refCount;
#endif
 
virtual qint64 readData(char * data, qint64 maxSize)=0;
virtual qint64 writeData(const char * data, qint64 maxSize)=0;
 
};
 
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_SerialPort/qextserialport.cpp
0,0 → 1,98
 
/*!
\class QextSerialPort
\version 1.0.0
\author Stefan Sander
 
A cross-platform serial port class.
This class encapsulates a serial port on both POSIX and Windows systems. The user will be
notified of errors and possible portability conflicts at run-time by default - this behavior can
be turned off by defining _TTY_NOWARN_ (to turn off all warnings) or _TTY_NOWARN_PORT_ (to turn
off portability warnings) in the project.
 
\note
On Windows NT/2000/XP this class uses Win32 serial port functions by default. The user may
select POSIX behavior under NT, 2000, or XP ONLY by defining _TTY_POSIX_ in the project. I can
make no guarantees as to the quality of POSIX support under NT/2000 however.
 
*/
 
#include <stdio.h>
#include "qextserialport.h"
 
/*!
\fn QextSerialPort::QextSerialPort()
Default constructor. Note that the naming convention used by a QextSerialPort constructed with
this constructor will be determined by #defined constants, or lack thereof - the default behavior
is the same as _TTY_LINUX_. Possible naming conventions and their associated constants are:
 
\verbatim
 
Constant Used By Naming Convention
---------- ------------- ------------------------
_TTY_WIN_ Windows COM1, COM2
_TTY_IRIX_ SGI/IRIX /dev/ttyf1, /dev/ttyf2
_TTY_HPUX_ HP-UX /dev/tty1p0, /dev/tty2p0
_TTY_SUN_ SunOS/Solaris /dev/ttya, /dev/ttyb
_TTY_DIGITAL_ Digital UNIX /dev/tty01, /dev/tty02
_TTY_FREEBSD_ FreeBSD /dev/ttyd0, /dev/ttyd1
_TTY_LINUX_ Linux /dev/ttyS0, /dev/ttyS1
<none> Linux /dev/ttyS0, /dev/ttyS1
\endverbatim
 
The object will be associated with the first port in the system, e.g. COM1 on Windows systems.
See the other constructors if you need to use a port other than the first.
*/
QextSerialPort::QextSerialPort()
: QextBaseType()
{}
 
/*!
\fn QextSerialPort::QextSerialPort(const QString & name)
Constructs a serial port attached to the port specified by name.
name is the name of the device, which is windowsystem-specific,
e.g."COM1" or "/dev/ttyS0".
*/
QextSerialPort::QextSerialPort(const QString & name)
: QextBaseType(name)
{}
 
/*!
\fn QextSerialPort::QextSerialPort(PortSettings const& settings)
Constructs a port with default name and settings specified by the settings parameter.
*/
QextSerialPort::QextSerialPort(PortSettings const& settings)
: QextBaseType(settings)
{}
 
/*!
\fn QextSerialPort::QextSerialPort(const QString & name, PortSettings const& settings)
Constructs a port with the name and settings specified.
*/
QextSerialPort::QextSerialPort(const QString & name, PortSettings const& settings)
: QextBaseType(name, settings)
{}
 
/*!
\fn QextSerialPort::QextSerialPort(const QextSerialPort& s)
Copy constructor.
*/
QextSerialPort::QextSerialPort(const QextSerialPort& s)
: QextBaseType(s)
{}
 
/*!
\fn QextSerialPort& QextSerialPort::operator=(const QextSerialPort& s)
Overrides the = operator.
*/
QextSerialPort& QextSerialPort::operator=(const QextSerialPort& s)
{
return (QextSerialPort&)QextBaseType::operator=(s);
}
 
/*!
\fn QextSerialPort::~QextSerialPort()
Standard destructor.
*/
QextSerialPort::~QextSerialPort()
{}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_SerialPort/qextserialport.h
0,0 → 1,27
 
#ifndef _QEXTSERIALPORT_H_
#define _QEXTSERIALPORT_H_
 
/*POSIX CODE*/
#ifdef _TTY_POSIX_
#include "posix_qextserialport.h"
#define QextBaseType Posix_QextSerialPort
 
/*MS WINDOWS CODE*/
#else
#include "win_qextserialport.h"
#define QextBaseType Win_QextSerialPort
#endif
 
class QextSerialPort: public QextBaseType {
public:
QextSerialPort();
QextSerialPort(const QString & name);
QextSerialPort(PortSettings const& s);
QextSerialPort(const QString & name, PortSettings const& s);
QextSerialPort(const QextSerialPort& s);
QextSerialPort& operator=(const QextSerialPort&);
virtual ~QextSerialPort();
};
 
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_SerialPort/win_qextserialport.cpp
0,0 → 1,877
/*!
\class Win_QextSerialPort
\version 1.0.0
\author Stefan Sander
 
A cross-platform serial port class.
This class encapsulates the Windows portion of QextSerialPort. The user will be notified of
errors and possible portability conflicts at run-time by default - this behavior can be turned
off by defining _TTY_NOWARN_ (to turn off all warnings) or _TTY_NOWARN_PORT_ (to turn off
portability warnings) in the project. Note that defining _TTY_NOWARN_ also defines
_TTY_NOWARN_PORT_.
 
\note
On Windows NT/2000/XP this class uses Win32 serial port functions by default. The user may
select POSIX behavior under NT, 2000, or XP ONLY by defining _TTY_POSIX_ in the project. I can
make no guarantees as to the quality of POSIX support under NT/2000 however.
 
*/
 
#include <stdio.h>
#include "win_qextserialport.h"
 
/*!
\fn Win_QextSerialPort::Win_QextSerialPort()
Default constructor. Note that the name of the device used by a Win_QextSerialPort constructed
with this constructor will be determined by #defined constants, or lack thereof - the default
behavior is the same as _TTY_LINUX_. Possible naming conventions and their associated constants
are:
 
\verbatim
 
Constant Used By Naming Convention
---------- ------------- ------------------------
_TTY_WIN_ Windows COM1, COM2
_TTY_IRIX_ SGI/IRIX /dev/ttyf1, /dev/ttyf2
_TTY_HPUX_ HP-UX /dev/tty1p0, /dev/tty2p0
_TTY_SUN_ SunOS/Solaris /dev/ttya, /dev/ttyb
_TTY_DIGITAL_ Digital UNIX /dev/tty01, /dev/tty02
_TTY_FREEBSD_ FreeBSD /dev/ttyd0, /dev/ttyd1
_TTY_LINUX_ Linux /dev/ttyS0, /dev/ttyS1
<none> Linux /dev/ttyS0, /dev/ttyS1
\endverbatim
 
This constructor associates the object with the first port on the system, e.g. COM1 for Windows
platforms. See the other constructor if you need a port other than the first.
*/
Win_QextSerialPort::Win_QextSerialPort():QextSerialBase() {
Win_Handle=INVALID_HANDLE_VALUE;
}
 
/*!Win_QextSerialPort::Win_QextSerialPort(const Win_QextSerialPort&)
Copy constructor.
*/
Win_QextSerialPort::Win_QextSerialPort(const Win_QextSerialPort& s):QextSerialBase(s.port) {
Win_Handle=INVALID_HANDLE_VALUE;
setOpenMode(s.openMode());
lastErr=s.lastErr;
port = s.port;
Settings.FlowControl=s.Settings.FlowControl;
Settings.Parity=s.Settings.Parity;
Settings.DataBits=s.Settings.DataBits;
Settings.StopBits=s.Settings.StopBits;
Settings.BaudRate=s.Settings.BaudRate;
Win_Handle=s.Win_Handle;
memcpy(&Win_CommConfig, &s.Win_CommConfig, sizeof(COMMCONFIG));
memcpy(&Win_CommTimeouts, &s.Win_CommTimeouts, sizeof(COMMTIMEOUTS));
}
 
/*!
\fn Win_QextSerialPort::Win_QextSerialPort(const QString & name)
Constructs a serial port attached to the port specified by devName.
devName is the name of the device, which is windowsystem-specific,
e.g."COM2" or "/dev/ttyS0".
*/
Win_QextSerialPort::Win_QextSerialPort(const QString & name):QextSerialBase(name) {
Win_Handle=INVALID_HANDLE_VALUE;
}
 
/*!
\fn Win_QextSerialPort::Win_QextSerialPort(const PortSettings& settings)
Constructs a port with default name and specified settings.
*/
Win_QextSerialPort::Win_QextSerialPort(const PortSettings& settings) {
Win_Handle=INVALID_HANDLE_VALUE;
setBaudRate(settings.BaudRate);
setDataBits(settings.DataBits);
setStopBits(settings.StopBits);
setParity(settings.Parity);
setFlowControl(settings.FlowControl);
setTimeout(settings.Timeout_Sec, settings.Timeout_Millisec);
}
 
/*!
\fn Win_QextSerialPort::Win_QextSerialPort(const QString & name, const PortSettings& settings)
Constructs a port with specified name and settings.
*/
Win_QextSerialPort::Win_QextSerialPort(const QString & name, const PortSettings& settings) {
Win_Handle=INVALID_HANDLE_VALUE;
setPortName(name);
setBaudRate(settings.BaudRate);
setDataBits(settings.DataBits);
setStopBits(settings.StopBits);
setParity(settings.Parity);
setFlowControl(settings.FlowControl);
setTimeout(settings.Timeout_Sec, settings.Timeout_Millisec);
}
 
/*!
\fn Win_QextSerialPort::~Win_QextSerialPort()
Standard destructor.
*/
Win_QextSerialPort::~Win_QextSerialPort() {
if (isOpen()) {
close();
}
}
 
/*!
\fn Win_QextSerialPort& Win_QextSerialPort::operator=(const Win_QextSerialPort& s)
overrides the = operator
*/
Win_QextSerialPort& Win_QextSerialPort::operator=(const Win_QextSerialPort& s) {
setOpenMode(s.openMode());
lastErr=s.lastErr;
port = s.port;
Settings.FlowControl=s.Settings.FlowControl;
Settings.Parity=s.Settings.Parity;
Settings.DataBits=s.Settings.DataBits;
Settings.StopBits=s.Settings.StopBits;
Settings.BaudRate=s.Settings.BaudRate;
Win_Handle=s.Win_Handle;
memcpy(&Win_CommConfig, &s.Win_CommConfig, sizeof(COMMCONFIG));
memcpy(&Win_CommTimeouts, &s.Win_CommTimeouts, sizeof(COMMTIMEOUTS));
return *this;
}
 
/*!
\fn bool Win_QextSerialPort::open(OpenMode mode)
Opens a serial port. Note that this function does not specify which device to open. If you need
to open a device by name, see Win_QextSerialPort::open(const char*). This function has no effect
if the port associated with the class is already open. The port is also configured to the current
settings, as stored in the Settings structure.
*/
bool Win_QextSerialPort::open(OpenMode mode) {
unsigned long confSize = sizeof(COMMCONFIG);
Win_CommConfig.dwSize = confSize;
LOCK_MUTEX();
if (mode == QIODevice::NotOpen)
return isOpen();
if (!isOpen()) {
/*open the port*/
Win_Handle=CreateFileA(port.toAscii(), GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if (Win_Handle!=INVALID_HANDLE_VALUE) {
/*set open mode*/
QIODevice::open(mode);
/*configure port settings*/
GetCommConfig(Win_Handle, &Win_CommConfig, &confSize);
GetCommState(Win_Handle, &(Win_CommConfig.dcb));
/*set up parameters*/
Win_CommConfig.dcb.fBinary=TRUE;
Win_CommConfig.dcb.fInX=FALSE;
Win_CommConfig.dcb.fOutX=FALSE;
Win_CommConfig.dcb.fAbortOnError=FALSE;
Win_CommConfig.dcb.fNull=FALSE;
setBaudRate(Settings.BaudRate);
setDataBits(Settings.DataBits);
setStopBits(Settings.StopBits);
setParity(Settings.Parity);
setFlowControl(Settings.FlowControl);
setTimeout(Settings.Timeout_Sec, Settings.Timeout_Millisec);
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
}
}
UNLOCK_MUTEX();
return isOpen();
}
 
/*!
\fn void Win_QextSerialPort::close()
Closes a serial port. This function has no effect if the serial port associated with the class
is not currently open.
*/
void Win_QextSerialPort::close() {
LOCK_MUTEX();
CloseHandle(Win_Handle);
QIODevice::close();
UNLOCK_MUTEX();
}
 
/*!
\fn void Win_QextSerialPort::flush()
Flushes all pending I/O to the serial port. This function has no effect if the serial port
associated with the class is not currently open.
*/
void Win_QextSerialPort::flush() {
LOCK_MUTEX();
if (isOpen()) {
FlushFileBuffers(Win_Handle);
}
UNLOCK_MUTEX();
}
 
/*!
\fn qint64 Win_QextSerialPort::size() const
This function will return the number of bytes waiting in the receive queue of the serial port.
It is included primarily to provide a complete QIODevice interface, and will not record errors
in the lastErr member (because it is const). This function is also not thread-safe - in
multithreading situations, use Win_QextSerialPort::bytesAvailable() instead.
*/
qint64 Win_QextSerialPort::size() const {
int availBytes;
COMSTAT Win_ComStat;
DWORD Win_ErrorMask=0;
ClearCommError(Win_Handle, &Win_ErrorMask, &Win_ComStat);
availBytes = Win_ComStat.cbInQue;
return (qint64)availBytes;
}
 
/*!
\fn qint64 Win_QextSerialPort::bytesAvailable()
Returns the number of bytes waiting in the port's receive queue. This function will return 0 if
the port is not currently open, or -1 on error. Error information can be retrieved by calling
Win_QextSerialPort::getLastError().
*/
qint64 Win_QextSerialPort::bytesAvailable() {
LOCK_MUTEX();
if (isOpen()) {
DWORD Errors;
COMSTAT Status;
bool success=ClearCommError(Win_Handle, &Errors, &Status);
translateError(Errors);
if (success) {
lastErr=E_NO_ERROR;
UNLOCK_MUTEX();
return Status.cbInQue + QIODevice::bytesAvailable();
}
UNLOCK_MUTEX();
return (unsigned int)-1;
}
UNLOCK_MUTEX();
return 0;
}
 
/*!
\fn void Win_QextSerialPort::translateError(ulong error)
Translates a system-specific error code to a QextSerialPort error code. Used internally.
*/
void Win_QextSerialPort::translateError(ulong error) {
if (error&CE_BREAK) {
lastErr=E_BREAK_CONDITION;
}
else if (error&CE_FRAME) {
lastErr=E_FRAMING_ERROR;
}
else if (error&CE_IOE) {
lastErr=E_IO_ERROR;
}
else if (error&CE_MODE) {
lastErr=E_INVALID_FD;
}
else if (error&CE_OVERRUN) {
lastErr=E_BUFFER_OVERRUN;
}
else if (error&CE_RXPARITY) {
lastErr=E_RECEIVE_PARITY_ERROR;
}
else if (error&CE_RXOVER) {
lastErr=E_RECEIVE_OVERFLOW;
}
else if (error&CE_TXFULL) {
lastErr=E_TRANSMIT_OVERFLOW;
}
}
 
/*!
\fn qint64 Win_QextSerialPort::readData(char *data, qint64 maxSize)
Reads a block of data from the serial port. This function will read at most maxlen bytes from
the serial port and place them in the buffer pointed to by data. Return value is the number of
bytes actually read, or -1 on error.
 
\warning before calling this function ensure that serial port associated with this class
is currently open (use isOpen() function to check if port is open).
*/
qint64 Win_QextSerialPort::readData(char *data, qint64 maxSize)
{
LOCK_MUTEX();
int retVal=0;
COMSTAT Win_ComStat;
DWORD Win_BytesRead=0;
DWORD Win_ErrorMask=0;
ClearCommError(Win_Handle, &Win_ErrorMask, &Win_ComStat);
if (Win_ComStat.cbInQue &&
(!ReadFile(Win_Handle, (void*)data, (DWORD)maxSize, &Win_BytesRead, NULL)
|| Win_BytesRead==0)) {
lastErr=E_READ_FAILED;
retVal=-1;
}
else {
retVal=((int)Win_BytesRead);
}
UNLOCK_MUTEX();
return retVal;
}
 
/*!
\fn qint64 Win_QextSerialPort::writeData(const char *data, qint64 maxSize)
Writes a block of data to the serial port. This function will write len bytes
from the buffer pointed to by data to the serial port. Return value is the number
of bytes actually written, or -1 on error.
 
\warning before calling this function ensure that serial port associated with this class
is currently open (use isOpen() function to check if port is open).
*/
qint64 Win_QextSerialPort::writeData(const char *data, qint64 maxSize)
{
LOCK_MUTEX();
int retVal=0;
DWORD Win_BytesWritten;
if (!WriteFile(Win_Handle, (void*)data, (DWORD)maxSize, &Win_BytesWritten, NULL)) {
lastErr=E_WRITE_FAILED;
retVal=-1;
}
else {
retVal=((int)Win_BytesWritten);
}
UNLOCK_MUTEX();
flush();
return retVal;
}
 
/*!
\fn void Win_QextSerialPort::ungetChar(char c)
This function is included to implement the full QIODevice interface, and currently has no
purpose within this class. This function is meaningless on an unbuffered device and currently
only prints a warning message to that effect.
*/
void Win_QextSerialPort::ungetChar(char c) {
/*meaningless on unbuffered sequential device - return error and print a warning*/
TTY_WARNING("Win_QextSerialPort: ungetChar() called on an unbuffered sequential device - operation is meaningless");
}
 
/*!
\fn void Win_QextSerialPort::setFlowControl(FlowType flow)
Sets the flow control used by the port. Possible values of flow are:
\verbatim
FLOW_OFF No flow control
FLOW_HARDWARE Hardware (RTS/CTS) flow control
FLOW_XONXOFF Software (XON/XOFF) flow control
\endverbatim
*/
void Win_QextSerialPort::setFlowControl(FlowType flow) {
LOCK_MUTEX();
if (Settings.FlowControl!=flow) {
Settings.FlowControl=flow;
}
if (isOpen()) {
switch(flow) {
/*no flow control*/
case FLOW_OFF:
Win_CommConfig.dcb.fOutxCtsFlow=FALSE;
Win_CommConfig.dcb.fRtsControl=RTS_CONTROL_DISABLE;
Win_CommConfig.dcb.fInX=FALSE;
Win_CommConfig.dcb.fOutX=FALSE;
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
break;
/*software (XON/XOFF) flow control*/
case FLOW_XONXOFF:
Win_CommConfig.dcb.fOutxCtsFlow=FALSE;
Win_CommConfig.dcb.fRtsControl=RTS_CONTROL_DISABLE;
Win_CommConfig.dcb.fInX=TRUE;
Win_CommConfig.dcb.fOutX=TRUE;
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
break;
case FLOW_HARDWARE:
Win_CommConfig.dcb.fOutxCtsFlow=TRUE;
Win_CommConfig.dcb.fRtsControl=RTS_CONTROL_HANDSHAKE;
Win_CommConfig.dcb.fInX=FALSE;
Win_CommConfig.dcb.fOutX=FALSE;
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
break;
}
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Win_QextSerialPort::setParity(ParityType parity)
Sets the parity associated with the serial port. The possible values of parity are:
\verbatim
PAR_SPACE Space Parity
PAR_MARK Mark Parity
PAR_NONE No Parity
PAR_EVEN Even Parity
PAR_ODD Odd Parity
\endverbatim
*/
void Win_QextSerialPort::setParity(ParityType parity) {
LOCK_MUTEX();
if (Settings.Parity!=parity) {
Settings.Parity=parity;
}
if (isOpen()) {
Win_CommConfig.dcb.Parity=(unsigned char)parity;
switch (parity) {
/*space parity*/
case PAR_SPACE:
if (Settings.DataBits==DATA_8) {
TTY_PORTABILITY_WARNING("Win_QextSerialPort Portability Warning: Space parity with 8 data bits is not supported by POSIX systems.");
}
Win_CommConfig.dcb.fParity=TRUE;
break;
/*mark parity - WINDOWS ONLY*/
case PAR_MARK:
TTY_PORTABILITY_WARNING("Win_QextSerialPort Portability Warning: Mark parity is not supported by POSIX systems");
Win_CommConfig.dcb.fParity=TRUE;
break;
/*no parity*/
case PAR_NONE:
Win_CommConfig.dcb.fParity=FALSE;
break;
/*even parity*/
case PAR_EVEN:
Win_CommConfig.dcb.fParity=TRUE;
break;
/*odd parity*/
case PAR_ODD:
Win_CommConfig.dcb.fParity=TRUE;
break;
}
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Win_QextSerialPort::setDataBits(DataBitsType dataBits)
Sets the number of data bits used by the serial port. Possible values of dataBits are:
\verbatim
DATA_5 5 data bits
DATA_6 6 data bits
DATA_7 7 data bits
DATA_8 8 data bits
\endverbatim
 
\note
This function is subject to the following restrictions:
\par
5 data bits cannot be used with 2 stop bits.
\par
1.5 stop bits can only be used with 5 data bits.
\par
8 data bits cannot be used with space parity on POSIX systems.
 
*/
void Win_QextSerialPort::setDataBits(DataBitsType dataBits) {
LOCK_MUTEX();
if (Settings.DataBits!=dataBits) {
if ((Settings.StopBits==STOP_2 && dataBits==DATA_5) ||
(Settings.StopBits==STOP_1_5 && dataBits!=DATA_5)) {
}
else {
Settings.DataBits=dataBits;
}
}
if (isOpen()) {
switch(dataBits) {
/*5 data bits*/
case DATA_5:
if (Settings.StopBits==STOP_2) {
TTY_WARNING("Win_QextSerialPort: 5 Data bits cannot be used with 2 stop bits.");
}
else {
Win_CommConfig.dcb.ByteSize=5;
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
}
break;
/*6 data bits*/
case DATA_6:
if (Settings.StopBits==STOP_1_5) {
TTY_WARNING("Win_QextSerialPort: 6 Data bits cannot be used with 1.5 stop bits.");
}
else {
Win_CommConfig.dcb.ByteSize=6;
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
}
break;
/*7 data bits*/
case DATA_7:
if (Settings.StopBits==STOP_1_5) {
TTY_WARNING("Win_QextSerialPort: 7 Data bits cannot be used with 1.5 stop bits.");
}
else {
Win_CommConfig.dcb.ByteSize=7;
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
}
break;
/*8 data bits*/
case DATA_8:
if (Settings.StopBits==STOP_1_5) {
TTY_WARNING("Win_QextSerialPort: 8 Data bits cannot be used with 1.5 stop bits.");
}
else {
Win_CommConfig.dcb.ByteSize=8;
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
}
break;
}
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Win_QextSerialPort::setStopBits(StopBitsType stopBits)
Sets the number of stop bits used by the serial port. Possible values of stopBits are:
\verbatim
STOP_1 1 stop bit
STOP_1_5 1.5 stop bits
STOP_2 2 stop bits
\endverbatim
 
\note
This function is subject to the following restrictions:
\par
2 stop bits cannot be used with 5 data bits.
\par
1.5 stop bits cannot be used with 6 or more data bits.
\par
POSIX does not support 1.5 stop bits.
*/
void Win_QextSerialPort::setStopBits(StopBitsType stopBits) {
LOCK_MUTEX();
if (Settings.StopBits!=stopBits) {
if ((Settings.DataBits==DATA_5 && stopBits==STOP_2) ||
(stopBits==STOP_1_5 && Settings.DataBits!=DATA_5)) {
}
else {
Settings.StopBits=stopBits;
}
}
if (isOpen()) {
switch (stopBits) {
/*one stop bit*/
case STOP_1:
Win_CommConfig.dcb.StopBits=ONESTOPBIT;
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
break;
/*1.5 stop bits*/
case STOP_1_5:
TTY_PORTABILITY_WARNING("Win_QextSerialPort Portability Warning: 1.5 stop bit operation is not supported by POSIX.");
if (Settings.DataBits!=DATA_5) {
TTY_WARNING("Win_QextSerialPort: 1.5 stop bits can only be used with 5 data bits");
}
else {
Win_CommConfig.dcb.StopBits=ONE5STOPBITS;
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
}
break;
/*two stop bits*/
case STOP_2:
if (Settings.DataBits==DATA_5) {
TTY_WARNING("Win_QextSerialPort: 2 stop bits cannot be used with 5 data bits");
}
else {
Win_CommConfig.dcb.StopBits=TWOSTOPBITS;
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
}
break;
}
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Win_QextSerialPort::setBaudRate(BaudRateType baudRate)
Sets the baud rate of the serial port. Note that not all rates are applicable on
all platforms. The following table shows translations of the various baud rate
constants on Windows(including NT/2000) and POSIX platforms. Speeds marked with an *
are speeds that are usable on both Windows and POSIX.
\verbatim
 
RATE Windows Speed POSIX Speed
----------- ------------- -----------
BAUD50 110 50
BAUD75 110 75
*BAUD110 110 110
BAUD134 110 134.5
BAUD150 110 150
BAUD200 110 200
*BAUD300 300 300
*BAUD600 600 600
*BAUD1200 1200 1200
BAUD1800 1200 1800
*BAUD2400 2400 2400
*BAUD4800 4800 4800
*BAUD9600 9600 9600
BAUD14400 14400 9600
*BAUD19200 19200 19200
*BAUD38400 38400 38400
BAUD56000 56000 38400
*BAUD57600 57600 57600
BAUD76800 57600 76800
*BAUD115200 115200 115200
BAUD128000 128000 115200
BAUD256000 256000 115200
\endverbatim
*/
void Win_QextSerialPort::setBaudRate(BaudRateType baudRate) {
LOCK_MUTEX();
if (Settings.BaudRate!=baudRate) {
switch (baudRate) {
case BAUD50:
case BAUD75:
case BAUD134:
case BAUD150:
case BAUD200:
Settings.BaudRate=BAUD110;
break;
case BAUD1800:
Settings.BaudRate=BAUD1200;
break;
case BAUD76800:
Settings.BaudRate=BAUD57600;
break;
default:
Settings.BaudRate=baudRate;
break;
}
}
if (isOpen()) {
switch (baudRate) {
/*50 baud*/
case BAUD50:
TTY_WARNING("Win_QextSerialPort: Windows does not support 50 baud operation. Switching to 110 baud.");
Win_CommConfig.dcb.BaudRate=CBR_110;
break;
/*75 baud*/
case BAUD75:
TTY_WARNING("Win_QextSerialPort: Windows does not support 75 baud operation. Switching to 110 baud.");
Win_CommConfig.dcb.BaudRate=CBR_110;
break;
/*110 baud*/
case BAUD110:
Win_CommConfig.dcb.BaudRate=CBR_110;
break;
/*134.5 baud*/
case BAUD134:
TTY_WARNING("Win_QextSerialPort: Windows does not support 134.5 baud operation. Switching to 110 baud.");
Win_CommConfig.dcb.BaudRate=CBR_110;
break;
/*150 baud*/
case BAUD150:
TTY_WARNING("Win_QextSerialPort: Windows does not support 150 baud operation. Switching to 110 baud.");
Win_CommConfig.dcb.BaudRate=CBR_110;
break;
/*200 baud*/
case BAUD200:
TTY_WARNING("Win_QextSerialPort: Windows does not support 200 baud operation. Switching to 110 baud.");
Win_CommConfig.dcb.BaudRate=CBR_110;
break;
/*300 baud*/
case BAUD300:
Win_CommConfig.dcb.BaudRate=CBR_300;
break;
/*600 baud*/
case BAUD600:
Win_CommConfig.dcb.BaudRate=CBR_600;
break;
/*1200 baud*/
case BAUD1200:
Win_CommConfig.dcb.BaudRate=CBR_1200;
break;
/*1800 baud*/
case BAUD1800:
TTY_WARNING("Win_QextSerialPort: Windows does not support 1800 baud operation. Switching to 1200 baud.");
Win_CommConfig.dcb.BaudRate=CBR_1200;
break;
/*2400 baud*/
case BAUD2400:
Win_CommConfig.dcb.BaudRate=CBR_2400;
break;
/*4800 baud*/
case BAUD4800:
Win_CommConfig.dcb.BaudRate=CBR_4800;
break;
/*9600 baud*/
case BAUD9600:
Win_CommConfig.dcb.BaudRate=CBR_9600;
break;
/*14400 baud*/
case BAUD14400:
TTY_PORTABILITY_WARNING("Win_QextSerialPort Portability Warning: POSIX does not support 14400 baud operation.");
Win_CommConfig.dcb.BaudRate=CBR_14400;
break;
/*19200 baud*/
case BAUD19200:
Win_CommConfig.dcb.BaudRate=CBR_19200;
break;
/*38400 baud*/
case BAUD38400:
Win_CommConfig.dcb.BaudRate=CBR_38400;
break;
/*56000 baud*/
case BAUD56000:
TTY_PORTABILITY_WARNING("Win_QextSerialPort Portability Warning: POSIX does not support 56000 baud operation.");
Win_CommConfig.dcb.BaudRate=CBR_56000;
break;
/*57600 baud*/
case BAUD57600:
Win_CommConfig.dcb.BaudRate=CBR_57600;
break;
/*76800 baud*/
case BAUD76800:
TTY_WARNING("Win_QextSerialPort: Windows does not support 76800 baud operation. Switching to 57600 baud.");
Win_CommConfig.dcb.BaudRate=CBR_57600;
break;
/*115200 baud*/
case BAUD115200:
Win_CommConfig.dcb.BaudRate=CBR_115200;
break;
/*128000 baud*/
case BAUD128000:
TTY_PORTABILITY_WARNING("Win_QextSerialPort Portability Warning: POSIX does not support 128000 baud operation.");
Win_CommConfig.dcb.BaudRate=CBR_128000;
break;
/*256000 baud*/
case BAUD256000:
TTY_PORTABILITY_WARNING("Win_QextSerialPort Portability Warning: POSIX does not support 256000 baud operation.");
Win_CommConfig.dcb.BaudRate=CBR_256000;
break;
}
SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG));
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Win_QextSerialPort::setDtr(bool set)
Sets DTR line to the requested state (high by default). This function will have no effect if
the port associated with the class is not currently open.
*/
void Win_QextSerialPort::setDtr(bool set) {
LOCK_MUTEX();
if (isOpen()) {
if (set) {
EscapeCommFunction(Win_Handle, SETDTR);
}
else {
EscapeCommFunction(Win_Handle, CLRDTR);
}
}
UNLOCK_MUTEX();
}
 
/*!
\fn void Win_QextSerialPort::setRts(bool set)
Sets RTS line to the requested state (high by default). This function will have no effect if
the port associated with the class is not currently open.
*/
void Win_QextSerialPort::setRts(bool set) {
LOCK_MUTEX();
if (isOpen()) {
if (set) {
EscapeCommFunction(Win_Handle, SETRTS);
}
else {
EscapeCommFunction(Win_Handle, CLRRTS);
}
}
UNLOCK_MUTEX();
}
 
/*!
\fn ulong Win_QextSerialPort::lineStatus(void)
returns the line status as stored by the port function. This function will retrieve the states
of the following lines: DCD, CTS, DSR, and RI. On POSIX systems, the following additional lines
can be monitored: DTR, RTS, Secondary TXD, and Secondary RXD. The value returned is an unsigned
long with specific bits indicating which lines are high. The following constants should be used
to examine the states of individual lines:
 
\verbatim
Mask Line
------ ----
LS_CTS CTS
LS_DSR DSR
LS_DCD DCD
LS_RI RI
\endverbatim
 
This function will return 0 if the port associated with the class is not currently open.
*/
ulong Win_QextSerialPort::lineStatus(void) {
unsigned long Status=0, Temp=0;
LOCK_MUTEX();
if (isOpen()) {
GetCommModemStatus(Win_Handle, &Temp);
if (Temp&MS_CTS_ON) {
Status|=LS_CTS;
}
if (Temp&MS_DSR_ON) {
Status|=LS_DSR;
}
if (Temp&MS_RING_ON) {
Status|=LS_RI;
}
if (Temp&MS_RLSD_ON) {
Status|=LS_DCD;
}
}
UNLOCK_MUTEX();
return Status;
}
 
/*!
\fn void Win_QextSerialPort::setTimeout(ulong sec, ulong millisec);
Sets the read and write timeouts for the port to sec seconds and millisec milliseconds.
*/
void Win_QextSerialPort::setTimeout(ulong sec, ulong millisec) {
LOCK_MUTEX();
Settings.Timeout_Sec=sec;
Settings.Timeout_Millisec=millisec;
if(isOpen()) {
Win_CommTimeouts.ReadIntervalTimeout = sec*1000+millisec;
Win_CommTimeouts.ReadTotalTimeoutMultiplier = sec*1000+millisec;
Win_CommTimeouts.ReadTotalTimeoutConstant = 0;
Win_CommTimeouts.WriteTotalTimeoutMultiplier = sec*1000+millisec;
Win_CommTimeouts.WriteTotalTimeoutConstant = 0;
SetCommTimeouts(Win_Handle, &Win_CommTimeouts);
}
UNLOCK_MUTEX();
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_SerialPort/win_qextserialport.h
0,0 → 1,48
#ifndef _WIN_QEXTSERIALPORT_H_
#define _WIN_QEXTSERIALPORT_H_
 
#include "qextserialbase.h"
 
/*if all warning messages are turned off, flag portability warnings to be turned off as well*/
#ifdef _TTY_NOWARN_
#define _TTY_NOWARN_PORT_
#endif
 
#include <windows.h>
 
class Win_QextSerialPort:public QextSerialBase {
public:
Win_QextSerialPort();
Win_QextSerialPort(Win_QextSerialPort const& s);
Win_QextSerialPort(const QString & name);
Win_QextSerialPort(const PortSettings& settings);
Win_QextSerialPort(const QString & name, const PortSettings& settings);
Win_QextSerialPort& operator=(const Win_QextSerialPort& s);
virtual ~Win_QextSerialPort();
virtual bool open(OpenMode mode=0);
virtual void close();
virtual void flush();
virtual qint64 size() const;
virtual void ungetChar(char c);
virtual void setFlowControl(FlowType);
virtual void setParity(ParityType);
virtual void setDataBits(DataBitsType);
virtual void setStopBits(StopBitsType);
virtual void setBaudRate(BaudRateType);
virtual void setDtr(bool set=true);
virtual void setRts(bool set=true);
virtual ulong lineStatus(void);
virtual qint64 bytesAvailable();
virtual void translateError(ulong);
virtual void setTimeout(ulong, ulong);
protected:
HANDLE Win_Handle;
COMMCONFIG Win_CommConfig;
COMMTIMEOUTS Win_CommTimeouts;
virtual qint64 readData(char *data, qint64 maxSize);
virtual qint64 writeData(const char *data, qint64 maxSize);
};
 
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Class_SerialPort.pri
0,0 → 1,21
win32:DEFINES += _TTY_WIN_ WIN32
unix:DEFINES += _TTY_POSIX_
 
DEPENDPATH += ../Global/Class_SerialPort
INCLUDEPATH += ../Global/Class_SerialPort
 
SOURCES += qextserialbase.cpp \
qextserialport.cpp \
ManageSerialPort.cpp
 
win32:SOURCES += win_qextserialport.cpp
 
unix:SOURCES += posix_qextserialport.cpp
 
HEADERS += qextserialbase.h \
qextserialport.h \
ManageSerialPort.h
 
win32:HEADERS += win_qextserialport.h
 
unix:HEADERS += posix_qextserialport.h
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Global.h
0,0 → 1,51
/***************************************************************************
* 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 GLOBAL_H
#define GLOBAL_H
 
#include <QString>
 
#ifdef Q_OS_LINUX
static const QString QA_OS = "Linux";
#else
#ifdef Q_OS_DARWIN
static const QString QA_OS = "OSX";
#else
#ifdef Q_OS_WIN32
static const QString QA_OS = "Windows";
#else
static const QString QA_OS = "n/a";
#endif
#endif
#endif
 
static const QString QA_AUTHOR = "Manuel Schrape";
static const QString QA_EMAIL = "manuel.schrape@gmx.de";
 
struct s_Directorys
{
QString MainData;
QString MapCache;
QString WPRoutes;
QString Flights;
QString MapPics;
QString Settings;
QString Logs;
};
#endif // GLOBAL_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Connection-NO.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Connection-OK.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Debug.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Exit.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/LED_Green.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/LED_Off.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/LED_Red.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/LED_Yellow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Load-Map.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Load.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Log-Record.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Log-Stop.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Plotter-NO.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Plotter-OK.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Preferences-Data.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Read.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Save.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Terminal.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Actions/Write.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Arrows/Down-1.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Arrows/Down-2.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Arrows/Left-1.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Arrows/Left-2.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Arrows/Right-1.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Arrows/Right-2.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Arrows/Up-1.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Arrows/Up-2.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Flags/Target.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Flags/flag-black.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Flags/flag-blue.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Flags/flag-green.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Flags/flag-red.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Flags/flag-yellow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Communicator.icns
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Communicator.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Logger.icns
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Logger.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Maps.icns
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Maps.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Scope.icns
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Scope.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Settings.icns
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Settings.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Voice.icns
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Images/Icons/QMK-Voice.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Kopter.h
0,0 → 1,49
/***************************************************************************
* 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 KOPTER_H
#define KOPTER_H
 
#include <QString>
 
#include <stdint.h>
 
#ifdef _BETA_
static const QString QA_HWVERSION = "FlightCtrl v0.80g & NaviCtrl v0.20c";
#else
static const QString QA_HWVERSION = "FlightCtrl v0.80g & NaviCtrl v0.20c";
#endif
 
// Datenfeld-ID's
static const int DATA_VERSION = 1;
static const int DATA_READ_SETTINGS = 2;
static const int DATA_WRITE_SETTINGS = 3;
static const int DATA_READ_MIXER = 4;
static const int DATA_WRITE_MIXER = 5;
static const int DATA_READ_LABEL = 6;
static const int DATA_WRITE_WAYPOINT = 7;
 
//static const
 
static const QString HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"};
 
static const int MAX_DebugData = 32;
 
static const QString DEF_DebugNames[] = {"Integral Nick", "Integral Roll", "ACC Nick", "ACC Roll", "Gyro Gier", "Hoehen-Wert", "ACC Z", "GAS", "Kompass-Value", "Spannung", "Empfang", "Ersatzkompass", "Motor Vorne", "Motor Hinten", "Motor Links", "Motor Rechts", "Analog 16", "Distance", "OSD-Bar", "MK3Mag", "Servo", "Nick", "Roll", "Analog 23", "Analog 24", "Analog 25", "Analog 26", "Kalman Max", "Analog 28", "Kalman K", "GPS Nick", "GPS Roll"};
 
#endif // KOPTER_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/License.head
0,0 → 1,18
/***************************************************************************
* 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. *
***************************************************************************/
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/MK_Datatypes.h
0,0 → 1,333
/***************************************************************************
* 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 MK_DATATYPES_H
#define MK_DATATYPES_H
 
#include <stdint.h>
 
#ifdef _BETA_
static const int MK_VERSION_SETTINGS = 84; // wird angepasst, wenn sich die EEPROM-Daten ge�ndert haben
#else
static const int MK_VERSION_SETTINGS = 84; // wird angepasst, wenn sich die EEPROM-Daten ge�ndert haben
#endif
 
static const int MK_VERSION_NAVI = 4; // wird angepasst, wenn sich die Navi-Daten ge�ndert haben
 
static const int MK_VERSION_MIXER = 1; // wird angepasst, wenn sich die Mixer-Daten ge�ndert haben
static const int MK_MAX_MOTOR = 16; // Maximale Anzahl der Motoren im Mixer
 
// Version des Seriellen Protokoll
static const int VERSION_SERIAL_MAJOR = 11;
static const int VERSION_SERIAL_MINOR = 0;
 
// Basis-Addressen der verschiedenen Hardware
static const int ADDRESS_ALL = 0;
static const int ADDRESS_FC = 1;
static const int ADDRESS_NC = 2;
static const int ADDRESS_MK3MAG = 3;
static const int ADDRESS_BLC = 5;
 
#define FCFLAG_MOTOR_RUN 0x01
#define FCFLAG_FLY 0x02
#define FCFLAG_CALIBRATE 0x04
#define FCFLAG_START 0x08
#define FCFLAG_NOTLANDUNG 0x10
#define FCFLAG_LOWBAT 0x20
#define FCFLAG_SPI_RX_ERR 0x40
#define FCFLAG_I2CERR 0x80
 
#define DEFEKT_G_NICK 0x01
#define DEFEKT_G_ROLL 0x02
#define DEFEKT_G_GIER 0x04
#define DEFEKT_A_NICK 0x08
#define DEFEKT_A_ROLL 0x10
#define DEFEKT_A_Z 0x20
#define DEFEKT_PRESSURE 0x40
#define DEFEKT_CAREFREE_ERR 0x80
 
#define DEFEKT_I2C 0x01
#define DEFEKT_BL_MISSING 0x02
#define DEFEKT_SPI_RX_ERR 0x04
#define DEFEKT_PPM_ERR 0x08
#define DEFEKT_MIXER_ERR 0x10
 
#define CFG_HOEHENREGELUNG 0x01
#define CFG_HOEHEN_SCHALTER 0x02
#define CFG_HEADING_HOLD 0x04
#define CFG_KOMPASS_AKTIV 0x08
#define CFG_KOMPASS_FIX 0x10
#define CFG_GPS_AKTIV 0x20
#define CFG_ACHSENKOPPLUNG_AKTIV 0x40
#define CFG_DREHRATEN_BEGRENZER 0x80
 
#define CFG_LOOP_OBEN 0x01
#define CFG_LOOP_UNTEN 0x02
#define CFG_LOOP_LINKS 0x04
#define CFG_LOOP_RECHTS 0x08
#define CFG_MOTOR_BLINK 0x10
#define CFG_MOTOR_OFF_LED1 0x20
#define CFG_MOTOR_OFF_LED2 0x40
#define CFG_RES4 0x80
 
#define CFG2_HEIGHT_LIMIT 0x01
#define CFG2_VARIO_BEEP 0x02
#define CFG_SENSITIVE_RC 0x04
 
#define CFG0_AIRPRESS_SENSOR 0x01
#define CFG0_HEIGHT_SWITCH 0x02
#define CFG0_HEADING_HOLD 0x04
#define CFG0_COMPASS_ACTIVE 0x08
#define CFG0_COMPASS_FIX 0x10
#define CFG0_GPS_ACTIVE 0x20
#define CFG0_AXIS_COUPLING_ACTIVE 0x40
#define CFG0_ROTARY_RATE_LIMITER 0x80
 
// defines for the receiver selection
#define RECEIVER_PPM 0
#define RECEIVER_SPEKTRUM 1
#define RECEIVER_SPEKTRUM_HI_RES 2
#define RECEIVER_SPEKTRUM_LOW_RES 3
#define RECEIVER_JETI 4
#define RECEIVER_ACT_DSL 5
#define RECEIVER_UNKNOWN 0xFF
 
struct s_MK_VersionInfo
{
unsigned char SWMajor;
unsigned char SWMinor;
unsigned char ProtoMajor;
unsigned char ProtoMinor;
unsigned char SWPatch;
unsigned char HardwareError[5];
};
 
struct s_MK_Debug
{
unsigned char Digital[2];
int16_t Analog[32]; // Debugwerte
};
 
struct s_MK_DebugLabels
{
int Position;
QString Text;
};
 
//typedef int16_t s_MK_PPM_Data[26];
 
struct s_MK_PPM_Data
{
int16_t Data[26];
};
 
 
struct s_MK_Settings
{
// Die ersten beiden Bytes nicht an den MK senden.
unsigned char Index;
unsigned char Revision;
unsigned char Kanalbelegung[12]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
unsigned char GlobalConfig; // 0x01=H�henregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
unsigned char Hoehe_MinGas; // Wert : 0-100
unsigned char Luftdruck_D; // Wert : 0-250
unsigned char MaxHoehe; // Wert : 0-32
unsigned char Hoehe_P; // Wert : 0-32
unsigned char Hoehe_Verstaerkung; // Wert : 0-50
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250
unsigned char Hoehe_HoverBand; // Wert : 0-250
unsigned char Hoehe_GPS_Z; // Wert : 0-250
unsigned char Hoehe_StickNeutralPoint;// Wert : 0-250
unsigned char Stick_P; // Wert : 1-6
unsigned char Stick_D; // Wert : 0-64
unsigned char Gier_P; // Wert : 1-20
unsigned char Gas_Min; // Wert : 0-32
unsigned char Gas_Max; // Wert : 33-250
unsigned char GyroAccFaktor; // Wert : 1-64
unsigned char KompassWirkung; // Wert : 0-32
unsigned char Gyro_P; // Wert : 10-250
unsigned char Gyro_I; // Wert : 0-250
unsigned char Gyro_D; // Wert : 0-250
unsigned char Gyro_Gier_P; // Wert : 10-250
unsigned char Gyro_Gier_I; // Wert : 0-250
unsigned char Gyro_Stability; // 0.80 Wert : 0-16
unsigned char UnterspannungsWarnung; // Wert : 0-250
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Emp�ngsverlust
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
unsigned char Receiver; // 0= Summensignal, 1= Spektrum, 2 =Jeti, 3=ACT DSL, 4=ACT S3D
unsigned char I_Faktor; // Wert : 0-250
unsigned char UserParam1; // Wert : 0-250
unsigned char UserParam2; // Wert : 0-250
unsigned char UserParam3; // Wert : 0-250
unsigned char UserParam4; // Wert : 0-250
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag
unsigned char ServoRollControl; // 0.75 Wert : 0-250 // Stellung des Servos
unsigned char ServoRollComp; // 0.75 Wert : 0-250
unsigned char ServoRollMin; // 0.75 Wert : 0-250
unsigned char ServoRollMax; // 0.75 Wert : 0-250
unsigned char ServoNickRefresh; // Speed of the Servo
unsigned char Servo3; // Value or mapping of the Servo Output
unsigned char Servo4; // Value or mapping of the Servo Output
unsigned char Servo5; // Value or mapping of the Servo Output
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas w�hrend Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle f�r Stickausschlag
unsigned char LoopHysterese; // Wert: 0-250 Hysterese f�r Stickausschlag
unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung)
unsigned char AchsKopplung2; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden
unsigned char CouplingYawCorrection; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden
unsigned char WinkelUmschlagNick; // Wert: 0-250 180�-Punkt
unsigned char WinkelUmschlagRoll; // Wert: 0-250 180�-Punkt
unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung)
unsigned char Driftkomp; //
unsigned char DynamicStability; //
unsigned char UserParam5; // Wert : 0-250
unsigned char UserParam6; // Wert : 0-250
unsigned char UserParam7; // Wert : 0-250
unsigned char UserParam8; // Wert : 0-250
//---Output ---------------------------------------------
unsigned char J16Bitmask; // for the J16 Output
unsigned char J16Timing; // for the J16 Output
unsigned char J17Bitmask; // for the J17 Output
unsigned char J17Timing; // for the J17 Output
unsigned char WARN_J16_Bitmask; // 0.75 for the J16 Output
unsigned char WARN_J17_Bitmask; // 0.75 for the J17 Output
//---NaviCtrl---------------------------------------------
unsigned char NaviGpsModeControl; // Parameters for the Naviboard
unsigned char NaviGpsGain;
unsigned char NaviGpsP;
unsigned char NaviGpsI;
unsigned char NaviGpsD;
unsigned char NaviGpsPLimit;
unsigned char NaviGpsILimit;
unsigned char NaviGpsDLimit;
unsigned char NaviGpsACC;
unsigned char NaviGpsMinSat;
unsigned char NaviStickThreshold;
unsigned char NaviWindCorrection;
unsigned char NaviSpeedCompensation;
unsigned char NaviOperatingRadius;
unsigned char NaviAngleLimitation;
unsigned char NaviPH_LoginTime;
//---Ext.Ctrl---------------------------------------------
unsigned char ExternalControl; // for serial Control
//---CareFree---------------------------------------------
unsigned char OrientationAngle; // 0.80 Where is the front-direction?
unsigned char OrientationModeControl; // 0.80 switch for CareFree
//--------------------------------------------------------
unsigned char BitConfig; // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoCompInvert; // // 0x01 = Nick, 0x02 = Roll 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char ExtraConfig; // bitcodiert
char Name[12];
unsigned char crc;
 
};
 
struct s_MK_Mixer
{
uint8_t Revision;
char Name[12];
int8_t Motor[16][4];
uint8_t crc;
};
 
///////////////
// Navi-Ctrl //
///////////////
 
#define INVALID 0x00
#define NEWDATA 0x01
#define PROCESSED 0x02
 
#define NC_FLAG_FREE 0x01
#define NC_FLAG_PH 0x02
#define NC_FLAG_CH 0x04
#define NC_FLAG_RANGE_LIMIT 0x08
#define NC_FLAG_NOSERIALLINK 0x10
#define NC_FLAG_TARGET_REACHED 0x20
#define NC_FLAG_MANUAL_CONTROL 0x40
#define NC_FLAG_8 0x80
 
#define POINT_TYPE_WP 0
#define POINT_TYPE_POI 1
 
typedef struct
{
int32_t Longitude; // in 1E-7 deg
int32_t Latitude; // in 1E-7 deg
int32_t Altitude; // in mm
uint8_t Status; // validity of data
} __attribute__((packed)) GPS_Pos_t;
 
typedef struct
{
uint16_t Distance; // distance to target in dm
int16_t Bearing; // course to target in deg
} __attribute__((packed)) GPS_PosDev_t;
 
typedef struct
{
uint8_t Version; // version of the data structure
GPS_Pos_t CurrentPosition; // see ubx.h for details
GPS_Pos_t TargetPosition;
GPS_PosDev_t TargetPositionDeviation;
GPS_Pos_t HomePosition;
GPS_PosDev_t HomePositionDeviation;
uint8_t WaypointIndex; // index of current waypoints running from 0 to WaypointNumber-1
uint8_t WaypointNumber; // number of stored waypoints
uint8_t SatsInUse; // number of satellites used for position solution
int16_t Altimeter; // hight according to air pressure
int16_t Variometer; // climb(+) and sink(-) rate
uint16_t FlyingTime; // in seconds
uint8_t UBat; // Battery Voltage in 0.1 Volts
uint16_t GroundSpeed; // speed over ground in cm/s (2D)
int16_t Heading; // current flight direction in ° as angle to north
int16_t CompassHeading; // current compass value in °
int8_t AngleNick; // current Nick angle in 1°
int8_t AngleRoll; // current Rick angle in 1°
uint8_t RC_Quality; // RC_Quality
uint8_t FCFlags; // Flags from FC
uint8_t NCFlags; // Flags from NC
uint8_t Errorcode; // 0 --> okay
uint8_t OperatingRadius; // current operation radius around the Home Position in m
int16_t TopSpeed; // velocity in vertical direction in cm/s
uint8_t TargetHoldTime; // time in s to stay at the given target, counts down to 0 if target has been reached
uint8_t RC_RSSI; // Receiver signal strength (since version 2 added)
int16_t SetpointAltitude; // setpoint for altitude
uint8_t Gas; // for future use
uint16_t Current; // actual current in 0.1A steps
uint16_t UsedCapacity; // used capacity in mAh
 
} __attribute__((packed)) s_MK_NaviData;
 
typedef struct
{
GPS_Pos_t Position; // the gps position of the waypoint, see ubx.h for details
int16_t Heading; // orientation, future implementation
uint8_t ToleranceRadius; // in meters, if the MK is within that range around the target, then the next target is triggered
uint8_t HoldTime; // in seconds, if the was once in the tolerance area around a WP, this time defies the delay before the next WP is triggered
uint8_t Event_Flag; // future emplementation
uint8_t Index; // to indentify different waypoints, workaround for bad communications PC <-> NC
uint8_t Type; // type of Waypoint
uint8_t reserve[11]; // reserve
} __attribute__((packed)) s_MK_WayPoint;
 
#endif // MK_DATATYPES_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Widget_Connection/wgt_Connection.cpp
0,0 → 1,542
/***************************************************************************
* 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. *
***************************************************************************/
 
#include <QSettings>
#include <QMessageBox>
#include <QCryptographicHash>
 
#include "wgt_Connection.h"
 
wgt_Connection::wgt_Connection(QWidget *parent) : QWidget(parent)
{
setupUi(this);
 
o_Input = new Input();
 
o_AboTimer = new QTimer();
o_AboTimer->setInterval(3500);
 
connect(btn_Connect, SIGNAL(clicked()), this, SLOT(slot_btn_Connect()));
connect(sb_Intervall, SIGNAL(valueChanged(int)), this, SLOT(slot_sb_Intervall(int)));
 
connect(o_AboTimer, SIGNAL(timeout()), this, SLOT(slot_TimeOut_AboTimer()));
}
 
void wgt_Connection::read_Settings()
{
QSettings Setting("QMK", "QMK-Connection");
 
Setting.beginGroup("DATA");
SERVER.Intervall = Setting.value(QString("Intervall_%1").arg(gi_ID), 500).toInt();
Setting.endGroup();
 
Setting.beginGroup("SERVER");
SERVER.Password = Setting.value("Password", QString("")).toString();
SERVER.IP_MAX = Setting.value("IP_MAX", 1).toInt();
SERVER.IP_ID = Setting.value("IP_ID", 0).toInt();
 
for (int z = 0; z < SERVER.IP_MAX; z++)
{
SERVER.IP[z] = Setting.value("IP_" + QString("%1").arg(z), QString("127.0.0.1:64400")).toString();
}
Setting.endGroup();
 
for(int z = 0; z < SERVER.IP_MAX; z++)
{
if (cb_Server->findText(SERVER.IP[z]) == -1)
{
cb_Server->addItem(SERVER.IP[z]);
}
}
 
cb_Server->setCurrentIndex(SERVER.IP_ID);
 
le_Password->setText(SERVER.Password);
 
sb_Intervall->setValue(SERVER.Intervall);
 
}
 
void wgt_Connection::write_Settings()
{
SERVER.Intervall = sb_Intervall->value();
 
SERVER.Password = le_Password->text();
SERVER.IP_MAX = cb_Server->count();
SERVER.IP_ID = cb_Server->currentIndex();
 
for (int z = 0; z < cb_Server->count(); z++)
{
if (z < 10)
{
SERVER.IP[z] = cb_Server->itemText(z);
}
}
 
QSettings Setting("QMK", "QMK-Connection");
 
Setting.beginGroup("DATA");
Setting.setValue(QString("Intervall_%1").arg(gi_ID), SERVER.Intervall);
Setting.endGroup();
 
Setting.beginGroup("SERVER");
Setting.setValue("Password", SERVER.Password);
Setting.setValue("IP_MAX", SERVER.IP_MAX);
Setting.setValue("IP_ID", SERVER.IP_ID);
 
for (int z = 0; z < SERVER.IP_MAX; z++)
{
Setting.setValue("IP_" + QString("%1").arg(z), SERVER.IP[z]);
}
Setting.endGroup();
}
 
void wgt_Connection::set_Client(int li_ID, QString ls_Client, QString ls_Fields)
{
gi_Interval[0] = false;
gi_Interval[1] = false;
 
gs_Client = ls_Client;
gs_Fields = ls_Fields;
gi_ID = li_ID;
 
if (ls_Fields.contains('D'))
gi_Interval[0] = true;
 
if (ls_Fields.contains('O'))
gi_Interval[1] = true;
 
read_Settings();
}
 
void wgt_Connection::set_SelectVisible(bool pi_Visible)
{
wg_Select->setVisible(pi_Visible);
}
 
void wgt_Connection::set_IntervalVisible(bool pi_Visible)
{
wg_Interval->setVisible(pi_Visible);
}
 
void wgt_Connection::set_ButtonVisible(bool pi_Visible)
{
btn_Connect->setVisible(pi_Visible);
}
 
void wgt_Connection::send_Data(QString ps_Data, int pi_ID)
{
// qDebug(ps_Data.toLatin1().data());
o_Input->send_Data(ps_Data, pi_ID);
}
 
// MK-Eingangsdaten verarbeiten
void wgt_Connection::parse_MK_Data(QString t_Data)
{
unsigned char OutData[200];
char *InData = t_Data.toLatin1().data();
 
if (HandlerMK::Decode_64(InData, t_Data.length(), OutData) != 0)
{
 
switch(InData[2])
{
case 'A' : // Analog-Labels
{
o_Input->stop_Resend(DATA_READ_LABEL);
 
s_MK_DebugLabels MK_DebugLabels;
 
MK_DebugLabels.Position = OutData[0];
 
if (MK_DebugLabels.Position < 32)
{
MK_DebugLabels.Text = HandlerMK::Data2QString(OutData,1,17).trimmed();
if (MK_DebugLabels.Text == "")
{
MK_DebugLabels.Text = "Debug-" + QString("%1").arg(MK_DebugLabels.Position);
}
 
if (((MK_DebugLabels.Position + 1) < 32))// && (get_Analoglabels == true))
{
c_Data[0] = MK_DebugLabels.Position + 1;
o_Input->send_Data(HandlerMK::make_Frame('a', ADDRESS_ALL, c_Data, 1).toLatin1().data(), DATA_READ_LABEL);
}
 
emit(sig_MK_DebugLabels(MK_DebugLabels));
}
}
break;
case 'D' : // Debug-Daten
{
s_MK_Debug MK_Debug;
 
memcpy((unsigned char *)&MK_Debug, (unsigned char *)&OutData, sizeof(MK_Debug));
 
emit(sig_MK_Debug(MK_Debug));
emit(sig_RawData(t_Data));
}
break;
case 'N' : // MotorMixer lesen
{
o_Input->stop_Resend(DATA_READ_MIXER);
 
s_MK_Mixer MK_Mixer;
 
memcpy((unsigned char *)&MK_Mixer, (unsigned char *)&OutData, sizeof(MK_Mixer));
 
emit (sig_MK_ReadMotorMixer(MK_Mixer));
}
break;
case 'M' : // MotorMixer geschrieben
{
o_Input->stop_Resend(DATA_WRITE_MIXER);
 
emit (sig_MK_WriteMotorMixer(OutData[0]));
}
break;
 
case 'O' : // Navi-OSD-Data
{
if (InData[1] - 'a' == ADDRESS_NC)
{
s_MK_NaviData MK_NaviData;
 
memcpy((unsigned char *)&MK_NaviData, (unsigned char *)&OutData, sizeof(MK_NaviData));
if (MK_NaviData.Version == MK_VERSION_NAVI)
{
emit(sig_MK_NaviData(MK_NaviData));
emit(sig_RawData(t_Data));
}
}
}
break;
 
case 'P' : // RC-Kanäle
{
s_MK_PPM_Data PPM_in;
 
memcpy((unsigned char *)&PPM_in, (unsigned char *)&OutData, sizeof(PPM_in));
 
// qDebug() << PPM_in[0] << ", " << PPM_in[1] << ", " << PPM_in[2] << ", " << PPM_in[3];
 
emit(sig_MK_PPMData(PPM_in));
}
break;
 
case 'Q' : // Settings lesen
{
o_Input->stop_Resend(DATA_READ_SETTINGS);
 
s_MK_Settings MK_Set;
 
memcpy((unsigned char *)&MK_Set, (unsigned char *)&OutData, sizeof(MK_Set));
 
emit (sig_MK_ReadSettings(MK_Set));
}
break;
case 'S' : // Settings geschrieben
{
o_Input->stop_Resend(DATA_WRITE_SETTINGS);
 
emit (sig_MK_WriteSettings(OutData[0]));
}
break;
 
case 'V' : // Versions-Info
{
o_Input->stop_Resend(DATA_VERSION);
VersionInfo = HandlerMK::parse_Version(OutData, InData[1] - 'a');
 
if (VersionInfo.ID == ADDRESS_FC)
{
rb_FC->setChecked(true);
}
if (VersionInfo.ID == ADDRESS_NC)
{
rb_NC->setChecked(true);
}
if (VersionInfo.ID == ADDRESS_MK3MAG)
{
rb_MK3MAG->setChecked(true);
}
 
slot_sb_Intervall(sb_Intervall->value());
 
emit sig_MK_Version(VersionInfo);
}
break;
case 'W' : // WayPoints
{
o_Input->stop_Resend(DATA_WRITE_WAYPOINT);
 
emit(sig_MK_WayPoint(OutData[0]));
}
break;
}
}
}
 
// IP-Daten verarbeiten..
void wgt_Connection::parse_IP_Data(QString t_Data)
{
QStringList Data;
Data = t_Data.split(":");
 
if (Data.count() > 1)
{
int CMD = Data[2].toInt();
 
switch(CMD)
{
case 101 :
{
o_Input->send_Data(HandlerIP::make_Frame(gi_ID, 101, gs_Client));
}
break;
case 502 :
{
switch (Data[3].toInt())
{
case 105 :
{
QString s_MD5PW;
QByteArray a_MD5PW;
 
a_MD5PW = QCryptographicHash::hash(le_Password->text().toAscii(),QCryptographicHash::Md5);
 
s_MD5PW = QString(a_MD5PW.toHex().data());
 
o_Input->send_Data(HandlerIP::make_Frame(gi_ID, 105, s_MD5PW));
}
break;
case 106 :
{
o_Input->send_Data(HandlerIP::make_Frame(gi_ID, 106, gs_Fields));
}
break;
}
}
break;
case 505 :
{
if (Data[3] == "OK")
{
}
else
{
QMessageBox::warning(this, gs_Client, trUtf8("Authentifizierung fehlgeschlagen. <br />Daten senden zum Mikrokopter nicht möglich."), QMessageBox::Ok);
}
}
break;
}
}
}
 
// Datenintervall geändert.
void wgt_Connection::slot_sb_Intervall(int t_Intervall)
{
if (t_Intervall == 0)
{
c_Data[0] = 0;
}
else
{
c_Data[0] = t_Intervall / 10;
}
 
// if (wg_Interval->isVisible())
{
if (gi_Interval[0])
{
o_Input->send_Data(HandlerMK::make_Frame('d', ADDRESS_ALL, c_Data, 1).toLatin1().data());
}
 
if (gi_Interval[1])
{
o_Input->send_Data(HandlerMK::make_Frame('o', ADDRESS_ALL, c_Data, 1).toLatin1().data());
}
}
}
 
void wgt_Connection::slot_send_Data(QString ps_Data, int pi_ID)
{
send_Data(ps_Data, pi_ID);
}
 
void wgt_Connection::slot_TimeOut_AboTimer()
{
// qDebug("Timer");
slot_sb_Intervall(sb_Intervall->value());
}
 
void wgt_Connection::slot_btn_Connect()
{
if (!o_Input->IsOpen())
{
if (cb_Server->findText(cb_Server->currentText()) == -1)
{
cb_Server->addItem(cb_Server->currentText());
cb_Server->setCurrentIndex(cb_Server->findText(cb_Server->currentText()));
}
 
cb_Server->setEnabled(false);
le_Password->setEnabled(false);
 
if (cb_Server->currentText().startsWith('/'))
{
o_Input = new Input_TTY();
o_Input->Init();
 
set_Input s_Input;
s_Input.Main = cb_Server->currentText();
 
if (o_Input->Open(s_Input) == true)
{
emit sig_Status(true);
btn_Connect->setChecked(true);
o_AboTimer->start();
 
connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString)));
 
o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION);
}
else
{
cb_Server->setEnabled(true);
le_Password->setEnabled(true);
}
 
}
else
{
o_Input = new Input_TCP();
o_Input->Init();
 
set_Input s_Input;
 
QStringList Server = cb_Server->currentText().split(":");
 
s_Input.Main = Server[0];
s_Input.Sub = Server[1];
 
if (o_Input->Open(s_Input) == true)
{
connect(o_Input, SIGNAL(sig_Disconnected(int)), this, SLOT(slot_Input_Disconnected(int)));
connect(o_Input, SIGNAL(sig_Connected()), this, SLOT(slot_Input_Connected()));
}
}
}
else
{
cb_Server->setEnabled(true);
le_Password->setEnabled(true);
 
emit sig_Status(false);
btn_Connect->setChecked(false);
o_AboTimer->stop();
 
o_Input->Close();
disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0);
if (o_Input->Mode() == TCP)
{
disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0);
disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0);
}
}
}
 
// Neue Daten empfangen.
void wgt_Connection::slot_Input_Data(QString t_Data)
{
if ((t_Data[0] == '#'))
{
if ((HandlerMK::Check_CRC(t_Data.toLatin1().data(), t_Data.length() - 1)) || ((o_Input->Mode() == TTY) && (HandlerMK::Check_CRC(t_Data.toLatin1().data(), t_Data.length()))))
{
parse_MK_Data(t_Data);
}
else
{
// qDebug(QString("CRC-Error - " + t_Data).toLatin1().data());
}
}
else if ((o_Input->Mode() == TCP) && (t_Data[0] == '$'))
{
parse_IP_Data(t_Data);
}
}
 
// Neue Serververbindung.
void wgt_Connection::slot_Input_Connected()
{
connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString)));
 
o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION);
emit sig_Status(true);
btn_Connect->setChecked(true);
o_AboTimer->start();
}
 
// Serververbindung beendet
void wgt_Connection::slot_Input_Disconnected(int Error)
{
cb_Server->setEnabled(true);
le_Password->setEnabled(true);
 
disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0);
disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0);
disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0);
 
emit sig_Status(false);
btn_Connect->setChecked(false);
o_AboTimer->stop();
 
switch (Error)
{
case REMOTECLOSED :
{
// lb_Status->setText(tr("Verbindung vom Server beendet."));
QMessageBox::warning(this, gs_Client,tr("QMK-Datenserver: Verbindung wurde vom Server beendet."), QMessageBox::Ok);
}
break;
case REFUSED :
{
// lb_Status->setText(tr("Server nicht gefunden."));
QMessageBox::warning(this, gs_Client,tr("QMK-Datenserver: Kann nicht zum Server verbinden."), QMessageBox::Ok);
}
break;
case 3 :
{
// lb_Status->setText(tr("Serververbindung getrennt. Logindaten falsch."));
QMessageBox::warning(this, gs_Client,tr("QMK-Datenserver: Loginname oder Password falsch."), QMessageBox::Ok);
}
break;
default :
{
// lb_Status->setText(tr("Getrennt vom QMK-Datenserver."));
}
break;
}
 
}
 
wgt_Connection::~wgt_Connection()
{
write_Settings();
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Widget_Connection/wgt_Connection.h
0,0 → 1,114
/***************************************************************************
* 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 WGT_CONNECTION_H
#define WGT_CONNECTION_H
 
#include <QWidget>
#include <QTimer>
 
#include "ui_wgt_Connection.h"
 
#include "../../Global/Kopter.h"
#include "../../Global/Class_HandlerIP/HandlerIP.h"
#include "../../Global/Class_HandlerMK/HandlerMK.h"
#include "../../Global/Class_Input/Input.h"
#include "../../Global/Class_Input/Input_TCP.h"
#include "../../Global/Class_Input/Input_TTY.h"
 
struct set_SERVER
{
int IP_MAX;
int IP_ID;
int Intervall;
QString IP[10];
QString Password;
};
 
class wgt_Connection : public QWidget, public Ui::wgt_Connection_ui
{
Q_OBJECT
 
public:
wgt_Connection(QWidget *parent = 0);
~wgt_Connection();
 
void send_Data(QString ps_Data, int pi_ID = 0);
 
void set_Client(int li_ID, QString ls_Client, QString ls_Fields);
void set_ButtonVisible(bool pi_Visible);
void set_SelectVisible(bool pi_Visible);
void set_IntervalVisible(bool pi_Visible);
Input *o_Input;
 
private:
 
QTimer *o_AboTimer;
 
// Verbindungs-Objekt
char c_Data[200];
 
bool gi_Interval[2];
 
// Info über die Hardware
s_Hardware VersionInfo;
 
 
QString gs_Client;
QString gs_Fields;
// char gs_Interval;
int gi_ID;
 
set_SERVER SERVER;
 
void read_Settings();
void write_Settings();
 
void parse_IP_Data(QString t_Data);
void parse_MK_Data(QString t_Data);
 
public slots:
void slot_btn_Connect();
void slot_send_Data(QString ps_Data, int pi_ID = 0);
 
private slots:
void slot_sb_Intervall(int t_Intervall);
 
void slot_Input_Data(QString t_Data);
void slot_Input_Connected();
void slot_Input_Disconnected(int Error);
 
void slot_TimeOut_AboTimer();
 
signals:
void sig_Status(int);
void sig_RawData(QString);
void sig_MK_Version(s_Hardware);
void sig_MK_Debug(s_MK_Debug);
void sig_MK_DebugLabels(s_MK_DebugLabels);
void sig_MK_NaviData(s_MK_NaviData);
void sig_MK_WayPoint(int);
void sig_MK_ReadSettings(s_MK_Settings);
void sig_MK_WriteSettings(int);
void sig_MK_ReadMotorMixer(s_MK_Mixer);
void sig_MK_WriteMotorMixer(int);
void sig_MK_PPMData(s_MK_PPM_Data);
 
};
 
#endif // WGT_CONNECTION_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Widget_Connection/wgt_Connection.ui
0,0 → 1,208
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>wgt_Connection_ui</class>
<widget class="QWidget" name="wgt_Connection_ui">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>765</width>
<height>39</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QToolButton" name="btn_Connect">
<property name="text">
<string>Verbinden</string>
</property>
<property name="icon">
<iconset resource="../../QMK-Scope/QMK-Scope.qrc">
<normaloff>:/Actions/Global/Images/Actions/Connection-NO.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Connection-OK.png</normalon>:/Actions/Global/Images/Actions/Connection-NO.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Server:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="cb_Server">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>127.0.0.1:64400</string>
</property>
</item>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLineEdit" name="le_Password">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QWidget" name="wg_Select" native="true">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="rb_FC">
<property name="text">
<string>FC</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="rb_NC">
<property name="text">
<string>NC</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QRadioButton" name="rb_MK3MAG">
<property name="text">
<string>MK3MAG</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="6">
<widget class="QWidget" name="wg_Interval" native="true">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Intervall:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="sb_Intervall">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="suffix">
<string> ms</string>
</property>
<property name="maximum">
<number>5000</number>
</property>
<property name="singleStep">
<number>50</number>
</property>
<property name="value">
<number>500</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="7">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>35</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../../QMK-Scope/QMK-Scope.qrc"/>
</resources>
<connections/>
</ui>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/Global/Widget_Connection.pri
0,0 → 1,22
DEPENDPATH += ../Global/Widget_Connection/
INCLUDEPATH += ../Global/Widget_Connection/
 
include(../Global/Class_SerialPort.pri)
 
SOURCES += wgt_Connection.cpp \
../Global/Class_HandlerMK/HandlerMK.cpp \
../Global/Class_HandlerIP/HandlerIP.cpp \
../Global/Class_Input/Input.cpp \
../Global/Class_Input/Input_TCP.cpp \
../Global/Class_Input/Input_TTY.cpp
 
HEADERS += wgt_Connection.h \
../Global/Kopter.h \
../Global/MK_Datatypes.h \
../Global/Class_HandlerMK/HandlerMK.h \
../Global/Class_HandlerIP/HandlerIP.h \
../Global/Class_Input/Input.h \
../Global/Class_Input/Input_TCP.h \
../Global/Class_Input/Input_TTY.h
 
FORMS += wgt_Connection.ui
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Classes/cSettings.cpp
0,0 → 1,146
/***************************************************************************
* 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. *
***************************************************************************/
#include <QSettings>
#include <QDir>
 
#include "cSettings.h"
 
cSettings::cSettings()
{
Settings_ID = 1;
 
read_Settings();
}
 
void cSettings::read_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Settings_ID = Setting.value("Settings ID", Settings_ID).toInt();
Setting.endGroup();
 
Setting.beginGroup("SERVER");
SERVER.TCP_PORT = Setting.value("TCP-PORT", DEV_IP_PORT).toInt();
SERVER.UDP_PORT = Setting.value("UDP-PORT", DEV_IP_PORT).toInt();
SERVER.Password = Setting.value("Password", QString("")).toString();
Setting.endGroup();
 
Setting.beginGroup("LIVEDATA");
LIVEDATA.Server = Setting.value("Server", QString("")).toString();
LIVEDATA.Port = Setting.value("Port", QString("64410")).toString();
LIVEDATA.User = Setting.value("User", QString("")).toString();
LIVEDATA.Password = Setting.value("Password", QString("")).toString();
Setting.endGroup();
 
Setting.beginGroup("CLIENT");
CLIENT.TTY_MAX = Setting.value("TTY_MAX", 1).toInt();
CLIENT.TTY_ID = Setting.value("TTY_ID", 0).toInt();
 
for (int z = 0; z < CLIENT.TTY_MAX; z++)
{
#ifdef WIN32
CLIENT.TTY_DEVICES[z] = Setting.value("TTY_DEVICE_" + QString("%1").arg(z), QString("COM1")).toString();
#else
CLIENT.TTY_DEVICES[z] = Setting.value("TTY_DEVICE_" + QString("%1").arg(z), QString("/dev/ttyS3")).toString();
#endif
}
CLIENT.TCP_MAX = Setting.value("TCP_MAX", 1).toInt();
CLIENT.TCP_ID = Setting.value("TCP_ID", 0).toInt();
CLIENT.TCP_Password = Setting.value("Password", QString("")).toString();
 
for (int z = 0; z < CLIENT.TCP_MAX; z++)
{
CLIENT.TCP_SERVER[z] = Setting.value("TCP_SERVER_" + QString("%1").arg(z), QString("127.0.0.1:64400")).toString();
}
Setting.endGroup();
 
Setting.beginGroup("GUI");
GUI.isMax = Setting.value("IsMax",false).toBool();
GUI.Size = Setting.value("Size", QSize(500, 350)).toSize();
GUI.Point = Setting.value("Point",QPoint(1,1)).toPoint();
Setting.endGroup();
 
Setting.beginGroup("TERMINAL");
TERMINAL.isMax = Setting.value("IsMax",false).toBool();
TERMINAL.Size = Setting.value("Size", QSize(500, 350)).toSize();
TERMINAL.Point = Setting.value("Point",QPoint(1,1)).toPoint();
DATA.Data = Setting.value("Data",false).toBool();
DATA.Info = Setting.value("Info",false).toBool();
DATA.Send = Setting.value("Send",false).toBool();
DATA.TCP = Setting.value("TCP",false).toBool();
Setting.endGroup();
}
 
void cSettings::write_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Setting.setValue("Settings ID", Settings_ID);
Setting.endGroup();
 
Setting.beginGroup("SERVER");
Setting.setValue("TCP-PORT", SERVER.TCP_PORT);
Setting.setValue("UDP-PORT", SERVER.UDP_PORT);
Setting.setValue("Password", SERVER.Password);
Setting.endGroup();
 
Setting.beginGroup("LIVEDATA");
Setting.setValue("Server", LIVEDATA.Server);
Setting.setValue("Port", LIVEDATA.Port);
Setting.setValue("User", LIVEDATA.User);
Setting.setValue("Password", LIVEDATA.Password);
Setting.endGroup();
 
Setting.beginGroup("CLIENT");
Setting.setValue("TTY_MAX", CLIENT.TTY_MAX);
Setting.setValue("TTY_ID", CLIENT.TTY_ID);
Setting.setValue("Password", CLIENT.TCP_Password);
 
for (int z = 0; z < CLIENT.TTY_MAX; z++)
{
Setting.setValue("TTY_DEVICE_" + QString("%1").arg(z), CLIENT.TTY_DEVICES[z]);
}
 
Setting.setValue("TCP_MAX", CLIENT.TCP_MAX);
Setting.setValue("TCP_ID", CLIENT.TCP_ID);
 
for (int z = 0; z < CLIENT.TCP_MAX; z++)
{
Setting.setValue("TCP_SERVER_" + QString("%1").arg(z), CLIENT.TCP_SERVER[z]);
}
Setting.endGroup();
 
Setting.beginGroup("GUI");
Setting.setValue("IsMax", GUI.isMax);
Setting.setValue("Size", GUI.Size);
Setting.setValue("Point", GUI.Point);
Setting.endGroup();
 
Setting.beginGroup("TERMINAL");
Setting.setValue("IsMax", TERMINAL.isMax);
Setting.setValue("Size", TERMINAL.Size);
Setting.setValue("Point", TERMINAL.Point);
Setting.setValue("Data", DATA.Data);
Setting.setValue("Send", DATA.Send);
Setting.setValue("Info", DATA.Info);
Setting.setValue("TCP", DATA.TCP);
Setting.endGroup();
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Classes/cSettings.h
0,0 → 1,87
/***************************************************************************
* 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 CSETTINGS_H
#define CSETTINGS_H
 
#include <QSize>
#include <QPoint>
#include <QString>
 
#include "../Defines.h"
 
struct set_SERVER
{
int TCP_PORT;
int UDP_PORT;
QString Password;
};
 
struct set_LIVEDATA
{
QString Server;
QString Port;
QString User;
QString Password;
};
 
struct set_CLIENT
{
QString TTY_DEVICES[10];
int TTY_MAX;
int TTY_ID;
 
QString TCP_SERVER[10];
QString TCP_Password;
int TCP_MAX;
int TCP_ID;
};
 
struct set_GUI
{
bool isMax;
QSize Size;
QPoint Point;
};
 
struct set_DATA
{
bool Send;
bool Data;
bool Info;
bool TCP;
};
 
class cSettings
{
public:
cSettings();
void read_Settings();
void write_Settings();
 
int Settings_ID;
 
set_DATA DATA;
set_GUI GUI;
set_GUI TERMINAL;
set_SERVER SERVER;
set_CLIENT CLIENT;
set_LIVEDATA LIVEDATA;
};
 
#endif // CSETTINGS_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Defines.h
0,0 → 1,57
/***************************************************************************
* 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 DEFINES_H
#define DEFINES_H
 
#include <QString>
#include "../Global/Global.h"
#include "../Global/Kopter.h"
 
static const QString QA_NAME = "QMK-Communicator";
static const QString QA_VERSION_NR = "1.3.0";
 
#ifdef _BETA_
static const QString QA_VERSION = QA_VERSION_NR + " (BETA)";
#else
static const QString QA_VERSION = QA_VERSION_NR;
#endif
 
static const QString QA_DATE = "25.08.2010";
static const QString QA_YEAR = "2008-2010";
 
static const QString QA_ABOUT =
"<HTML>"
"<p><b><font size=8>" + QA_NAME + "</font></b></p>"
"<br />"
"Version " + QA_VERSION + " - " + QA_DATE + " on " + QA_OS + ""
"<br /><br /><b>kompatibel zu " + QA_HWVERSION + "</b>"
"<br /><br />"
"(C) " + QA_YEAR + " by " + QA_AUTHOR + " - "
"<a href=\"mailto:" + QA_EMAIL + "\">" + QA_EMAIL + "</a> <br /><br />"
"Groundstation-Programm f&uuml;r den Mikrokopter<br /><br />"
"QMK-Communicator - Kommunikations-Schnittstelle zum Mikrokopter.<br /><br /> "
"Dieses Programm wird unter den Bedingungen der GPL v2 ver&ouml;ffentlicht."
"</HTML>";
 
static const int DEV_IP_PORT = 64400;
static const int DEV_IP_MAX = 21;
 
static const QString Base64Hash = "IypzZUNyRXQhQC0qJQ==";
 
#endif // DEFINES_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Dialogs/dlg_Main.cpp
0,0 → 1,1050
/***************************************************************************
* 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 Con_Server; 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 Con_Server, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
 
#include <QMessageBox>
#include <QCryptographicHash>
 
#include "dlg_Main.h"
 
// Konstruktor Main-Form
////////////////////////
dlg_Main::dlg_Main()
{
setupUi(this);
 
s_Buffer = "";
o_Settings = new cSettings();
 
o_Input = new Input();
o_Output = new Input();
 
f_Terminal = new dlg_Terminal(this);
 
init_GUI();
init_Connections();
 
init_TCP();
}
 
void dlg_Main::set_ARGV(char *Programm)
{
QString tmp = QString(Programm);
#ifdef WIN32
QMK_Dir = tmp.left(tmp.lastIndexOf("\\"));
#else
QMK_Dir = tmp.left(tmp.lastIndexOf("/"));
#endif
 
qDebug(QMK_Dir.toLatin1().data());
}
 
// Grafische Oberfläche initialisieren
//////////////////////////////////////
void dlg_Main::init_GUI()
{
setWindowTitle(QA_NAME + " " + QA_VERSION);
 
resize(o_Settings->GUI.Size);
move(o_Settings->GUI.Point);
 
f_Terminal->resize(o_Settings->TERMINAL.Size);
f_Terminal->move(o_Settings->TERMINAL.Point);
 
f_Terminal->cb_Data->setChecked(o_Settings->DATA.Data);
f_Terminal->cb_Info->setChecked(o_Settings->DATA.Info);
f_Terminal->cb_Send->setChecked(o_Settings->DATA.Send);
f_Terminal->cb_TCP->setChecked(o_Settings->DATA.TCP);
 
if (o_Settings->GUI.isMax)
{
showMaximized();
}
 
// todo: In abhängigkeit von Settings
wg_IP->setVisible(false);
rb_Device->setChecked(true);
 
for (int z = 0; z < DEV_IP_MAX; z++)
{
Item[z] = new QListWidgetItem();
}
 
// Liste der Devices
for(int z = 0; z < o_Settings->CLIENT.TTY_MAX; z++)
{
if (cb_Device->findText(o_Settings->CLIENT.TTY_DEVICES[z]) == -1)
{
cb_Device->addItem(o_Settings->CLIENT.TTY_DEVICES[z]);
}
}
 
cb_Device->setCurrentIndex(o_Settings->CLIENT.TTY_ID);
 
// Liste der IP-Server
for(int z = 0; z < o_Settings->CLIENT.TCP_MAX; z++)
{
if (cb_Server->findText(o_Settings->CLIENT.TCP_SERVER[z]) == -1)
{
cb_Server->addItem(o_Settings->CLIENT.TCP_SERVER[z]);
}
}
 
cb_Server->setCurrentIndex(o_Settings->CLIENT.TCP_ID);
 
// Password für IP-Verbindung.
le_Password->setText(o_Settings->CLIENT.TCP_Password);
 
btn_Debug->setVisible(false);
btn_ConnectServer->setVisible(false);
}
 
// Signale mit Slots verbinden
//////////////////////////////
void dlg_Main::init_Connections()
{
// Connect-Button
connect(btn_Connect, SIGNAL(clicked()), this, SLOT(slot_btn_Connect()));
 
connect(btn_cScope, SIGNAL(clicked()), this, SLOT(slot_btn_cScope()));
connect(btn_cSettings, SIGNAL(clicked()), this, SLOT(slot_btn_cSettings()));
connect(btn_cMaps, SIGNAL(clicked()), this, SLOT(slot_btn_cMaps()));
connect(btn_cVoice, SIGNAL(clicked()), this, SLOT(slot_btn_cVoice()));
connect(btn_cLogger, SIGNAL(clicked()), this, SLOT(slot_btn_cLogger()));
 
connect(btn_Terminal, SIGNAL(clicked()), this, SLOT(slot_btn_Terminal()));
connect(btn_ConnectServer, SIGNAL(clicked()), this, SLOT(slot_btn_ConnectServer()));
 
connect(btn_Debug, SIGNAL(clicked()), this, SLOT(slot_btn_Debug()));
 
connect(rb_NC, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
connect(rb_FC, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
connect(rb_MK3MAG, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
 
// About QMK-Kernel & About-QT Dialog einfügen
connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About()));
connect(ac_Server, SIGNAL(triggered()), this, SLOT(slot_ac_Server()));
menu_Help->addAction(trUtf8("Über &Qt"), qApp, SLOT(aboutQt()));
}
 
// IP-Ports initialisiern
/////////////////////////
// todo: Port und Anzahl aus Settings
bool dlg_Main::init_TCP()
{
Connect_Count = 0;
 
Con_Server[0].Status = 0;
 
Con_Server[0].TCP = false;
Con_Server[0].UDP = false;
 
for (int a = 0; a < DEV_IP_MAX; a++)
{
Con_Server[a].Status = 0;
}
 
TCP_Server = new QTcpServer(this);
 
if (TCP_Server->listen(QHostAddress::Any, qint16(o_Settings->SERVER.TCP_PORT)))
{
connect(TCP_Server, SIGNAL(newConnection()), this, SLOT(slot_TCP_NewConnection()));
}
 
return true;
}
 
// Eingangsdaten verarbeiten
////////////////////////////
void dlg_Main::parse_Input_Data(QString t_Data)
{
unsigned char OutData[180];
char *InData = t_Data.toLatin1().data();
 
if (HandlerMK::Decode_64(InData, t_Data.length(), OutData) != 0)
{
switch(InData[2])
{
case 'V' : // Versions-Info
{
o_Input->stop_Resend(DATA_VERSION);
VersionInfo = HandlerMK::parse_Version(OutData, InData[1] - 'a');
lb_Info->setText(tr("Verbunden mit ") + VersionInfo.Hardware + " " + VersionInfo.Version + trUtf8(" über ") + s_Input.Main + ".");
 
if (VersionInfo.ID == ADDRESS_FC)
{
rb_FC->setChecked(true);
}
if (VersionInfo.ID == ADDRESS_NC)
{
rb_NC->setChecked(true);
}
if (VersionInfo.ID == ADDRESS_MK3MAG)
{
rb_MK3MAG->setChecked(true);
}
}
break;
}
}
}
 
void dlg_Main::route_Input_Data(QString t_Data)
{
// An alle offenen TCP-Sockets senden.
for (int a = 1; a < DEV_IP_MAX; a++)
{
if (Con_Server[a].Status > 0)
{
if (Con_Server[a].TCP == true)
{
if ((Con_Server[a].Fields == "") || (Con_Server[a].Fields.contains(t_Data.at(2)) == true))
{
if (o_Input->Mode() == TTY)
{
send_TCP(o_TCP[a], t_Data + "\r");
}
else
{
send_TCP(o_TCP[a], t_Data);
}
}
else
{
// qDebug("Not Send Data");
// qDebug(t_Data.toLatin1().data());
}
}
}
}
if ((o_Output->IsOpen()) && ((Con_Output.Fields == "") || (Con_Output.Fields.contains(t_Data.at(2)) == true)))
{
o_Output->send_Data(t_Data);
}
}
 
void dlg_Main::parse_TCP_Server_Data(QString t_Data, int t_ID)
{
QStringList Data;
Data = t_Data.split(":");
 
if (Data.count() > 1)
{
int CMD = Data[2].toInt();
QString A = Data[2];
// qDebug(A.toLatin1().data());
 
switch(CMD)
{
case 101 :
{
Con_Server[t_ID].Version = Data[3];
Item[t_ID]->setText(" " + QString(o_TCP[t_ID]->peerAddress().toString()).leftJustified(15,' ') + " - " + Con_Server[t_ID].Version);
 
if (Con_Server[t_ID].Status == 2)
{
Item[t_ID]->setText("*" + QString(o_TCP[t_ID]->peerAddress().toString()).leftJustified(15,' ') + " - " + Con_Server[t_ID].Version);
}
else
{
send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 502, "105"));
}
 
send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 502, "106"));
}
break;
case 105 :
{
if (Con_Server[t_ID].Status != 2)
{
// qDebug("Get 105");
QString s_MD5PW;
QByteArray a_MD5PW;
 
a_MD5PW = QCryptographicHash::hash(o_Settings->SERVER.Password.toAscii(),QCryptographicHash::Md5);
 
s_MD5PW = QString(a_MD5PW.toHex().data());
 
if ((o_Settings->SERVER.Password != "") && (Data[3] == s_MD5PW))
{
// qDebug("Set 505 OK");
send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 505, "OK"));
 
Con_Server[t_ID].Status = 2;
Item[t_ID]->setText("*" + QString(o_TCP[t_ID]->peerAddress().toString()).leftJustified(15,' ') + " - " + Con_Server[t_ID].Version);
}
else
{
// qDebug("Set 505 NO");
send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 505, "NO"));
}
}
else
{
send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 505, "OK"));
}
}
break;
case 106 : // Datenfelder anfordern.
{
if (Con_Server[t_ID].Status == 2)
{
Con_Server[t_ID].Fields = Data[3];
Item[t_ID]->setText("*" + QString(o_TCP[t_ID]->peerAddress().toString()).leftJustified(15,' ') + " - " + Con_Server[t_ID].Version + " - " + Con_Server[t_ID].Fields);
// send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 506, Con_Server[t_ID].Fields));
}
}
}
}
}
 
// IP-Input-Daten verarbeiten.
void dlg_Main::parse_TCP_Input_Data(QString t_Data)
{
QStringList Data;
Data = t_Data.split(":");
 
if (Data.count() > 1)
{
int CMD = Data[2].toInt();
 
switch(CMD)
{
case 502 :
{
// qDebug("Request Data");
switch (Data[3].toInt())
{
case 105 :
{
QString s_MD5PW;
QByteArray a_MD5PW;
 
a_MD5PW = QCryptographicHash::hash(le_Password->text().toAscii(),QCryptographicHash::Md5);
 
s_MD5PW = QString(a_MD5PW.toHex().data());
 
o_Input->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 105, s_MD5PW));
}
break;
}
}
break;
case 505 :
{
if (Data[3] == "OK")
{
}
else
{
QMessageBox::warning(this, QA_NAME, trUtf8("Authentifizierung fehlgeschlagen. <br />Daten senden zum Mikrokopter nicht möglich."), QMessageBox::Ok);
}
}
break;
}
}
}
 
// IP-Output-Daten verarbeiten. (Live-Data)
void dlg_Main::parse_TCP_Output_Data(QString t_Data)
{
QStringList Data;
Data = t_Data.split(":");
 
if (Data.count() > 1)
{
int CMD = Data[2].toInt();
 
switch(CMD)
{
case 101 :
{
Con_Output.Version = Data[3];
o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 101, QA_NAME + " " + QA_VERSION));
}
break;
case 106 : // Datenfelder anfordern.
{
Con_Output.Fields = Data[3];
// send_TCP(o_TCP[t_ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 506, Con_Server[t_ID].Fields));
}
break;
case 502 :
{
switch (Data[3].toInt())
{
case 104 :
{
// qDebug("Request PW");
QString s_MD5PW;
QByteArray a_MD5PW;
 
a_MD5PW = QCryptographicHash::hash(QString(QByteArray::fromBase64(Base64Hash.toLatin1()) + o_Settings->LIVEDATA.Password).toAscii(),QCryptographicHash::Md5);
 
s_MD5PW = QString(a_MD5PW.toHex().data());
 
o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 104, o_Settings->LIVEDATA.User + ";" + s_MD5PW));
}
break;
}
}
break;
case 504 :
{
if (Data[3] == "OK")
{
Con_Output.Status = 2;
o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 502, "106"));
}
else
{
QMessageBox::warning(this, QA_NAME, trUtf8("Authentifizierung fehlgeschlagen."), QMessageBox::Ok);
}
}
break;
}
}
}
 
// Freies IP-Socket ermitteln
int dlg_Main::get_FreeSocket()
{
for (int a = 1; a < DEV_IP_MAX; a++)
{
if (Con_Server[a].Status == 0)
return a;
}
return 0;
}
 
// Daten auf TCP Senden
void dlg_Main::send_TCP(QTcpSocket *Socket, QString Data)
{
QByteArray SendText = Data.toAscii();
 
Socket->write(SendText + "\n");
Socket->flush();
 
// qDebug(SendText.data());
}
 
///////////
// Slots //
///////////
 
void dlg_Main::slot_btn_cScope()
{
#ifdef WIN32
QString Programm = QMK_Dir + "\QMK-Scope.exe";
#else
QString Programm = QMK_Dir + "/QMK-Scope";
#endif
 
QStringList Argumente;
 
o_cScope = new QProcess();
 
Argumente << "";
 
o_cScope->start(Programm, Argumente); // Programmaufruf
}
 
void dlg_Main::slot_btn_cSettings()
{
#ifdef WIN32
QString Programm = QMK_Dir + "\QMK-Settings.exe";
#else
QString Programm = QMK_Dir + "/QMK-Settings";
#endif
 
QStringList Argumente;
 
o_cSettings = new QProcess();
 
Argumente << "";
 
o_cSettings->start(Programm, Argumente); // Programmaufruf
}
 
void dlg_Main::slot_btn_cMaps()
{
#ifdef WIN32
QString Programm = QMK_Dir + "\QMK-Maps.exe";
#else
QString Programm = QMK_Dir + "/QMK-Maps";
#endif
 
QStringList Argumente;
 
o_cMaps = new QProcess();
 
Argumente << "";
 
o_cMaps->start(Programm, Argumente); // Programmaufruf
}
 
void dlg_Main::slot_btn_cVoice()
{
#ifdef WIN32
QString Programm = QMK_Dir + "\QMK-Voice.exe";
#else
QString Programm = QMK_Dir + "/QMK-Voice";
#endif
 
QStringList Argumente;
 
o_cVoice = new QProcess();
 
Argumente << "";
 
o_cVoice->start(Programm, Argumente); // Programmaufruf
}
 
void dlg_Main::slot_btn_cLogger()
{
#ifdef WIN32
QString Programm = QMK_Dir + "\QMK-Logger.exe";
#else
QString Programm = QMK_Dir + "/QMK-Logger";
#endif
 
QStringList Argumente;
 
o_cLogger = new QProcess();
 
Argumente << "";
 
o_cLogger->start(Programm, Argumente); // Programmaufruf
}
 
void dlg_Main::slot_btn_Terminal()
{
if (!f_Terminal->isVisible())
{
f_Terminal->show();
}
}
 
// Verbindung herstellen zum Datenserver
void dlg_Main::slot_btn_ConnectServer()
{
if (!o_Output->IsOpen())
{
Con_Output = Con_Server[0];
 
s_Output.Main = o_Settings->LIVEDATA.Server;//Server[0];
s_Output.Sub = o_Settings->LIVEDATA.Port;//Server[1];
 
o_Output = new Input_TCP();
o_Output->Init();
 
if (o_Output->Open(s_Output) == true)
{
connect(o_Output, SIGNAL(sig_Disconnected(int)), this, SLOT(slot_Output_Disconnected(int)));
connect(o_Output, SIGNAL(sig_Connected()), this, SLOT(slot_Output_Connected()));
}
btn_ConnectServer->setText(tr("Trenne Server"));
Con_Output.Status = 1;
}
else
{
btn_ConnectServer->setText(tr("Verbinde Server"));
 
o_Output->Close();
disconnect(o_Output, SIGNAL(sig_NewData(QString)), 0, 0);
if (o_Output->Mode() == TCP)
{
disconnect(o_Output, SIGNAL(sig_Disconnected(int)), 0, 0);
disconnect(o_Output, SIGNAL(sig_Connected()), 0, 0);
}
}
}
 
void dlg_Main::slot_btn_Debug()
{
if (o_Output->IsOpen())
{
o_Output->send_Data("#cO=M======wWMrSCuD==A===============================================A=GM======[M=====@==@|p==O=CM=========kN");
}
}
 
void dlg_Main::slot_rb_Hardware()
{
// if ((rb_NC->isChecked() == false) && (VersionInfo.ID != ADDRESS_NC))
// {
// o_Input->send_Data(HandlerMK::get_SelectNC());
// }
 
if (rb_FC->isChecked())
{
o_Input->send_Data(HandlerMK::get_SelectFC());
}
else
if (rb_MK3MAG->isChecked())
{
o_Input->send_Data(HandlerMK::get_SelectMK3MAG());
}
else
if (rb_NC->isChecked())
{
o_Input->send_Data(HandlerMK::get_SelectNC());
}
 
o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION);
}
 
void dlg_Main::slot_Output_Disconnected(int Error)
{
disconnect(o_Output, SIGNAL(sig_NewData(QString)), 0, 0);
if (o_Output->Mode() == TCP)
{
disconnect(o_Output, SIGNAL(sig_Disconnected(int)), 0, 0);
disconnect(o_Output, SIGNAL(sig_Connected()), 0, 0);
}
 
btn_ConnectServer->setText(tr("Verbinde Server"));
 
/* switch (Error)
{
case REMOTECLOSED :
{
// lb_Status->setText(tr("Verbindung vom Server beendet."));
QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Verbindung wurde vom Server beendet."), QMessageBox::Ok);
}
break;
case REFUSED :
{
// lb_Status->setText(tr("Server nicht gefunden."));
QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Kann nicht zum Server verbinden."), QMessageBox::Ok);
}
break;
case 3 :
{
// lb_Status->setText(tr("Serververbindung getrennt. Logindaten falsch."));
QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Loginname oder Password falsch."), QMessageBox::Ok);
}
break;
default :
{
// lb_Status->setText(tr("Getrennt vom QMK-Datenserver."));
}
break;
}
*/
 
}
 
void dlg_Main::slot_Output_Connected()
{
connect(o_Output, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Output_Data(QString)));
}
 
void dlg_Main::slot_Output_Data(QString t_Data)
{
if ((t_Data[0] == '#'))
{
}
else if (o_Output->Mode() == TCP)
{
show_Terminal(6, "IP:" + t_Data);
parse_TCP_Output_Data(t_Data);
}
}
 
// Verbindung herstellen zum Kopter
void dlg_Main::slot_btn_Connect()
{
if (!o_Input->IsOpen())
{
if (rb_Device->isChecked())
{
if (cb_Device->findText(cb_Device->currentText()) == -1)
{
cb_Device->addItem(cb_Device->currentText());
cb_Device->setCurrentIndex(cb_Device->findText(cb_Device->currentText()));
}
 
s_Input.Main = cb_Device->currentText();
 
o_Input = new Input_TTY();
o_Input->Init();
 
if (o_Input->Open(s_Input) == true)
{
connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString)));
 
o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION);
 
btn_Connect->setText(tr("Trennen"));
cb_Device->setEnabled(false);
}
}
else if (rb_TCP->isChecked())
{
if (cb_Server->findText(cb_Device->currentText()) == -1)
{
cb_Server->addItem(cb_Server->currentText());
cb_Server->setCurrentIndex(cb_Server->findText(cb_Server->currentText()));
}
 
cb_Server->setEnabled(false);
le_Password->setEnabled(false);
 
o_Input = new Input_TCP();
o_Input->Init();
 
set_Input s_Input;
 
QStringList Server = cb_Server->currentText().split(":");
 
s_Input.Main = Server[0];
s_Input.Sub = Server[1];
 
if (o_Input->Open(s_Input) == true)
{
connect(o_Input, SIGNAL(sig_Disconnected(int)), this, SLOT(slot_Input_Disconnected(int)));
connect(o_Input, SIGNAL(sig_Connected()), this, SLOT(slot_Input_Connected()));
}
}
 
}
else
{
{
cb_Device->setEnabled(true);
cb_Server->setEnabled(true);
le_Password->setEnabled(true);
 
o_Input->Close();
btn_Connect->setText(tr("Verbinden"));
disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0);
if (o_Input->Mode() == TCP)
{
disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0);
disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0);
}
}
}
}
 
// Neue Daten empfangen.
void dlg_Main::slot_Input_Data(QString t_Data)
{
if ((t_Data[0] == '#'))
{
 
if ((HandlerMK::Check_CRC(t_Data.toLatin1().data(), t_Data.length() - 1)) || ((o_Input->Mode() == TTY) && (HandlerMK::Check_CRC(t_Data.toLatin1().data(), t_Data.length()))))
{
show_Terminal(1, "MK: " + t_Data);
parse_Input_Data(t_Data);
route_Input_Data(t_Data);
}
else
{
show_Terminal(2, t_Data);
}
}
else if ((o_Input->Mode() == TCP) && (t_Data[0] == '$'))
{
show_Terminal(4, t_Data);
parse_TCP_Input_Data(t_Data);
}
else
{
show_Terminal(2, t_Data);
}
 
 
}
 
void dlg_Main::slot_Input_Disconnected(int Error)
{
cb_Server->setEnabled(true);
le_Password->setEnabled(true);
 
disconnect(o_Input, SIGNAL(sig_NewData(QString)), 0, 0);
if (o_Input->Mode() == TCP)
{
disconnect(o_Input, SIGNAL(sig_Disconnected(int)), 0, 0);
disconnect(o_Input, SIGNAL(sig_Connected()), 0, 0);
}
 
btn_Connect->setText(tr("Verbinden"));
 
/* switch (Error)
{
case REMOTECLOSED :
{
// lb_Status->setText(tr("Verbindung vom Server beendet."));
QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Verbindung wurde vom Server beendet."), QMessageBox::Ok);
}
break;
case REFUSED :
{
// lb_Status->setText(tr("Server nicht gefunden."));
QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Kann nicht zum Server verbinden."), QMessageBox::Ok);
}
break;
case 3 :
{
// lb_Status->setText(tr("Serververbindung getrennt. Logindaten falsch."));
QMessageBox::warning(this, QA_NAME,tr("QMK-Datenserver: Loginname oder Password falsch."), QMessageBox::Ok);
}
break;
default :
{
// lb_Status->setText(tr("Getrennt vom QMK-Datenserver."));
}
break;
}
*/
 
}
 
void dlg_Main::slot_Input_Connected()
{
connect(o_Input, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Input_Data(QString)));
 
o_Input->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 101, QA_NAME + " " + QA_VERSION));
o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION);
btn_Connect->setText(tr("Trennen"));
}
 
// About-Dialog
void dlg_Main::slot_ac_About()
{
QMessageBox::about(this, trUtf8(("Über ")) + QA_NAME, QA_ABOUT);
}
 
void dlg_Main::slot_ac_Server()
{
dlg_Preferences *f_Preferences = new dlg_Preferences(this);
 
f_Preferences->set_Settings(o_Settings);
 
if (f_Preferences->exec()==QDialog::Accepted)
{
o_Settings = f_Preferences->get_Settings();
o_Settings->write_Settings();
}
}
 
void dlg_Main::show_Terminal(int t_Typ, QString t_Data)
{
if (f_Terminal->isVisible())
{
f_Terminal->show_Data(t_Typ, t_Data);
}
}
 
/////////////////////
// IP-Slots Server //
/////////////////////
 
void dlg_Main::slot_TCP_NewConnection()
{
if (!o_Input->IsOpen())
{
slot_btn_Connect();
}
 
int ID = get_FreeSocket();
 
if (ID != 0)
{
Connect_Count++;
 
// Leeres Con_Server erzeugen
Con_Server[ID] = Con_Server[0];
 
Con_Server[ID].Status = 1;
Con_Server[ID].TCP = true;
 
Con_Server[ID].Fields = "";
Con_Server[ID].Version = "n/a";
 
o_TCP[ID] = TCP_Server->nextPendingConnection();
o_TCP[ID]->setProperty("ID", ID);
 
send_TCP(o_TCP[ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 101, QA_NAME + " " + QA_VERSION));
 
connect(o_TCP[ID], SIGNAL(disconnected()),o_TCP[ID], SLOT(deleteLater()));
connect(o_TCP[ID], SIGNAL(disconnected()),this, SLOT(slot_TCP_Disconnect()));
connect(o_TCP[ID], SIGNAL(readyRead()),this, SLOT(slot_TCP_Read()));
 
Item[ID]->setText(" " + QString(o_TCP[ID]->peerAddress().toString()).leftJustified(15,' ') + " - n/a");
lw_Clients->addItem(Item[ID]);
 
if (o_TCP[ID]->peerAddress().toString() == "127.0.0.1")
{
Con_Server[ID].Status = 2;
Item[ID]->setText("*" + QString(o_TCP[ID]->peerAddress().toString()).leftJustified(15,' ') + " - n/a");
}
 
if (o_Input->IsOpen())
{
// send_TCP(o_TCP[ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 520, cb_Device->currentText()));
}
 
}
else // Server voll
{
o_TCP[ID] = TCP_Server->nextPendingConnection();
o_TCP[ID]->setProperty("ID", ID);
 
send_TCP(o_TCP[ID],HandlerIP::make_Frame(ID_COMMUNICATOR, 521, "Sorry, Server full."));
o_TCP[ID]->disconnectFromHost();
}
}
 
void dlg_Main::slot_TCP_Read()
{
QTcpSocket *Socket = (QTcpSocket*)sender();
 
// if (Socket->canReadLine())
{
int ID = Socket->property("ID").toUInt();
ID = ID;
 
// QString t_Data = QString(TCP_Socket->readLine(TCP_Socket->bytesAvailable())).remove(QChar('\n'));
QString t_Data = s_Buffer + QString(Socket->readAll()).remove(QChar('\n'));
s_Buffer = "";
 
t_Data = t_Data.replace('\r', "\r\n");
 
QStringList l_Data = t_Data.split('\n');
 
for (int z = 0; z < l_Data.count(); z++)
{
if ((l_Data[z][l_Data[z].length() - 1] == '\r'))
{
l_Data[z].remove(QChar('\r'));
if (l_Data[z][0] == '$')
{
parse_TCP_Server_Data(l_Data[z], ID);
show_Terminal(5, "IP: " + l_Data[z]);
}
else
{
if ((Con_Server[ID].Status >= 2))
{
show_Terminal(3, "MK> " + l_Data[z]);
o_Input->send_Data(l_Data[z]);
}
}
}
else
{ if (l_Data[z].length() > 1)
{
qDebug(QString("Ohne Ende: " + l_Data[z]).toLatin1().data());
s_Buffer = s_Buffer + l_Data[z];
}
}
 
}
 
/*
QString t_Data = QString(Socket->readLine((Socket->bytesAvailable())));
 
QStringList s_Data = t_Data.split('\r');
 
for (int z = 0; z < s_Data.count() - 1; z++)
{
if (s_Data[z][0] == '$')
{
parse_TCP_Server_Data(s_Data[z], ID);
show_Terminal(5, "IP: " + s_Data[z]);
 
}
else
{
if ((Con_Server[ID].Status >= 2))
{
show_Terminal(3, s_Data[z]);
o_Input->send_Data(s_Data[z]);
}
}
}
}
*/
}
}
 
void dlg_Main::slot_TCP_Disconnect()
{
QTcpSocket *Socket = (QTcpSocket*)sender();
 
int ID = Socket->property("ID").toUInt();
 
Item[ID]->setText(" " + QString(o_TCP[ID]->peerAddress().toString()).leftJustified(15,' ') + " - Disconected");
 
Con_Server[ID] = Con_Server[0];
Con_Server[ID].Status = 0;
 
Connect_Count--;
 
Socket->setProperty("ID", 0);
 
if ((Connect_Count == 0) && (o_Input->IsOpen()))
slot_btn_Connect();
}
 
 
// Programm Ende
////////////////
dlg_Main::~dlg_Main()
{
o_Settings->GUI.isMax = isMaximized();
o_Settings->GUI.Size = size();
o_Settings->GUI.Point = pos();
 
// o_Settings->GUI.isMax = isMaximized();
o_Settings->TERMINAL.Size = f_Terminal->size();
o_Settings->TERMINAL.Point = f_Terminal->pos();
 
o_Settings->CLIENT.TTY_MAX = cb_Device->count();
o_Settings->CLIENT.TTY_ID = cb_Device->currentIndex();
 
for (int z = 0; z < cb_Device->count(); z++)
{
if (z < 10)
{
o_Settings->CLIENT.TTY_DEVICES[z] = cb_Device->itemText(z);
}
}
 
o_Settings->CLIENT.TCP_MAX = cb_Server->count();
o_Settings->CLIENT.TCP_ID = cb_Server->currentIndex();
 
for (int z = 0; z < cb_Server->count(); z++)
{
if (z < 10)
{
o_Settings->CLIENT.TCP_SERVER[z] = cb_Server->itemText(z);
}
}
 
o_Settings->DATA.Data = f_Terminal->cb_Data->isChecked();
o_Settings->DATA.Info = f_Terminal->cb_Info->isChecked();
o_Settings->DATA.Send = f_Terminal->cb_Send->isChecked();
o_Settings->DATA.TCP = f_Terminal->cb_TCP->isChecked();
 
o_Settings->write_Settings();
 
// qDebug("Ende.");
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Dialogs/dlg_Main.h
0,0 → 1,152
/***************************************************************************
* 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 <QProcess>
#include <QDir>
 
#include "ui_dlg_Main.h"
 
#include "dlg_Preferences.h"
#include "dlg_Terminal.h"
 
#include "../Defines.h"
#include "../TypeDefs.h"
 
#include "../Classes/cSettings.h"
 
#include "../../Global/Kopter.h"
#include "../../Global/Class_Input/Input.h"
#include "../../Global/Class_Input/Input_TTY.h"
#include "../../Global/Class_Input/Input_TCP.h"
#include "../../Global/Class_HandlerMK/HandlerMK.h"
#include "../../Global/Class_HandlerIP/HandlerIP.h"
#include "../../Global/Class_SerialPort/ManageSerialPort.h"
 
class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI
{
Q_OBJECT
 
public:
dlg_Main();
~dlg_Main();
void set_ARGV(char *Programm);
 
private:
QString QMK_Dir;
 
// Input Device.
Input *o_Input;
Input *o_Output;
 
set_Input s_Input;
set_Input s_Output;
 
 
// Settings-Object
cSettings *o_Settings;
 
dlg_Terminal *f_Terminal;
 
QProcess *o_cScope;
QProcess *o_cSettings;
QProcess *o_cMaps;
QProcess *o_cVoice;
QProcess *o_cLogger;
 
// TCP Server und Socket.
QTcpServer *TCP_Server;
QTcpSocket *o_TCP[DEV_IP_MAX];
QString s_Buffer;
 
//Liste alle IP-Verbindungen und deren Parameter.
int Connect_Count;
sConnection Con_Server[DEV_IP_MAX];
sConnection Con_Output;
 
QListWidgetItem *Item[DEV_IP_MAX];
 
s_Hardware VersionInfo;
 
char c_Data[150];
 
// Programm-Initialisirungen
void init_GUI();
void init_Connections();
 
// IP-Ports initialisieren
bool init_TCP();
 
// Einkommende Datenpackete zerlegen.
void parse_Input_Data(QString t_Data);
 
// Einkommende Datenpackete weiterleiten
void route_Input_Data(QString t_Data);
 
void parse_TCP_Server_Data(QString t_Data, int t_ID);
void parse_TCP_Input_Data(QString t_Data);
void parse_TCP_Output_Data(QString t_Data);
 
// Freies IP-Socket ermitteln
int get_FreeSocket();
 
// Daten aufs IP-Interface senden.
void send_TCP(QTcpSocket *Socket, QString Data);
 
void show_Terminal(int t_Typ, QString t_Data);
 
private slots:
void slot_ac_About();
void slot_ac_Server();
 
// Connect-Button
void slot_btn_Connect();
 
void slot_btn_cScope();
void slot_btn_cSettings();
void slot_btn_cMaps();
void slot_btn_cVoice();
void slot_btn_cLogger();
 
void slot_btn_Terminal();
void slot_btn_ConnectServer();
void slot_btn_Debug();
 
void slot_rb_Hardware();
 
// Einkommende Datenpackete.
void slot_Input_Data(QString t_Data);
void slot_Input_Disconnected(int Error);
void slot_Input_Connected();
 
void slot_TCP_NewConnection();
void slot_TCP_Disconnect();
void slot_TCP_Read();
 
void slot_Output_Data(QString t_Data);
void slot_Output_Disconnected(int Error);
void slot_Output_Connected();
 
};
 
#endif // DLG_MAIN_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Dialogs/dlg_Main.ui
0,0 → 1,543
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_Main_UI</class>
<widget class="QMainWindow" name="dlg_Main_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>505</width>
<height>361</height>
</rect>
</property>
<property name="windowTitle">
<string>QMK-Communicator</string>
</property>
<property name="windowIcon">
<iconset resource="../QMK-Communicator.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Communicator.png</normaloff>:/Icon/Global/Images/Icons/QMK-Communicator.png</iconset>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout_9">
<property name="margin">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Verbindung zum Mikrokopter</string>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0" colspan="2">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<property name="margin">
<number>2</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QRadioButton" name="rb_Device">
<property name="text">
<string>Device</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rb_TCP">
<property name="text">
<string>T CP</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rb_UDP">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>UDP</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<zorder></zorder>
</widget>
</item>
<item row="1" column="0">
<widget class="QWidget" name="wg_Device" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<property name="margin">
<number>2</number>
</property>
<item row="1" column="2">
<widget class="QComboBox" name="cb_Device">
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertAtTop</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lb_Device">
<property name="text">
<string>Device:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>2</number>
</property>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QRadioButton" name="rb_FC">
<property name="text">
<string>FlightCtrl</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="rb_NC">
<property name="text">
<string>NaviCtrl</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="rb_MK3MAG">
<property name="text">
<string>MK3MAG</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QPushButton" name="btn_Connect">
<property name="text">
<string>Verbinden</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QWidget" name="wg_IP" native="true">
<property name="enabled">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<property name="margin">
<number>2</number>
</property>
<item row="0" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>60</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cb_Server">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Server:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="le_Password">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>PW:</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Client-Verbindungen</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="horizontalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QListWidget" name="lw_Clients">
<property name="font">
<font/>
</property>
<property name="autoScroll">
<bool>false</bool>
</property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="resizeMode">
<enum>QListView::Adjust</enum>
</property>
<property name="viewMode">
<enum>QListView::ListMode</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="lb_Info">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1" rowspan="2">
<widget class="QGroupBox" name="groupBox_3">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="title">
<string>Clients</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QPushButton" name="btn_Terminal">
<property name="text">
<string>Terminal</string>
</property>
<property name="icon">
<iconset resource="../QMK-Communicator.qrc">
<normaloff>:/Actions/Global/Images/Actions/Terminal.png</normaloff>:/Actions/Global/Images/Actions/Terminal.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="btn_cScope">
<property name="text">
<string>Scope</string>
</property>
<property name="icon">
<iconset resource="../QMK-Communicator.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Scope.png</normaloff>:/Icon/Global/Images/Icons/QMK-Scope.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="btn_cSettings">
<property name="text">
<string>Settings</string>
</property>
<property name="icon">
<iconset resource="../QMK-Communicator.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Settings.png</normaloff>:/Icon/Global/Images/Icons/QMK-Settings.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="btn_cMaps">
<property name="text">
<string>Maps</string>
</property>
<property name="icon">
<iconset resource="../QMK-Communicator.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Maps.png</normaloff>:/Icon/Global/Images/Icons/QMK-Maps.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item row="7" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>229</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="0">
<widget class="QPushButton" name="btn_cVoice">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Voice</string>
</property>
<property name="icon">
<iconset resource="../QMK-Communicator.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Voice.png</normaloff>:/Icon/Global/Images/Icons/QMK-Voice.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QPushButton" name="btn_cLogger">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Logger</string>
</property>
<property name="icon">
<iconset resource="../QMK-Communicator.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Logger.png</normaloff>:/Icon/Global/Images/Icons/QMK-Logger.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QPushButton" name="btn_ConnectServer">
<property name="text">
<string>Verbinde Server</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QPushButton" name="btn_Debug">
<property name="text">
<string>Debug-Button</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>505</width>
<height>19</height>
</rect>
</property>
<widget class="QMenu" name="menu_Program">
<property name="title">
<string>Programm</string>
</property>
<addaction name="ac_Server"/>
<addaction name="separator"/>
<addaction name="ac_Quit"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>Hilfe</string>
</property>
<addaction name="ac_About"/>
</widget>
<addaction name="menu_Program"/>
<addaction name="menu_Help"/>
</widget>
<action name="ac_Quit">
<property name="icon">
<iconset resource="../QMK-Communicator.qrc">
<normaloff>:/Actions/Global/Images/Actions/Exit.png</normaloff>:/Actions/Global/Images/Actions/Exit.png</iconset>
</property>
<property name="text">
<string>Beenden</string>
</property>
</action>
<action name="ac_About">
<property name="icon">
<iconset resource="../QMK-Communicator.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Communicator.png</normaloff>:/Icon/Global/Images/Icons/QMK-Communicator.png</iconset>
</property>
<property name="text">
<string>Über QMK-Communicator</string>
</property>
</action>
<action name="ac_Server">
<property name="icon">
<iconset resource="../QMK-Communicator.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Communicator.png</normaloff>:/Icon/Global/Images/Icons/QMK-Communicator.png</iconset>
</property>
<property name="text">
<string>Einstellungen</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
<include location="../QMK-Communicator.qrc"/>
</resources>
<connections>
<connection>
<sender>ac_Quit</sender>
<signal>triggered()</signal>
<receiver>dlg_Main_UI</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>182</x>
<y>88</y>
</hint>
</hints>
</connection>
<connection>
<sender>rb_Device</sender>
<signal>toggled(bool)</signal>
<receiver>wg_Device</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>38</x>
<y>70</y>
</hint>
<hint type="destinationlabel">
<x>54</x>
<y>105</y>
</hint>
</hints>
</connection>
<connection>
<sender>rb_TCP</sender>
<signal>toggled(bool)</signal>
<receiver>wg_IP</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>125</x>
<y>75</y>
</hint>
<hint type="destinationlabel">
<x>124</x>
<y>140</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Dialogs/dlg_Preferences.cpp
0,0 → 1,52
/***************************************************************************
* 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. *
***************************************************************************/
#include "dlg_Preferences.h"
 
dlg_Preferences::dlg_Preferences(QWidget *parent) : QDialog(parent)
{
setupUi(this);
}
 
void dlg_Preferences::set_Settings(cSettings *t_Settings)
{
o_Settings = t_Settings;
 
le_TCP_Port->setText(QString("%1").arg(o_Settings->SERVER.TCP_PORT));
le_UDP_Port->setText(QString("%1").arg(o_Settings->SERVER.UDP_PORT));
le_Password->setText(o_Settings->SERVER.Password);
 
le_LiveServer->setText(o_Settings->LIVEDATA.Server);
le_LivePort->setText(o_Settings->LIVEDATA.Port);
le_LiveUser->setText(o_Settings->LIVEDATA.User);
le_LivePassword->setText(o_Settings->LIVEDATA.Password);
}
 
cSettings *dlg_Preferences::get_Settings()
{
o_Settings->SERVER.Password = le_Password->text();
o_Settings->SERVER.TCP_PORT = le_TCP_Port->text().toInt();
o_Settings->SERVER.UDP_PORT = le_UDP_Port->text().toInt();
 
o_Settings->LIVEDATA.Server = le_LiveServer->text();
o_Settings->LIVEDATA.Port = le_LivePort->text();
o_Settings->LIVEDATA.User = le_LiveUser->text();
o_Settings->LIVEDATA.Password = le_LivePassword->text();
 
return o_Settings;
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Dialogs/dlg_Preferences.h
0,0 → 1,41
/***************************************************************************
* 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_PREFERENCES_H
#define DLG_PREFERENCES_H
 
#include "ui_dlg_Preferences.h"
#include "../Classes/cSettings.h"
 
class dlg_Preferences : public QDialog, public Ui::dlg_Preferences_UI
{
Q_OBJECT
 
public:
dlg_Preferences(QWidget *parent = 0);
 
void set_Settings(cSettings *t_Settings);
cSettings *get_Settings();
 
private:
// Settings-Object
cSettings *o_Settings;
 
};
 
#endif // DLG_PREFERENCES_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Dialogs/dlg_Preferences.ui
0,0 → 1,262
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_Preferences_UI</class>
<widget class="QDialog" name="dlg_Preferences_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>192</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Server-Einstellungen</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Communicator</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="checkBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>TCP</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="le_TCP_Port"/>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>UDP</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="le_UDP_Port">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="le_Password">
<property name="text">
<string>qwertz</string>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="4" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Live-Daten senden</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Server:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="le_LiveServer">
<property name="text">
<string>127.0.0.1</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Login:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="le_LiveUser">
<property name="text">
<string>KeyOz</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="le_LivePassword">
<property name="text">
<string>qwertz</string>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="le_LivePort">
<property name="text">
<string>64410</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>checkBox</tabstop>
<tabstop>le_TCP_Port</tabstop>
<tabstop>le_Password</tabstop>
<tabstop>le_LiveServer</tabstop>
<tabstop>le_LiveUser</tabstop>
<tabstop>le_LivePassword</tabstop>
<tabstop>buttonBox</tabstop>
<tabstop>checkBox_2</tabstop>
<tabstop>le_UDP_Port</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>dlg_Preferences_UI</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>dlg_Preferences_UI</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Dialogs/dlg_Terminal.cpp
0,0 → 1,89
/***************************************************************************
* 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. *
***************************************************************************/
#include "dlg_Terminal.h"
 
dlg_Terminal::dlg_Terminal(QWidget *parent) : QDialog(parent)
{
setupUi(this);
 
connect(btn_Delete, SIGNAL(clicked()), this, SLOT(slot_btn_Delete()));
}
 
void dlg_Terminal::slot_btn_Delete()
{
te_Out->clear();
}
 
void dlg_Terminal::show_Data(int t_Typ, QString t_Data)
{
te_Out->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor);
 
switch(t_Typ)
{
case 1:
{
if (cb_Data->isChecked())
{
te_Out->insertHtml("<span style=\"color:#00ffff;\">" + t_Data + "<br /></span>");
}
}
break;
case 2:
{
if ((t_Data.length() > 0) && (cb_Info->isChecked()))
{
te_Out->insertHtml("<span style=\"color:#00ff00;\">" + t_Data + "</span><br />");
}
}
break;
case 3:
{
if (cb_Send->isChecked())
{
te_Out->insertHtml("<span style='color:#ff0000;'>" + t_Data + "<br /></span>");
}
}
break;
case 4:
{
if (cb_TCP->isChecked())
{
te_Out->insertHtml("<span style='color:#ff00ff;'>" + t_Data + "<br /></span>");
}
}
break;
case 5:
{
if (cb_TCP->isChecked())
{
te_Out->insertHtml("<span style='color:#ffff00;'>" + t_Data + "<br /></span>");
}
}
break;
case 6:
{
if (cb_TCP->isChecked())
{
te_Out->insertHtml("<span style='color:#ffffff;'>" + t_Data + "<br /></span>");
}
}
break;
}
}
 
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Dialogs/dlg_Terminal.h
0,0 → 1,37
/***************************************************************************
* 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_TERMINAL_H
#define DLG_TERMINAL_H
 
#include <QString>
#include "ui_dlg_Terminal.h"
 
class dlg_Terminal : public QDialog, public Ui::dlg_Terminal_UI
{
Q_OBJECT
 
public:
dlg_Terminal(QWidget *parent = 0);
void show_Data(int t_Typ, QString t_Data);
 
private slots:
void slot_btn_Delete();
};
 
#endif // DLG_TERMINAL_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/Dialogs/dlg_Terminal.ui
0,0 → 1,145
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_Terminal_UI</class>
<widget class="QDialog" name="dlg_Terminal_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>720</width>
<height>365</height>
</rect>
</property>
<property name="windowTitle">
<string>Terminal</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTextEdit" name="te_Out">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Adobe Courier</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Adobe Courier'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Anzeige:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="cb_Data">
<property name="text">
<string>Datenpackete</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="cb_Info">
<property name="text">
<string>Meldungen</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QCheckBox" name="cb_Send">
<property name="text">
<string>Gesendete Daten</string>
</property>
</widget>
</item>
<item row="0" column="5">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>185</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="6">
<widget class="QPushButton" name="btn_Delete">
<property name="text">
<string>Löschen</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QCheckBox" name="cb_TCP">
<property name="text">
<string>TCP-Daten</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/QMK-Communicator.pro
0,0 → 1,46
# -------------------------------------------------
# Project created by QtCreator 2009-07-20T20:04:00
# -------------------------------------------------
QT += network
TARGET = QMK-Communicator
TEMPLATE = app
 
include(../Global/Class_SerialPort.pri)
 
DESTDIR = ../Binary
 
debug {
DEFINES += _BETA_
}
 
OBJECTS_DIR = ../Binary/.build/QMK-Communicator
UI_DIR = ../Binary/.build/QMK-Communicator
MOC_DIR = ../Binary/.build/QMK-Communicator
RCC_DIR = ../Binary/.build/QMK-Communicator
RESOURCES += QMK-Communicator.qrc
SOURCES += main.cpp \
../Global/Class_Input/Input.cpp \
../Global/Class_Input/Input_TTY.cpp \
../Global/Class_Input/Input_TCP.cpp \
../Global/Class_HandlerMK/HandlerMK.cpp \
../Global/Class_HandlerIP/HandlerIP.cpp \
Dialogs/dlg_Main.cpp \
Classes/cSettings.cpp \
Dialogs/dlg_Preferences.cpp \
Dialogs/dlg_Terminal.cpp
HEADERS += Defines.h \
../Global/Kopter.h \
../Global/Class_Input/Input.h \
../Global/Class_Input/Input_TTY.h \
../Global/Class_Input/Input_TCP.h \
../Global/Class_HandlerMK/HandlerMK.h \
../Global/Class_HandlerIP/HandlerIP.h \
Dialogs/dlg_Main.h \
Classes/cSettings.h \
TypeDefs.h \
../Global/Global.h \
Dialogs/dlg_Preferences.h \
Dialogs/dlg_Terminal.h
FORMS += Dialogs/dlg_Main.ui \
Dialogs/dlg_Preferences.ui \
Dialogs/dlg_Terminal.ui
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/QMK-Communicator.qrc
0,0 → 1,16
<RCC>
<qresource prefix="Icon" >
<file>../Global/Images/Icons/QMK-Logger.png</file>
<file>../Global/Images/Icons/QMK-Voice.png</file>
<file>../Global/Images/Icons/QMK-Maps.png</file>
<file>../Global/Images/Icons/QMK-Settings.png</file>
<file>../Global/Images/Icons/QMK-Communicator.png</file>
<file>../Global/Images/Icons/QMK-Scope.png</file>
</qresource>
<qresource prefix="Actions" >
<file>../Global/Images/Actions/Terminal.png</file>
<file>../Global/Images/Actions/Exit.png</file>
<file>../Global/Images/Actions/Connection-OK.png</file>
<file>../Global/Images/Actions/Connection-NO.png</file>
</qresource>
</RCC>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/TypeDefs.h
0,0 → 1,36
/***************************************************************************
* 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 TYPEDEFS_H
#define TYPEDEFS_H
 
#include <QString>
 
struct sConnection
{
// bool Open;
bool TCP;
bool UDP;
// bool Auth;
QString Fields;
QString Version;
 
int Status;
};
 
#endif // TYPEDEFS_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Communicator/main.cpp
0,0 → 1,37
/***************************************************************************
* 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. *
***************************************************************************/
 
#include <QtGui/QApplication>
#include "Dialogs/dlg_Main.h"
 
int main(int argc, char *argv[])
{
QApplication App(argc, argv);
 
dlg_Main *MainApp = new dlg_Main();
 
MainApp->set_ARGV(argv[0]);
MainApp->show();
 
int iReturn = App.exec();
 
delete MainApp;
 
return iReturn;
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/Classes/cSettings.cpp
0,0 → 1,88
/***************************************************************************
* 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. *
***************************************************************************/
#include <QSettings>
#include <QDir>
 
#include "cSettings.h"
 
cSettings::cSettings()
{
Settings_ID = 1;
 
read_Settings();
}
 
void cSettings::read_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Settings_ID = Setting.value("Settings ID", Settings_ID).toInt();
Setting.endGroup();
 
Setting.beginGroup("GUI");
GUI.isMax = Setting.value("IsMax",false).toBool();
GUI.Size = Setting.value("Size", QSize(500, 350)).toSize();
GUI.Point = Setting.value("Point",QPoint(1,1)).toPoint();
GUI.Toolbar = Setting.value("Toolbar",true).toBool();
Setting.endGroup();
 
Setting.beginGroup("CONFIG");
CONFIG.cb_CenterPos = Setting.value("cb_CenterPos",true).toBool();
CONFIG.cb_ShowRoute = Setting.value("cb_ShowRoute",true).toBool();
CONFIG.cb_ShowWPs = Setting.value("cb_ShowWPs",true).toBool();
CONFIG.cb_Goto = Setting.value("cb_Goto",true).toBool();
Setting.endGroup();
 
Setting.beginGroup("Navi");
NAVI.StayTime = Setting.value("StayTime", 500).toInt();
NAVI.Latitude = Setting.value("Latitude", 52.5).toDouble();
NAVI.Longitude = Setting.value("Longitude", 13.5).toDouble();
Setting.endGroup();
}
 
void cSettings::write_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Setting.setValue("Settings ID", Settings_ID);
Setting.endGroup();
 
Setting.beginGroup("GUI");
Setting.setValue("IsMax", GUI.isMax);
Setting.setValue("Size", GUI.Size);
Setting.setValue("Point", GUI.Point);
Setting.setValue("Toolbar", GUI.Toolbar);
Setting.endGroup();
 
Setting.beginGroup("CONFIG");
Setting.setValue("cb_CenterPos", CONFIG.cb_CenterPos);
Setting.setValue("cb_ShowRoute", CONFIG.cb_ShowRoute);
Setting.setValue("cb_ShowWPs", CONFIG.cb_ShowWPs);
Setting.setValue("cb_Goto", CONFIG.cb_Goto);
Setting.endGroup();
 
Setting.beginGroup("NAVI");
Setting.setValue("StayTime", NAVI.StayTime);
Setting.setValue("Latitude", NAVI.Latitude);
Setting.setValue("Longitude", NAVI.Longitude);
Setting.endGroup();
 
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/Classes/cSettings.h
0,0 → 1,65
/***************************************************************************
* 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 CSETTINGS_H
#define CSETTINGS_H
 
#include <QSize>
#include <QPoint>
#include <QString>
 
#include "../Defines.h"
 
struct set_GUI
{
bool isMax;
QSize Size;
QPoint Point;
bool Toolbar;
};
 
struct set_CONFIG
{
bool cb_Goto;
bool cb_ShowRoute;
bool cb_ShowWPs;
bool cb_CenterPos;
};
 
struct set_NAVI
{
int StayTime;
double Latitude;
double Longitude;
};
 
class cSettings
{
public:
cSettings();
void read_Settings();
void write_Settings();
 
int Settings_ID;
 
set_GUI GUI;
set_CONFIG CONFIG;
set_NAVI NAVI;
};
 
#endif // CSETTINGS_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/Defines.h
0,0 → 1,54
/***************************************************************************
* 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 DEFINES_H
#define DEFINES_H
 
#include <QString>
#include "../Global/Global.h"
#include "../Global/Kopter.h"
 
static const QString QA_NAME = "QMK-Maps";
static const QString QA_VERSION_NR = "1.3.0";
 
#ifdef _BETA_
static const QString QA_VERSION = QA_VERSION_NR + " (BETA)";
#else
static const QString QA_VERSION = QA_VERSION_NR;
#endif
 
static const QString QA_DATE = "25.08.2010";
static const QString QA_YEAR = "2008-2010";
 
static const QString QA_ABOUT =
"<HTML>"
"<p><b><font size=8>" + QA_NAME + "</font></b></p>"
"<br />"
"Version " + QA_VERSION + " - " + QA_DATE + " on " + QA_OS + ""
"<br /><br /><b>kompatibel zu " + QA_HWVERSION + "</b>"
"<br /><br />"
"(C) " + QA_YEAR + " by " + QA_AUTHOR + " - "
"<a href=\"mailto:" + QA_EMAIL + "\">" + QA_EMAIL + "</a> <br /><br />"
"Groundstation-Programm f&uuml;r den Mikrokopter<br /><br />"
"QMK-Maps - Positionsanzeige und Waypoint-Programmierung.<br /><br /> "
"Dieses Programm wird unter den Bedingungen der GPL v2 ver&ouml;ffentlicht."
"</HTML>";
 
static const QString DataFields = "VWXO";
 
#endif // DEFINES_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/Dialogs/dlg_Main.cpp
0,0 → 1,908
/***************************************************************************
* 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. *
***************************************************************************/
 
#include <QCryptographicHash>
#include <QMessageBox>
#include <QDomDocument>
#include <QFile>
 
#include "dlg_Main.h"
#include "dlg_MapPos.h"
 
// Konstruktor Main-Form
dlg_Main::dlg_Main()
{
setupUi(this);
 
o_Settings = new cSettings();
 
wg_Connection->set_Client(ID_MAPS, QA_NAME + " " + QA_VERSION, DataFields);
 
o_Map = new MapControl(QSize(25,25));
l_RouteWP = new LineString();
init_Directorys();
init_GUI();
init_Connections();
}
 
// Grafische Oberfläche initialisieren
void dlg_Main::init_GUI()
{
setWindowTitle(QA_NAME + " " + QA_VERSION);
 
resize(o_Settings->GUI.Size);
move(o_Settings->GUI.Point);
 
if (o_Settings->GUI.isMax)
{
showMaximized();
}
 
wg_Connection->set_SelectVisible(false);
 
cb_CenterPos->setChecked(o_Settings->CONFIG.cb_CenterPos);
cb_ShowRoute->setChecked(o_Settings->CONFIG.cb_ShowRoute);
cb_ShowWPs->setChecked(o_Settings->CONFIG.cb_ShowWPs);
cb_Goto->setChecked(o_Settings->CONFIG.cb_Goto);
 
// tb_More->addWidget(cb_Maps);
cb_Maps->setVisible(false);
 
ac_Toolbar->setChecked(o_Settings->GUI.Toolbar);
 
if (ac_Toolbar->isChecked())
{
wg_Connection->set_ButtonVisible(false);
}
else
{
ToolBar->setVisible(false);
tb_More->setVisible(false);
}
}
 
// Signale mit Slots verbinden
void dlg_Main::init_Connections()
{
connect(ac_Connect, SIGNAL(triggered()), wg_Connection, SLOT(slot_btn_Connect()));
connect(ac_Toolbar, SIGNAL(triggered()), this, SLOT(slot_ac_Toolbar()));
 
connect(sl_Zoom, SIGNAL(valueChanged(int)), this, SLOT(slot_Zoom(int)));
connect(cb_Maps, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_ChangeMap(int)));
 
connect(cb_ShowWPs, SIGNAL(toggled(bool)), this, SLOT(slot_ShowWayPoints(bool)));
 
connect(btn_WPAdd, SIGNAL(clicked()), this, SLOT(slot_btn_WPAdd()));
connect(btn_WPFly, SIGNAL(clicked()), this, SLOT(slot_btn_WPFly()));
connect(btn_WPDelete, SIGNAL(clicked()), this, SLOT(slot_btn_WPDelete()));
 
connect(ac_LoadRoute, SIGNAL(triggered()), this, SLOT(slot_ac_LoadWayPoints()));
connect(ac_SaveRoute, SIGNAL(triggered()), this, SLOT(slot_ac_SaveRoute()));
 
connect(ac_LoadMap, SIGNAL(triggered()), this, SLOT(slot_ac_LoadMapPic()));
connect(ac_Record, SIGNAL(triggered()), this, SLOT(slot_ac_Record()));
connect(ac_RouteDelete, SIGNAL(triggered()), this, SLOT(slot_ac_RouteDelete()));
 
// About QMK-Kernel & About-QT Dialog einfügen
connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About()));
menu_Help->addAction(trUtf8("Über &Qt"), qApp, SLOT(aboutQt()));
 
connect(wg_Connection, SIGNAL(sig_Status(int)), this, SLOT(slot_ConnectionStatus(int)));
connect(wg_Connection, SIGNAL(sig_MK_Version(s_Hardware)), this, SLOT(slot_MK_Version(s_Hardware)));
connect(wg_Connection, SIGNAL(sig_MK_NaviData(s_MK_NaviData)), this, SLOT(slot_MK_NaviData(s_MK_NaviData)));
connect(wg_Connection, SIGNAL(sig_MK_WayPoint(int)), this, SLOT(slot_MK_WayPoint(int)));
}
 
void dlg_Main::init_Directorys()
{
QDir *t_Dir = new QDir();
 
s_Dir.MainData = QDir::homePath() + "/QMK-Data";
if (!t_Dir->exists(s_Dir.MainData))
{
t_Dir->mkdir(s_Dir.MainData);
}
 
s_Dir.MapCache = s_Dir.MainData + "/Map-Cache";
if (!t_Dir->exists(s_Dir.MapCache))
{
t_Dir->mkdir(s_Dir.MapCache);
}
 
s_Dir.WPRoutes = s_Dir.MainData + "/WP-Routes";
if (!t_Dir->exists(s_Dir.WPRoutes))
{
t_Dir->mkdir(s_Dir.WPRoutes);
}
 
s_Dir.MapPics = s_Dir.MainData + "/Map-Pics";
if (!t_Dir->exists(s_Dir.MapPics))
{
t_Dir->mkdir(s_Dir.MapPics);
}
 
s_Dir.Flights = s_Dir.MainData + "/Flights";
if (!t_Dir->exists(s_Dir.Flights))
{
t_Dir->mkdir(s_Dir.Flights);
}
}
 
///////////////////////////////////////////////////////////////////
// QMK-Maps //
///////////////////////////////////////////////////////////////////
 
void dlg_Main::create_Map()
{
o_Map->resize(w_Map->size() - QSize(25,50));
o_Map->enablePersistentCache(s_Dir.MapCache);
o_Map->showScale(true);
 
o_Adapter = new OSMMapAdapter();
 
o_Layer = new MapLayer("MapLayer", o_Adapter);
o_Click = new GeometryLayer("Click", o_Adapter);
o_Info = new GeometryLayer("Poute", o_Adapter);
o_RouteWP = new GeometryLayer("Route-WayPoint", o_Adapter);
o_RouteFL = new GeometryLayer("Route-Flight", o_Adapter);
 
o_Map->addLayer(o_Layer);
o_Map->addLayer(o_Click);
o_Map->addLayer(o_Info);
o_Map->addLayer(o_RouteWP);
o_Map->addLayer(o_RouteFL);
 
o_Map->setZoom(17);
o_Map->setView(QPointF(o_Settings->NAVI.Longitude,o_Settings->NAVI.Latitude));
// o_Map->setView(QPointF(13.5,52.5));
// o_Map->setView(QPointF(13.419805,52.431787));
connect(o_Map, SIGNAL(mouseEventCoordinate(const QMouseEvent*, const QPointF)), this, SLOT(slot_Click(const QMouseEvent*, const QPointF)));
 
l_Map->addWidget(o_Map);
 
sl_Zoom->setValue(17);
 
// Flight
Pen[0] = new QPen(QColor(0,0,255,255));
Pen[0]->setWidth(2);
Pen[1] = new QPen(QColor(0,0,255,255));
Pen[1]->setWidth(1);
// WayPoint
Pen[2] = new QPen(QColor(255,0,0,255));
Pen[2]->setWidth(2);
Pen[3] = new QPen(QColor(255,0,0,255));
Pen[3]->setWidth(1);
// Info
Pen[4] = new QPen(QColor(0,128,128,255));
Pen[4]->setWidth(2);
Pen[5] = new QPen(QColor(0,128,128,255));
Pen[5]->setWidth(1);
}
 
// auf Veränderung der Fenstergröße reagieren
void dlg_Main::resizeEvent ( QResizeEvent * event )
{
event = event;
o_Map->resize(w_Map->size() - QSize(25,25));
}
 
void dlg_Main::wheelEvent(QWheelEvent *event)
{
int zoomValue = sl_Zoom->value();
int numDegrees = event->delta() / 8;
int numSteps = numDegrees / 15;
zoomValue += numSteps;
if (zoomValue < 0) { zoomValue = 0;}
if (zoomValue > 18) { zoomValue = 18;}
sl_Zoom->setValue(zoomValue);
}
 
QList<sWayPoint> dlg_Main::parse_WayPointKML(QString s_File)
{
QList<sWayPoint> tmp_WayPoints;
sWayPoint tmp_WayPoint;
 
QFile f_KML(s_File);
f_KML.open(QIODevice::ReadOnly | QIODevice::Text);
 
QByteArray s_KML;
 
while (!f_KML.atEnd())
{
s_KML.append(f_KML.readLine());
}
 
f_KML.close();
 
QDomDocument *UserXML;
UserXML = new QDomDocument;
 
UserXML->setContent(s_KML);
 
QDomElement Root = UserXML->firstChildElement("kml");
QDomElement Document = Root.firstChildElement("Document");
QDomElement Placemark = Document.firstChildElement("Placemark");
QDomElement Linestring = Placemark.firstChildElement("LineString");
 
QString Name = Placemark.firstChildElement("name").toElement().text();
 
QString Route = Linestring.firstChildElement("coordinates").toElement().text();
 
QStringList s_Points = Route.split(" ");
 
QStringList Position;
 
for (int z = 0; z < s_Points.count() - 1; z++)
{
if (z != 20)
{
Position = s_Points[z].split(",");
tmp_WayPoint.Longitude = Position[0].toDouble();
tmp_WayPoint.Latitude = Position[1].toDouble();
tmp_WayPoint.Altitude = Position[2].toDouble();
tmp_WayPoint.Time = sb_Time->value();
 
tmp_WayPoints.append(tmp_WayPoint);
}
else
{
QMessageBox::warning(this, QA_NAME,trUtf8("Die Wegpunkt-Liste umfasst mehr als 20 Einträge. Es werden nur die ersten 20 Einträge übernommen."), QMessageBox::Ok);
 
btn_WPAdd->setEnabled(false);
 
z = s_Points.count();
}
}
return tmp_WayPoints;
}
 
QList<sWayPoint> dlg_Main::parse_WayPointMKW(QString s_File)
{
QList<sWayPoint> tmp_WayPoints;
sWayPoint tmp_WayPoint;
 
QFile f_MKW(s_File);
f_MKW.open(QIODevice::ReadOnly | QIODevice::Text);
 
QString s_MKW;
 
while (!f_MKW.atEnd())
{
s_MKW.append(f_MKW.readLine());
}
 
f_MKW.close();
 
QStringList s_Points = s_MKW.split(" ");
 
QStringList Position;
 
for (int z = 0; z < s_Points.count() - 1; z++)
{
if (z != 20)
{
Position = s_Points[z].split(",");
tmp_WayPoint.Longitude = Position[0].toDouble();
tmp_WayPoint.Latitude = Position[1].toDouble();
tmp_WayPoint.Altitude = Position[2].toDouble();
tmp_WayPoint.Time = Position[3].toInt();
 
tmp_WayPoints.append(tmp_WayPoint);
}
else
{
QMessageBox::warning(this, QA_NAME,trUtf8("Die Wegpunkt-Liste umfasst mehr als 20 Einträge. Es werden nur die ersten 20 Einträge übernommen."), QMessageBox::Ok);
 
btn_WPAdd->setEnabled(false);
 
z = s_Points.count();
}
}
return tmp_WayPoints;
}
 
// Waypoint-Route anzeigen in Karte
void dlg_Main::show_WayPoints(QList<sWayPoint> WayPoints)
{
Point* p_Point;
 
o_RouteWP->removeGeometry(l_RouteWP);
p_RouteWP.clear();
l_WayPoints.clear();
 
l_WayPoints = WayPoints;
 
for (int z = 0; z < WayPoints.count(); z++)
{
p_Point = new Point(WayPoints[z].Longitude, WayPoints[z].Latitude);
 
p_RouteWP.append(p_Point);
}
 
l_RouteWP = new LineString(p_RouteWP, "", Pen[3]);
o_RouteWP->addGeometry(l_RouteWP);
 
o_Map->setView(p_Point);
 
o_Map->updateRequestNew();
}
 
// Waypoint-Liste speichern
void dlg_Main::save_WayPointsMKW(QString s_File)
{
QFile *f_MKW = new QFile(s_File);
 
f_MKW->open(QIODevice::ReadWrite | QIODevice::Text);
 
QTextStream out(f_MKW);
 
out.setRealNumberPrecision(9);
 
for (int z = 0; z < l_WayPoints.count(); z++)
{
out << l_WayPoints[z].Longitude << "," << l_WayPoints[z].Latitude << "," << l_WayPoints[z].Altitude << "," << l_WayPoints[z].Time << " \n";
}
 
f_MKW->close();
}
 
// Aktuelle MK-Position hinzufügen
void dlg_Main::add_Position(s_MK_NaviData t_NaviData)
{
sWayPoint WayPoint;
 
WayPoint.Longitude = HandlerMK::Int2Double(t_NaviData.CurrentPosition.Longitude, 7);
WayPoint.Latitude = HandlerMK::Int2Double(t_NaviData.CurrentPosition.Latitude, 7);
WayPoint.Altitude = HandlerMK::Int2Double(t_NaviData.CurrentPosition.Altitude, 3);
 
o_Settings->NAVI.Latitude = WayPoint.Latitude;
o_Settings->NAVI.Longitude = WayPoint.Longitude;
 
l_Track.append(WayPoint);
 
o_RouteFL->removeGeometry(l_RouteFL);
p_RouteFL.append(new Point(WayPoint.Longitude, WayPoint.Latitude));
 
o_Click->removeGeometry(LastPos);
 
Point* P = new CirclePoint(WayPoint.Longitude, WayPoint.Latitude, "P1", Point::Middle, Pen[0]);
LastPos = P;
// P->setBaselevel(17);
o_Click->addGeometry(P);
 
// Target anzeigen
o_Click->removeGeometry(Target);
 
Target = new ImagePoint( HandlerMK::Int2Double(t_NaviData.TargetPosition.Longitude, 7), HandlerMK::Int2Double(t_NaviData.TargetPosition.Latitude, 7), ":/Flags/Global/Images/Flags/Target.png", "Start");
Target->setBaselevel(o_Adapter->adaptedZoom());
o_Click->addGeometry(Target);
 
if (cb_CenterPos->isChecked())
{
o_Map->setView(QPointF(WayPoint.Longitude, WayPoint.Latitude));
}
 
if (cb_ShowRoute->isChecked())
{
l_RouteFL = new LineString(p_RouteFL, "", Pen[1]);
 
o_RouteFL->addGeometry(l_RouteFL);
}
o_Map->updateRequestNew();
 
if (ac_Record->isChecked())
{
QTextStream Out(o_Record);
 
Out.setRealNumberPrecision(9);
 
Out << WayPoint.Longitude << ", " << WayPoint.Latitude << ", " << WayPoint.Altitude << "\n";
}
}
 
// Ein Ziel anfliegen.
// TODO: Check auf Entfernung zur IST-Position.
void dlg_Main::send_Target(Point *t_Target)
{
if (l_Track.count() > 0)
{
s_MK_WayPoint s_WayPoint;
 
s_WayPoint.Position.Latitude = int32_t(t_Target->latitude() * 10000000+0.5);
s_WayPoint.Position.Longitude = int32_t(t_Target->longitude() * 10000000+0.5);
s_WayPoint.Position.Altitude = 0;
s_WayPoint.Position.Status = NEWDATA;
s_WayPoint.Heading = -1;
s_WayPoint.ToleranceRadius = 5;
s_WayPoint.HoldTime = sb_Time->value();
s_WayPoint.Event_Flag = 0;
s_WayPoint.Index = 1;
s_WayPoint.reserve[0] = 0; // reserve
s_WayPoint.reserve[1] = 0; // reserve
s_WayPoint.reserve[2] = 0; // reserve
s_WayPoint.reserve[3] = 0;
 
memcpy((unsigned char *)&c_Data, (unsigned char *)&s_WayPoint, sizeof(s_WayPoint));
wg_Connection->send_Data(HandlerMK::make_Frame('s', ADDRESS_NC, c_Data, sizeof(s_WayPoint)).toLatin1().data());
}
else
{
QMessageBox::warning(this, QA_NAME,tr("Es wurden noch keine aktuellen Positionsdaten vom Mikrokopter empfangen."), QMessageBox::Ok);
}
}
 
//Waypoint-Liste zum MK senden
void dlg_Main::send_WayPoints(QList<sWayPoint> t_WayPoints, int t_Pos)
{
s_MK_WayPoint s_WayPoint;
double Longitude, Latitude;
 
if (t_Pos == 0)
{ // Waypoint-Liste löschen
s_WayPoint.Position.Status = INVALID;
 
memcpy((unsigned char *)&c_Data, (unsigned char *)&s_WayPoint, sizeof(s_WayPoint));
wg_Connection->send_Data(HandlerMK::make_Frame('w', ADDRESS_NC, c_Data, sizeof(s_WayPoint)).toLatin1().data(), DATA_WRITE_WAYPOINT);
}
else
{
int z = t_Pos - 1;
Longitude = t_WayPoints[z].Longitude;
Latitude = t_WayPoints[z].Latitude;
 
if (Longitude < 100)
Longitude *= 10000000+0.5;
 
if (Latitude < 100)
Latitude *= 10000000+0.5;
 
//fülle Wegpunkt-Daten
s_WayPoint.Position.Altitude = 0;
s_WayPoint.Position.Longitude = int32_t(Longitude);
s_WayPoint.Position.Latitude = int32_t(Latitude);
s_WayPoint.Position.Status = NEWDATA;
s_WayPoint.Heading = -1;
s_WayPoint.ToleranceRadius = 5;
s_WayPoint.HoldTime = t_WayPoints[z].Time;
s_WayPoint.Event_Flag = 0;
s_WayPoint.Index = t_Pos;
s_WayPoint.reserve[0] = 0; // reserve
s_WayPoint.reserve[1] = 0; // reserve
s_WayPoint.reserve[2] = 0; // reserve
s_WayPoint.reserve[3] = 0; // reserve
 
memcpy((unsigned char *)&c_Data, (unsigned char *)&s_WayPoint, sizeof(s_WayPoint));
wg_Connection->send_Data(HandlerMK::make_Frame('w', ADDRESS_NC, c_Data, sizeof(s_WayPoint)).toLatin1().data(), DATA_WRITE_WAYPOINT);
}
}
 
///////////
// Slots //
///////////
 
// About-Dialog
void dlg_Main::slot_ac_About()
{
QMessageBox::about(this, trUtf8(("Über ")) + QA_NAME, QA_ABOUT);
}
 
void dlg_Main::slot_ac_Toolbar()
{
if (ac_Toolbar->isChecked())
{
wg_Connection->set_ButtonVisible(false);
ToolBar->setVisible(true);
tb_More->setVisible(true);
}
else
{
wg_Connection->set_ButtonVisible(true);
ToolBar->setVisible(false);
tb_More->setVisible(false);
}
}
 
void dlg_Main::slot_ConnectionStatus(int li_Status)
{
if (li_Status)
{
ac_Connect->setChecked(true);
ac_Connect->setText(tr("Trennen"));
}
else
{
ac_Connect->setChecked(false);
ac_Connect->setText(tr("Verbinden"));
}
}
 
void dlg_Main::slot_MK_Version(s_Hardware ls_Version)
{
gs_Version = ls_Version;
setWindowTitle(QA_NAME + " " + QA_VERSION + " - " + ls_Version.Hardware + " " + ls_Version.Version);
}
 
void dlg_Main::slot_MK_NaviData(s_MK_NaviData ps_MK_NaviData)
{
QString Mode = "NC-Flags : ";
if (ps_MK_NaviData.NCFlags & 0x08) {le_Mode->setText(tr("Range Limit")); Mode += "R";}
if (ps_MK_NaviData.NCFlags & 0x10) {le_Mode->setText(tr("Serial Error")); Mode += "S";}
if (ps_MK_NaviData.NCFlags & 0x20) {le_Mode->setText(tr("Target reached")); Mode += "T";}
if (ps_MK_NaviData.NCFlags & 0x40) {le_Mode->setText(tr("Manual Control")); Mode += "M";}
if (ps_MK_NaviData.NCFlags & 0x01) {le_Mode->setText(tr("Free")); Mode += "F";}
if (ps_MK_NaviData.NCFlags & 0x02) {le_Mode->setText(tr("Position Hold")); Mode += "P";}
if (ps_MK_NaviData.NCFlags & 0x04) {le_Mode->setText(tr("Coming Home")); Mode += "C";}
 
le_WP->setText(QString("%1/").arg(ps_MK_NaviData.WaypointIndex) + QString("%1").arg(ps_MK_NaviData.WaypointNumber));
le_WPTime->setText(QString("%1:").arg(ps_MK_NaviData.TargetHoldTime / 60) + (QString("%1").arg(ps_MK_NaviData.TargetHoldTime % 60)).rightJustified(2, '0'));
le_WPDist->setText(QString("%1m").arg(ps_MK_NaviData.TargetPositionDeviation.Distance / 10));
le_HomeDist->setText(QString("%1m").arg(ps_MK_NaviData.HomePositionDeviation.Distance / 10));
le_Sats->setText(QString("%1").arg(ps_MK_NaviData.SatsInUse));
 
add_Position(ps_MK_NaviData);
}
 
void dlg_Main::slot_MK_WayPoint(int pi_WayPointID)
{
if (pi_WayPointID < l_WayPoints.count())
{
send_WayPoints(l_WayPoints, pi_WayPointID + 1);
}
}
///////////////////////////////////////////////////////////////////
// QMK-Maps //
///////////////////////////////////////////////////////////////////
 
// Zoom der Karte ändern
void dlg_Main::slot_Zoom(int t_Zoom)
{
o_Map->setZoom(t_Zoom);
}
 
// Karte wechseln
void dlg_Main::slot_ChangeMap(int t_Set)
{
int zoom = o_Adapter->adaptedZoom();
QPointF a = o_Map->currentCoordinate();
 
o_Map->setZoom(0);
 
switch(t_Set)
{
case 0 : // OpenStreetMap
{
o_Adapter = new OSMMapAdapter();
}
break;
case 1 : // Yahoo Sat
{
o_Adapter = new TileMapAdapter("tile.openaerialmap.org", "/tiles/1.0.0/openaerialmap-900913/%1/%2/%3.png", 256, 0, 17);
}
break;
case 2 : // Google Maps
{
o_Adapter = new GoogleMapAdapter();
}
break;
case 3 : // Google Sat
{
o_Adapter = new GoogleSatMapAdapter();
}
break;
case 4 : // Yahoo Maps
{
o_Adapter = new YahooMapAdapter();
}
break;
case 5 : // Yahoo Sat
{
o_Adapter = new YahooMapAdapter("us.maps3.yimg.com", "/aerial.maps.yimg.com/png?v=1.7&t=a&s=256&x=%2&y=%3&z=%1");
}
break;
}
 
o_Layer->setMapAdapter(o_Adapter);
o_Click->setMapAdapter(o_Adapter);
o_Info->setMapAdapter(o_Adapter);
o_RouteWP->setMapAdapter(o_Adapter);
o_RouteFL->setMapAdapter(o_Adapter);
 
o_Map->updateRequestNew();
o_Map->setZoom(zoom);
}
 
// Click in die Karte
void dlg_Main::slot_Click(const QMouseEvent* Event, const QPointF Coord)
{
if ((Event->type() == QEvent::MouseButtonPress) && ((Event->button() == Qt::RightButton) || (Event->button() == Qt::MidButton)))
{
sl_Zoom->setValue(o_Adapter->adaptedZoom());
}
 
// Überwachen ob Karte verschoben wird
if ((Event->type() == QEvent::MouseButtonPress) && (Event->button() == Qt::LeftButton))
{
MapCenter = o_Map->currentCoordinate();
}
 
// Nur wenn nicht Verschoben dann einen Punkt setzen
if ((Event->type() == QEvent::MouseButtonRelease) && (Event->button() == Qt::LeftButton))
{
if (o_Map->currentCoordinate() == MapCenter)
{
if (l_WayPoints.count() < 20)
{
btn_WPAdd->setEnabled(true);
}
 
o_Click->removeGeometry(ClickPoint);
 
ClickPoint = new CirclePoint(Coord.x(), Coord.y(), 6, "P1", Point::Middle, Pen[2]);
 
 
LastClick = new Point(Coord.x(), Coord.y());
 
ClickPoint->setBaselevel(o_Adapter->adaptedZoom());
o_Click->addGeometry(ClickPoint);
 
// o_Click->removeGeometry(Flag);
// Flag = new ImagePoint(Coord.x(), Coord.y(), ":/Flags/Global/Images/Flags/Target.png", "Start");
// Flag->setBaselevel(o_Adapter->adaptedZoom());
// o_Click->addGeometry(Flag);
 
 
if (cb_Goto->isChecked())
{
send_Target(LastClick);
}
}
}
 
o_Map->updateRequestNew();
// qDebug(QString("%1").arg(Coord.x()).toLatin1().data());
// qDebug(QString("%1").arg(Coord.y()).toLatin1().data());
}
 
// WayPoint zur Liste hinzufügen
void dlg_Main::slot_btn_WPAdd()
{
cb_ShowWPs->setChecked(true);
 
sWayPoint WayPoint;
 
WayPoint.Longitude = LastClick->longitude();
WayPoint.Latitude = LastClick->latitude();
WayPoint.Time = sb_Time->value();
 
l_WayPoints.append(WayPoint);
 
o_RouteWP->removeGeometry(l_RouteWP);
 
p_RouteWP.append(LastClick);
l_RouteWP = new LineString(p_RouteWP, "", Pen[3]);
 
o_RouteWP->addGeometry(l_RouteWP);
o_Map->updateRequestNew();
 
btn_WPFly->setEnabled(true);
 
if (l_WayPoints.count() == 20)
{
QMessageBox::warning(this, QA_NAME,trUtf8("Wegpunkt-Liste ist voll. Es können maximal 20 Wegpunkte benutzt werden."), QMessageBox::Ok);
btn_WPAdd->setEnabled(false);
}
}
 
// WayPoint-Liste übertragen
void dlg_Main::slot_btn_WPFly()
{
send_WayPoints(l_WayPoints, 0);
}
 
// WayPpoint-Liste löschen
void dlg_Main::slot_btn_WPDelete()
{
p_RouteWP.clear();
l_WayPoints.clear();
o_RouteWP->clearGeometries();
l_RouteWP = new LineString(p_RouteWP, "", Pen[0]);
// o_RouteWP->addGeometry(l_RouteWP);
// o_RouteWP->removeGeometry(l_RouteWP);
 
o_Map->updateRequestNew();
 
btn_WPFly->setEnabled(false);
btn_WPAdd->setEnabled(true);
}
 
// WayPoint-Liste laden
void dlg_Main::slot_ac_LoadWayPoints()
{
QString Filename = QFileDialog::getOpenFileName(this, "WayPoint-Route laden", s_Dir.WPRoutes, "Mikrokopter WayPoints(*.mkw);;KML-Datei(*.kml);;Alle Dateien (*)");
 
if (!Filename.isEmpty())
{
if (Filename.endsWith(".kml", Qt::CaseInsensitive))
{
cb_ShowWPs->setChecked(true);
btn_WPFly->setEnabled(true);
 
show_WayPoints(parse_WayPointKML(Filename));
}
if (Filename.endsWith(".mkw", Qt::CaseInsensitive))
{
cb_ShowWPs->setChecked(true);
btn_WPFly->setEnabled(true);
 
show_WayPoints(parse_WayPointMKW(Filename));
}
}
}
 
// WayPoint-Liste speichern
void dlg_Main::slot_ac_SaveRoute()
{
QString Filename = QFileDialog::getSaveFileName(this, "WayPoint-Route speichern", s_Dir.WPRoutes, "Mikrokopter WayPoints(*.mkw);;Alle Dateien (*)");
 
if (!Filename.isEmpty())
{
if (!(Filename.endsWith(".mkw", Qt::CaseInsensitive)))
{
Filename = Filename + QString(".mkw");
}
 
save_WayPointsMKW(Filename);
}
}
 
// Route anzeigen / ausblenden
void dlg_Main::slot_ShowWayPoints(bool Show)
{
if (Show == true)
{
if (l_RouteWP->hasPoints())
{
o_RouteWP->addGeometry(l_RouteWP);
o_Map->updateRequestNew();
}
}
else
{
o_RouteWP->removeGeometry(l_RouteWP);
o_Map->updateRequestNew();
}
}
 
// Bilddatei als Karteladen.
void dlg_Main::slot_ac_LoadMapPic()
{
QString Filename = QFileDialog::getOpenFileName(this, "Bild als Karte", s_Dir.MapPics, "Bilddatei(*.jpg *.png *.gif);;Alle Dateien (*)");
 
if (!Filename.isEmpty())
{
QFile *f_Points = new QFile(Filename + ".pos");
 
if (f_Points->exists())
{
f_Points->open(QIODevice::ReadOnly | QIODevice::Text);
 
QString s_Points;
 
while (!f_Points->atEnd())
{
s_Points.append(f_Points->readLine());
}
 
f_Points->close();
 
QStringList s_Pos = s_Points.split(",");
 
FixedImageOverlay* fip = new FixedImageOverlay(s_Pos[0].toDouble(), s_Pos[1].toDouble(), s_Pos[2].toDouble(), s_Pos[3].toDouble(), Filename);
 
o_Layer->addGeometry(fip);
o_Map->setView(QPointF(((s_Pos[0].toDouble() + s_Pos[2].toDouble()) / 2),((s_Pos[1].toDouble() + s_Pos[3].toDouble()) / 2)));
 
o_Map->updateRequestNew();
}
else
{
dlg_MapPos *f_MapPos = new dlg_MapPos(this);
 
if (f_MapPos->exec()==QDialog::Accepted)
{
QString Data = f_MapPos->get_Data();
 
f_Points->open(QIODevice::ReadWrite | QIODevice::Text);
 
QTextStream out(f_Points);
 
out.setRealNumberPrecision(9);
 
out << Data << "\n";
 
f_Points->close();
 
QStringList s_Pos = Data.split(",");
 
FixedImageOverlay* fip = new FixedImageOverlay(s_Pos[0].toDouble(), s_Pos[1].toDouble(), s_Pos[2].toDouble(), s_Pos[3].toDouble(), Filename);
 
o_Layer->addGeometry(fip);
o_Map->updateRequestNew();
}
 
}
}
}
 
// Flug als KML aufzeichnen
void dlg_Main::slot_ac_Record()
{
if (ac_Record->isChecked())
{
QString f_Name = s_Dir.Flights + "/" + QDate::currentDate().toString(("yyyy-MM-dd")) + "_" + QTime::currentTime().toString("hh-mm");
 
ac_Record->setText(tr("Stoppen"));
 
o_Record = new QFile(f_Name + ".kml");
o_Record->open(QIODevice::Append | QIODevice::Text);
 
QTextStream Out(o_Record);
Out << HandlerKML::get_Header(tr("Mikrokopter Flugaufzeichnung")) << "\n";
 
}
else
{
QTextStream Out(o_Record);
Out << HandlerKML::get_Footer() << "\n";
o_Record->close();
ac_Record->setText(tr("Aufzeichnen"));
}
}
 
// WayPpoint-Liste löschen
void dlg_Main::slot_ac_RouteDelete()
{
p_RouteFL.clear();
l_Track.clear();
o_RouteFL->clearGeometries();
l_RouteFL = new LineString(p_RouteFL, "", Pen[0]);
// o_RouteFL->removeGeometry(l_RouteFL);
 
o_Map->updateRequestNew();
}
 
// Programm Ende
dlg_Main::~dlg_Main()
{
o_Settings->GUI.isMax = isMaximized();
o_Settings->GUI.Size = size();
o_Settings->GUI.Point = pos();
o_Settings->GUI.Toolbar = ac_Toolbar->isChecked();
 
o_Settings->CONFIG.cb_CenterPos = cb_CenterPos->isChecked();
o_Settings->CONFIG.cb_ShowRoute = cb_ShowRoute->isChecked();
o_Settings->CONFIG.cb_ShowWPs = cb_ShowWPs->isChecked();
o_Settings->CONFIG.cb_Goto = cb_Goto->isChecked();
 
o_Settings->NAVI.StayTime = sb_Time->value();
 
o_Settings->write_Settings();
// qDebug("Ende.");
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/Dialogs/dlg_Main.h
0,0 → 1,142
/***************************************************************************
* 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 <QFile>
 
#include "ui_dlg_Main.h"
 
#include "../Defines.h"
#include "../TypeDefs.h"
 
#include "../Classes/cSettings.h"
 
#include "../../Global/Class_QMapControl.h"
 
#include "../../Global/Class_HandlerKML/HandlerKML.h"
 
using namespace qmapcontrol;
 
class dlg_Main : public QMainWindow, public Ui::dlg_Main_UI
{
Q_OBJECT
 
public:
dlg_Main();
~dlg_Main();
void create_Map();
 
private:
 
// Info über die Hardware
s_Hardware gs_Version;
 
// Settings-Object
cSettings *o_Settings;
 
char c_Data[150];
 
// Programm-Initialisirungen
void init_GUI();
void init_Connections();
 
void init_Directorys();
s_Directorys s_Dir;
 
// QMK-Maps
QFile *o_Record;
 
QPen* Pen[6];
 
MapControl *o_Map;
MapAdapter *o_Adapter;
 
Layer *o_Layer;
Layer *o_Click;
 
Layer *o_Info;
Layer *o_RouteWP;
Layer *o_RouteFL;
 
QList<Point*> p_RouteWP;
LineString* l_RouteWP;
 
QList<Point*> p_RouteFL;
LineString* l_RouteFL;
 
Point* LastPos;
Point* LastClick;
Point* ClickPoint;
Point* Flag;
Point* Home;
Point* Target;
 
QPointF MapCenter;
 
QList<sWayPoint> l_WayPoints;
QList<sWayPoint> l_Track;
 
QList<sWayPoint> parse_WayPointKML(QString s_File);
QList<sWayPoint> parse_WayPointMKW(QString s_File);
 
void show_WayPoints(QList<sWayPoint> WayPoints);
 
void save_WayPointsMKW(QString s_File);
 
void add_Position(s_MK_NaviData t_NaviData);
// void show_Data(s_MK_NaviData t_NaviData);
void send_Target(Point *t_Target);
void send_WayPoints(QList<sWayPoint> l_WayPoints, int t_Pos = 0);
 
private slots:
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_NaviData(s_MK_NaviData ps_MK_NaviData);
void slot_MK_WayPoint(int pi_WayPointID);
 
// QMK-Maps
void slot_Zoom(int t_Zoom);
void slot_ChangeMap(int);
void slot_Click(const QMouseEvent*, const QPointF);
 
void slot_btn_WPAdd();
void slot_btn_WPFly();
void slot_btn_WPDelete();
void slot_ShowWayPoints(bool);
 
void slot_ac_RouteDelete();
 
void slot_ac_LoadMapPic();
void slot_ac_Record();
 
void slot_ac_LoadWayPoints();
void slot_ac_SaveRoute();
 
protected:
virtual void wheelEvent(QWheelEvent *event);
virtual void resizeEvent ( QResizeEvent * event );
 
};
 
#endif // DLG_MAIN_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/Dialogs/dlg_Main.ui
0,0 → 1,720
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_Main_UI</class>
<widget class="QMainWindow" name="dlg_Main_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>729</width>
<height>367</height>
</rect>
</property>
<property name="windowTitle">
<string>QMK</string>
</property>
<property name="windowIcon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Maps.png</normaloff>:/Icon/Global/Images/Icons/QMK-Maps.png</iconset>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0" colspan="2">
<widget class="wgt_Connection" name="wg_Connection" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>WP:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_WP">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>50</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_WPTime">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_WPDist">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>Home:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_HomeDist">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>Mode:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_Mode">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Sats:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="le_Sats">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>138</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="1" rowspan="3">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Route</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Verweilzeit</string>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QSpinBox" name="sb_Time">
<property name="maximum">
<number>300</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Sek.</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="btn_WPAdd">
<property name="text">
<string>hinzufügen</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="btn_WPFly">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>abfliegen</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QPushButton" name="btn_WPDelete">
<property name="text">
<string>löschen</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_4">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="2" column="0">
<widget class="QCheckBox" name="cb_ShowWPs">
<property name="text">
<string>ausgewählte
Route anzeigen</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="cb_CenterPos">
<property name="text">
<string>auf IST-Position
zentrieren</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cb_ShowRoute">
<property name="text">
<string>geflogene
Route anzeigen</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QFrame" name="w_Map">
<property name="minimumSize">
<size>
<width>0</width>
<height>250</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>2</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="l_Map"/>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QFrame" name="frame_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="margin">
<number>2</number>
</property>
<item row="0" column="1">
<widget class="QSlider" name="sl_Zoom">
<property name="maximum">
<number>18</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::NoTicks</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Zoom:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="cb_Goto">
<property name="text">
<string>Position bei Click Anfliegen</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QComboBox" name="cb_Maps">
<property name="enabled">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>OpenStreetMap</string>
</property>
</item>
<item>
<property name="text">
<string>OpenAerialMap</string>
</property>
</item>
<item>
<property name="text">
<string>Google: Map</string>
</property>
</item>
<item>
<property name="text">
<string>Google: Satellit</string>
</property>
</item>
<item>
<property name="text">
<string>Yahoo: Map </string>
</property>
</item>
<item>
<property name="text">
<string>Yahoo: Satellit</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>729</width>
<height>19</height>
</rect>
</property>
<widget class="QMenu" name="menu_Preferences">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title">
<string>Einstellungen</string>
</property>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>Hilfe</string>
</property>
<addaction name="ac_About"/>
</widget>
<widget class="QMenu" name="menuExtras">
<property name="title">
<string>Extras</string>
</property>
<addaction name="ac_RouteDelete"/>
</widget>
<widget class="QMenu" name="menuAnsicht">
<property name="title">
<string>Ansicht</string>
</property>
<addaction name="ac_Toolbar"/>
</widget>
<widget class="QMenu" name="menu_Program">
<property name="title">
<string>Programm</string>
</property>
<addaction name="ac_Quit"/>
<addaction name="ac_Connect"/>
</widget>
<addaction name="menu_Program"/>
<addaction name="menuAnsicht"/>
<addaction name="menu_Preferences"/>
<addaction name="menuExtras"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QToolBar" name="ToolBar">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="allowedAreas">
<set>Qt::LeftToolBarArea</set>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="floatable">
<bool>false</bool>
</property>
<attribute name="toolBarArea">
<enum>LeftToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="ac_Connect"/>
<addaction name="separator"/>
<addaction name="ac_LoadRoute"/>
<addaction name="ac_SaveRoute"/>
<addaction name="separator"/>
<addaction name="ac_LoadMap"/>
<addaction name="separator"/>
<addaction name="ac_Record"/>
<addaction name="separator"/>
</widget>
<widget class="QToolBar" name="tb_More">
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="allowedAreas">
<set>Qt::LeftToolBarArea</set>
</property>
<attribute name="toolBarArea">
<enum>LeftToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<action name="ac_Quit">
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Exit.png</normaloff>:/Actions/Global/Images/Actions/Exit.png</iconset>
</property>
<property name="text">
<string>Beenden</string>
</property>
</action>
<action name="ac_About">
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Maps.png</normaloff>:/Icon/Global/Images/Icons/QMK-Maps.png</iconset>
</property>
<property name="text">
<string>Über QMK-Maps</string>
</property>
</action>
<action name="ac_Connect">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Connection-NO.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Connection-OK.png</normalon>:/Actions/Global/Images/Actions/Connection-NO.png</iconset>
</property>
<property name="text">
<string>Verbinden</string>
</property>
</action>
<action name="ac_LoadRoute">
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Load.png</normaloff>:/Actions/Global/Images/Actions/Load.png</iconset>
</property>
<property name="text">
<string>Route Laden</string>
</property>
</action>
<action name="ac_SaveRoute">
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Save.png</normaloff>:/Actions/Global/Images/Actions/Save.png</iconset>
</property>
<property name="text">
<string>Route Speichern</string>
</property>
</action>
<action name="ac_LoadMap">
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Load-Map.png</normaloff>:/Actions/Global/Images/Actions/Load-Map.png</iconset>
</property>
<property name="text">
<string>Karte laden</string>
</property>
</action>
<action name="ac_Record">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../QMK-Maps.qrc">
<normaloff>:/Actions/Global/Images/Actions/Log-Record.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Log-Stop.png</normalon>:/Actions/Global/Images/Actions/Log-Record.png</iconset>
</property>
<property name="text">
<string>Aufzeichnen</string>
</property>
<property name="toolTip">
<string>Flug aufzeichnen</string>
</property>
</action>
<action name="ac_RouteDelete">
<property name="text">
<string>Geflogene Route löschen</string>
</property>
</action>
<action name="ac_Toolbar">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Toolbar</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>wgt_Connection</class>
<extends>QWidget</extends>
<header>wgt_Connection.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../QMK-Maps.qrc"/>
</resources>
<connections>
<connection>
<sender>ac_Quit</sender>
<signal>triggered()</signal>
<receiver>dlg_Main_UI</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>182</x>
<y>88</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/Dialogs/dlg_MapPos.cpp
0,0 → 1,29
/***************************************************************************
* 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. *
***************************************************************************/
#include "dlg_MapPos.h"
 
dlg_MapPos::dlg_MapPos(QWidget *parent) : QDialog(parent)
{
setupUi(this);
}
 
QString dlg_MapPos::get_Data()
{
return QString(le_Links->text().replace(",", ".") + ", " + le_Oben->text().replace(",", ".") + ", " + le_Rechts->text().replace(",", ".") + ", " + le_Unten->text().replace(",", "."));
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/Dialogs/dlg_MapPos.h
0,0 → 1,35
/***************************************************************************
* 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_MAPPOS_H
#define DLG_MAPPOS_H
 
#include <QDialog>
 
#include "ui_dlg_MapPos.h"
 
class dlg_MapPos : public QDialog, public Ui::dlg_MapPos_UI
{
Q_OBJECT
 
public:
dlg_MapPos(QWidget *parent = 0);
QString get_Data();
};
 
#endif // DLG_MAPPOS_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/Dialogs/dlg_MapPos.ui
0,0 → 1,162
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_MapPos_UI</class>
<widget class="QDialog" name="dlg_MapPos_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>376</width>
<height>129</height>
</rect>
</property>
<property name="windowTitle">
<string>Karten-Positionen</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>116</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="le_Oben"/>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>116</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLineEdit" name="le_Links"/>
</item>
<item row="1" column="1">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>115</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2" colspan="2">
<widget class="QLineEdit" name="le_Rechts"/>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>116</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="le_Unten"/>
</item>
<item row="2" column="3">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>116</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pb_Save">
<property name="text">
<string>Speichern</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Abbrechen</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>pb_Save</sender>
<signal>clicked()</signal>
<receiver>dlg_MapPos_UI</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>227</x>
<y>109</y>
</hint>
<hint type="destinationlabel">
<x>108</x>
<y>100</y>
</hint>
</hints>
</connection>
<connection>
<sender>pushButton</sender>
<signal>clicked()</signal>
<receiver>dlg_MapPos_UI</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>340</x>
<y>112</y>
</hint>
<hint type="destinationlabel">
<x>339</x>
<y>65</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/QMK-Maps.pro
0,0 → 1,33
# -------------------------------------------------
# Project created by QtCreator 2009-07-20T20:04:00
# -------------------------------------------------
 
include(../Global/Class_QMapControl.pri)
include(../Global/Widget_Connection.pri)
 
QT += network \
xml
TARGET = QMK-Maps
TEMPLATE = app
DESTDIR = ../Binary
debug:DEFINES += _BETA_
OBJECTS_DIR = ../Binary/.build/QMK-Maps
UI_DIR = ../Binary/.build/QMK-Maps
MOC_DIR = ../Binary/.build/QMK-Maps
RCC_DIR = ../Binary/.build/QMK-Maps
RESOURCES += QMK-Maps.qrc
SOURCES += main.cpp \
Dialogs/dlg_Main.cpp \
Dialogs/dlg_MapPos.cpp \
Classes/cSettings.cpp \
../Global/Class_HandlerKML/HandlerKML.cpp
HEADERS += Defines.h \
../Global/Global.h \
../Global/Class_QMapControl.h \
Dialogs/dlg_Main.h \
Dialogs/dlg_MapPos.h \
Classes/cSettings.h \
TypeDefs.h \
../Global/Class_HandlerKML/HandlerKML.h
FORMS += Dialogs/dlg_Main.ui \
Dialogs/dlg_MapPos.ui
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/QMK-Maps.qrc
0,0 → 1,23
<RCC>
<qresource prefix="Icon" >
<file>../Global/Images/Icons/QMK-Maps.png</file>
</qresource>
<qresource prefix="Flags" >
<file>../Global/Images/Flags/Target.png</file>
<file>../Global/Images/Flags/flag-black.png</file>
<file>../Global/Images/Flags/flag-blue.png</file>
<file>../Global/Images/Flags/flag-green.png</file>
<file>../Global/Images/Flags/flag-red.png</file>
<file>../Global/Images/Flags/flag-yellow.png</file>
</qresource>
<qresource prefix="Actions" >
<file>../Global/Images/Actions/Log-Record.png</file>
<file>../Global/Images/Actions/Log-Stop.png</file>
<file>../Global/Images/Actions/Load-Map.png</file>
<file>../Global/Images/Actions/Save.png</file>
<file>../Global/Images/Actions/Load.png</file>
<file>../Global/Images/Actions/Exit.png</file>
<file>../Global/Images/Actions/Connection-NO.png</file>
<file>../Global/Images/Actions/Connection-OK.png</file>
</qresource>
</RCC>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/TypeDefs.h
0,0 → 1,32
/***************************************************************************
* 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 TYPEDEFS_H
#define TYPEDEFS_H
 
#include <QString>
 
struct sWayPoint
{
double Longitude;
double Latitude;
double Altitude;
int Time;
};
 
#endif // TYPEDEFS_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Maps/main.cpp
0,0 → 1,38
/***************************************************************************
* 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. *
***************************************************************************/
 
#include <QtGui/QApplication>
#include "Dialogs/dlg_Main.h"
 
int main(int argc, char *argv[])
{
QApplication App(argc, argv);
 
dlg_Main *MainApp = new dlg_Main();
 
MainApp->show();
 
MainApp->create_Map();
 
int iReturn = App.exec();
 
delete MainApp;
 
return iReturn;
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Scope/Classes/cSettings.cpp
0,0 → 1,110
/***************************************************************************
* 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. *
***************************************************************************/
#include <QSettings>
#include <QDir>
 
#include "cSettings.h"
 
cSettings::cSettings()
{
Settings_ID = 1;
 
read_Settings();
}
 
void cSettings::read_DebugLabels(int ID)
{
QBitArray Def_View;
Def_View.fill(true,MAX_DebugData);
 
QString Hardware = HardwareType[ID];
 
QSettings Setting("QMK", "Debug-Labels");
 
Setting.beginGroup("Debug-Labels-" + Hardware);
 
DebugData.Version = Setting.value(("Version"), "0").toString();
for (int a=0; a<MAX_DebugData; a++)
{
DebugData.Label[a] = Setting.value(("Label_" + QString("%1").arg(a)), "-" + DEF_DebugNames[a]).toString();
}
DebugData.Show_Plotter = Setting.value("Show_Plotter", QBitArray(Def_View)).value<QBitArray>();
 
Setting.endGroup();
}
 
void cSettings::write_DebugLabels(int ID)
{
QString Hardware = HardwareType[ID];
 
QSettings Setting("QMK", "Debug-Labels");
 
Setting.beginGroup("Debug-Labels-" + Hardware);
 
Setting.setValue("Version", DebugData.Version);
for (int a=0; a<MAX_DebugData; a++)
{
Setting.setValue("Label_" + QString("%1").arg(a), DebugData.Label[a]);
}
Setting.setValue("Show_Plotter", QBitArray(DebugData.Show_Plotter));
 
Setting.endGroup();
}
 
void cSettings::read_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Settings_ID = Setting.value("Settings ID", Settings_ID).toInt();
Setting.endGroup();
 
Setting.beginGroup("DATA");
// DATA.Debug_Intervall = Setting.value("Debug-Intervall", 500).toInt();
DATA.Plotter_Count = Setting.value("Plotter-Count", 100).toInt();
Setting.endGroup();
 
Setting.beginGroup("GUI");
GUI.isMax = Setting.value("IsMax",false).toBool();
GUI.Size = Setting.value("Size", QSize(700, 300)).toSize();
GUI.Point = Setting.value("Point",QPoint(1,1)).toPoint();
Setting.endGroup();
}
 
void cSettings::write_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Setting.setValue("Settings ID", Settings_ID);
Setting.endGroup();
 
Setting.beginGroup("DATA");
Setting.setValue("Plotter-Count", DATA.Plotter_Count);
// Setting.setValue("Debug-Intervall", DATA.Debug_Intervall);
Setting.endGroup();
 
Setting.beginGroup("GUI");
Setting.setValue("IsMax", GUI.isMax);
Setting.setValue("Size", GUI.Size);
Setting.setValue("Point", GUI.Point);
Setting.endGroup();
}
 
 
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Scope/Classes/cSettings.h
0,0 → 1,68
/***************************************************************************
* 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 CSETTINGS_H
#define CSETTINGS_H
 
#include <QBitArray>
#include <QSize>
#include <QPoint>
 
#include "../../Global/Kopter.h"
#include "../Defines.h"
 
struct set_DebugData
{
QString Version;
QString Label[MAX_DebugData];
QBitArray Show_Plotter;
};
 
struct set_GUI
{
bool isMax;
QSize Size;
QPoint Point;
};
 
struct set_DATA
{
int Plotter_Count;
};
 
class cSettings
{
public:
cSettings();
 
int Settings_ID;
 
set_GUI GUI;
set_DebugData DebugData;
set_DATA DATA;
 
void read_DebugLabels(int ID);
void write_DebugLabels(int ID);
 
void read_Settings();
void write_Settings();
 
 
};
 
#endif // CSETTINGS_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Scope/Defines.h
0,0 → 1,54
/***************************************************************************
* 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 DEFINES_H
#define DEFINES_H
 
#include <QString>
#include "../Global/Global.h"
#include "../Global/Kopter.h"
 
static const QString QA_NAME = "QMK-Scope";
static const QString QA_VERSION_NR = "1.3.0";
 
#ifdef _BETA_
static const QString QA_VERSION = QA_VERSION_NR + " (BETA)";
#else
static const QString QA_VERSION = QA_VERSION_NR;
#endif
 
static const QString QA_DATE = "24.08.2010";
static const QString QA_YEAR = "2008-2010";
 
static const QString QA_ABOUT =
"<HTML>"
"<p><b><font size=8>" + QA_NAME + "</font></b></p>"
"<br />"
"Version " + QA_VERSION + " - " + QA_DATE + " on " + QA_OS + ""
"<br /><br /><b>kompatibel zu " + QA_HWVERSION + "</b>"
"<br /><br />"
"(C) " + QA_YEAR + " by " + QA_AUTHOR + " - "
"<a href=\"mailto:" + QA_EMAIL + "\">" + QA_EMAIL + "</a> <br /><br />"
"Groundstation-Programm f&uuml;r den Mikrokopter<br /><br />"
"QMK-Scope - Datenplotter und Debugdaten-Anzeige.<br /><br /> "
"Dieses Programm wird unter den Bedingungen der GPL v2 ver&ouml;ffentlicht."
"</HTML>";
 
static const QString DataFields = "VAD";
 
#endif // DEFINES_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Scope/Dialogs/dlg_Main.cpp
0,0 → 1,298
/***************************************************************************
* 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. *
***************************************************************************/
 
#include <QMessageBox>
#include <QCryptographicHash>
 
#include "dlg_Main.h"
 
// Konstruktor Main-Form
dlg_Main::dlg_Main()
{
setupUi(this);
 
 
o_Settings = new cSettings();
 
o_Settings->read_DebugLabels(0);
 
wg_Connection->set_Client(ID_SCOPE, QA_NAME + " " + QA_VERSION, DataFields);
 
init_GUI();
init_Connections();
init_Plotter();
}
 
// Grafische Oberfläche initialisieren
void dlg_Main::init_GUI()
{
setWindowTitle(QA_NAME + " " + QA_VERSION);
 
resize(o_Settings->GUI.Size);
move(o_Settings->GUI.Point);
 
if (o_Settings->GUI.isMax)
{
showMaximized();
}
 
wg_Connection->set_SelectVisible(true);
wg_Connection->set_ButtonVisible(true);
 
btn_Start->setCheckable(true);
 
for(int z = 0; z < MAX_DebugData; z++)
{
wg_Index[z] = new wgt_Index();
verticalLayout->addWidget(wg_Index[z]);
 
wg_Index[z]->set_Name(o_Settings->DebugData.Label[z]);
wg_Index[z]->set_StyleSheet("color: " + QColor(DEF_DebugColors[z]).name() + ";");
 
connect(wg_Index[z], SIGNAL(sig_Clicked()), this, SLOT(slot_btn_ChoseOK()));
}
}
 
// Signale mit Slots verbinden
void dlg_Main::init_Connections()
{
connect(ac_Connect, SIGNAL(triggered()), wg_Connection, SLOT(slot_btn_Connect()));
 
connect(ac_ReadLabels, SIGNAL(triggered()), this, SLOT(slot_ac_ReadLabels()));
 
connect(Plotter_Scroll, SIGNAL(valueChanged(int)), this, SLOT(slot_Plotter_Scroll(int)));
 
connect(btn_Start, SIGNAL(clicked()), this, SLOT(slot_Plotter_Start()));
// connect(btn_ChoseOK, SIGNAL(clicked()), this, SLOT(slot_btn_ChoseOK()));
 
// About QMK-Kernel & About-QT Dialog einfügen
connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About()));
menu_Help->addAction(trUtf8("Über &Qt"), qApp, SLOT(aboutQt()));
 
connect(wg_Connection, SIGNAL(sig_Status(int)), this, SLOT(slot_ConnectionStatus(int)));
connect(wg_Connection, SIGNAL(sig_MK_Version(s_Hardware)), this, SLOT(slot_MK_Version(s_Hardware)));
connect(wg_Connection, SIGNAL(sig_MK_Debug(s_MK_Debug)), this, SLOT(slot_MK_Debug(s_MK_Debug)));
connect(wg_Connection, SIGNAL(sig_MK_DebugLabels(s_MK_DebugLabels)), this, SLOT(slot_MK_DebugLabels(s_MK_DebugLabels)));
}
 
void dlg_Main::init_Plotter()
{
NextPlot = 0;
 
qwt_Plotter->setCanvasBackground(QColor(QRgb(0x00000000)));
 
// qwt_Plotter->insertLegend(new QwtLegend(), QwtPlot::RightLegend);
 
QwtPlotGrid *Grid = new QwtPlotGrid();
Grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine));
 
Grid->attach(qwt_Plotter);
 
qwt_Plotter->setAxisScale(QwtPlot::xBottom,0,o_Settings->DATA.Plotter_Count,0);
 
for (int a = 0; a < MAX_DebugData; a++)
{
Plot[a] = new QwtPlotCurve(o_Settings->DebugData.Label[a]);
Plot[a]->setPen(QPen(QColor(DEF_DebugColors[a])));
Plot[a]->setRenderHint(QwtPlotItem::RenderAntialiased);
 
if (o_Settings->DebugData.Show_Plotter[a])
Plot[a]->attach(qwt_Plotter);
}
qwt_Plotter->replot();
 
 
}
 
void dlg_Main::update_Plotter()
{
pl_ID[NextPlot] = NextPlot;
 
for (int a = 0; a < MAX_DebugData; a++)
{
pl_Data[a][NextPlot] = Debug_Data[a];
Plot[a]->setData(pl_ID,pl_Data[a],NextPlot);
}
 
NextPlot++;
 
if ((NextPlot > o_Settings->DATA.Plotter_Count))
{
Plotter_Scroll->setMaximum(NextPlot - o_Settings->DATA.Plotter_Count);
}
 
if ((Plotter_Scroll->value() == NextPlot - (o_Settings->DATA.Plotter_Count + 1)))
{
qwt_Plotter->setAxisScale(QwtPlot::xBottom,NextPlot - o_Settings->DATA.Plotter_Count,NextPlot,0);
Plotter_Scroll->setValue(NextPlot - o_Settings->DATA.Plotter_Count);
}
 
qwt_Plotter->replot();
}
 
void dlg_Main::config_Plotter()
{
qwt_Plotter->setAxisScale(QwtPlot::xBottom,0,o_Settings->DATA.Plotter_Count,0);
 
for (int a = 0; a < MAX_DebugData; a++)
{
Plot[a]->detach();
Plot[a]->setPen(QPen(QColor(DEF_DebugColors[a])));
 
if (o_Settings->DebugData.Show_Plotter[a])
{
// Plot[a]->setTitle(o_Settings->DebugData.Label[a]);
Plot[a]->attach(qwt_Plotter);
}
}
qwt_Plotter->replot();
}
 
void dlg_Main::slot_Plotter_Scroll(int Position)
{
qwt_Plotter->setAxisScale(QwtPlot::xBottom,Position,Position + o_Settings->DATA.Plotter_Count,0);
qwt_Plotter->replot();
}
 
///////////
// Slots //
///////////
 
// About-Dialog
void dlg_Main::slot_ac_About()
{
QMessageBox::about(this, trUtf8(("Über ")) + QA_NAME, QA_ABOUT);
}
 
void dlg_Main::slot_ConnectionStatus(int li_Status)
{
if (li_Status)
{
ac_Connect->setChecked(true);
ac_Connect->setText(tr("Trennen"));
}
else
{
ac_Connect->setChecked(false);
ac_Connect->setText(tr("Verbinden"));
}
}
 
void dlg_Main::slot_MK_Version(s_Hardware ls_Version)
{
gs_Version = ls_Version;
setWindowTitle(QA_NAME + " " + QA_VERSION + " - " + ls_Version.Hardware + " " + ls_Version.Version);
 
o_Settings->read_DebugLabels(gs_Version.ID);
 
if (o_Settings->DebugData.Version != gs_Version.Version)
{
qDebug(QString("Debug-Labels unterschiedlich. Neue anforden. " + o_Settings->DebugData.Version + " <> " + gs_Version.Version).toLatin1().data());
usleep(50000);
 
slot_ac_ReadLabels();
}
else
{
for(int z = 0; z < MAX_DebugData; z++)
{
wg_Index[z]->set_Name(o_Settings->DebugData.Label[z]);
wg_Index[z]->set_Checked(o_Settings->DebugData.Show_Plotter[z]);
 
}
config_Plotter();
}
}
 
void dlg_Main::slot_MK_Debug(s_MK_Debug ls_Debug)
{
gs_Debug = ls_Debug;
 
for (int z = 0; z < MAX_DebugData; z++)
{
Debug_Data[z] = ls_Debug.Analog[z];
 
wg_Index[z]->set_Wert(QString("%1").arg(Debug_Data[z]));
}
if (btn_Start->isChecked())
{
update_Plotter();
}
}
 
void dlg_Main::slot_MK_DebugLabels(s_MK_DebugLabels MK_DebugLabels)
{
if (MK_DebugLabels.Position < 32)
{
o_Settings->DebugData.Label[MK_DebugLabels.Position] = MK_DebugLabels.Text;
if (o_Settings->DebugData.Label[MK_DebugLabels.Position] == "")
{
o_Settings->DebugData.Label[MK_DebugLabels.Position] = "Debug-" + QString("%1").arg(MK_DebugLabels.Position);
}
// cb_Debug[MK_DebugLabels.Position]->setText("" + o_Settings->DebugData.Label[MK_DebugLabels.Position]);
wg_Index[MK_DebugLabels.Position]->set_Name("" + o_Settings->DebugData.Label[MK_DebugLabels.Position]);
// wg_Index[z]->set_Checked(o_Settings->DebugData.Show_Plotter[z]);
 
 
}
if (MK_DebugLabels.Position == 31)
{
o_Settings->DebugData.Version = gs_Version.Version;
o_Settings->write_DebugLabels(gs_Version.ID);
config_Plotter();
}
}
 
void dlg_Main::slot_Plotter_Start()
{
if (btn_Start->isChecked())
{
btn_Start->setText(tr("Plotter stoppen"));
}
else
{
btn_Start->setText(tr("Plotter starten"));
}
}
 
void dlg_Main::slot_btn_ChoseOK()
{
for(int z = 0; z < MAX_DebugData; z++)
{
o_Settings->DebugData.Show_Plotter[z] = wg_Index[z]->get_Checked();
}
config_Plotter();
o_Settings->write_DebugLabels(gs_Version.ID);
}
 
void dlg_Main::slot_ac_ReadLabels()
{
c_Data[0] = 0;
wg_Connection->send_Data(HandlerMK::make_Frame('a', ADDRESS_ALL, c_Data, 1).toLatin1().data(), DATA_READ_LABEL);
}
 
// Programm Ende
dlg_Main::~dlg_Main()
{
o_Settings->GUI.isMax = isMaximized();
o_Settings->GUI.Size = size();
o_Settings->GUI.Point = pos();
 
o_Settings->write_Settings();
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Scope/Dialogs/dlg_Main.h
0,0 → 1,106
/***************************************************************************
* 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 <QtGui/QLineEdit>
#include <QtGui/QCheckBox>
#include <QtGui/QLabel>
#include <QtGui/QFont>
 
#include <QTcpServer>
#include <QTcpSocket>
 
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <qwt_legend.h>
#include <qwt_plot.h>
 
#include "ui_dlg_Main.h"
 
#include "wgt_Index.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:
// Settings-Object
cSettings *o_Settings;
 
wgt_Index *wg_Index[MAX_DebugData];
 
// Info über die Hardware
s_Hardware gs_Version;
 
// Datenspeicher zum Senden.
char c_Data[150];
 
s_MK_Debug gs_Debug;
 
int Debug_Data[MAX_DebugData];
 
// Plots für die Analogwerte
QwtPlotCurve *Plot[MAX_DebugData];
 
// Datenspeicher für die Plots
double pl_Data[MAX_DebugData][50000];
double pl_ID[50000];
int NextPlot;
 
// Programm-Initialisirungen
void init_GUI();
void init_Connections();
void init_Plotter();
 
void update_Plotter();
void config_Plotter();
 
private slots:
void slot_ac_About();
 
void slot_ConnectionStatus(int li_Status);
void slot_MK_Version(s_Hardware ls_Version);
void slot_MK_Debug(s_MK_Debug ls_Debug);
void slot_MK_DebugLabels(s_MK_DebugLabels MK_DebugLabels);
 
// void slot_ac_Plotter();
// void slot_ac_Debug();
// void slot_ac_Chose();
 
void slot_ac_ReadLabels();
 
void slot_btn_ChoseOK();
 
void slot_Plotter_Start();
void slot_Plotter_Scroll(int Position);
};
 
#endif // DLG_MAIN_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Scope/Dialogs/dlg_Main.ui
0,0 → 1,274
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_Main_UI</class>
<widget class="QMainWindow" name="dlg_Main_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>794</width>
<height>366</height>
</rect>
</property>
<property name="windowTitle">
<string>QMK-Scope</string>
</property>
<property name="windowIcon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Scope.png</normaloff>:/Icon/Global/Images/Icons/QMK-Scope.png</iconset>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QScrollBar" name="Plotter_Scroll">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_Start">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Plotter starten</string>
</property>
<property name="icon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Actions/Global/Images/Actions/Plotter-NO.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Plotter-OK.png</normalon>:/Actions/Global/Images/Actions/Plotter-NO.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="wgt_Connection" name="wg_Connection" native="true"/>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>582</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QwtPlot" name="qwt_Plotter"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="frame_Index">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea">
<property name="minimumSize">
<size>
<width>170</width>
<height>0</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>170</width>
<height>274</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: #000000;
</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
<zorder>wg_Connection</zorder>
<zorder></zorder>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>794</width>
<height>19</height>
</rect>
</property>
<widget class="QMenu" name="menu_Program">
<property name="title">
<string>Programm</string>
</property>
<addaction name="ac_Quit"/>
<addaction name="ac_Connect"/>
</widget>
<widget class="QMenu" name="menu_Preferences">
<property name="title">
<string>Einstellungen</string>
</property>
<addaction name="ac_ReadLabels"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>Hilfe</string>
</property>
<addaction name="ac_About"/>
</widget>
<addaction name="menu_Program"/>
<addaction name="menu_Preferences"/>
<addaction name="menu_Help"/>
</widget>
<action name="ac_Quit">
<property name="icon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Actions/Global/Images/Actions/Exit.png</normaloff>:/Actions/Global/Images/Actions/Exit.png</iconset>
</property>
<property name="text">
<string>Beenden</string>
</property>
</action>
<action name="ac_About">
<property name="icon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Scope.png</normaloff>:/Icon/Global/Images/Icons/QMK-Scope.png</iconset>
</property>
<property name="text">
<string>Über QMK-Scope</string>
</property>
</action>
<action name="ac_Connect">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="../QMK-Scope.qrc">
<normaloff>:/Actions/Global/Images/Actions/Connection-NO.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Connection-OK.png</normalon>:/Actions/Global/Images/Actions/Connection-NO.png</iconset>
</property>
<property name="text">
<string>Verbinden</string>
</property>
</action>
<action name="ac_ReadLabels">
<property name="text">
<string>Analoglabels auslesen</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QwtPlot</class>
<extends>QFrame</extends>
<header>qwt_plot.h</header>
</customwidget>
<customwidget>
<class>wgt_Connection</class>
<extends>QWidget</extends>
<header>wgt_Connection.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../QMK-Scope.qrc"/>
</resources>
<connections>
<connection>
<sender>ac_Quit</sender>
<signal>triggered()</signal>
<receiver>dlg_Main_UI</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>182</x>
<y>88</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Scope/QMK-Scope.pro
0,0 → 1,71
# -------------------------------------------------
# Project created by QtCreator 2009-07-20T20:04:00
# -------------------------------------------------
include(../Global/Widget_Connection.pri)
QT += network
TARGET = QMK-Scope
TEMPLATE = app
win32 {
include( C:\Qt\qwt-5.2.0\examples\examples.pri )
QWT_ROOT = c:\qt\qwt-5.2.0
include( $${QWT_ROOT}\qwtconfig.pri )
SUFFIX_STR = $${RELEASE_SUFFIX}
INCLUDEPATH += $${QWT_ROOT}/src
DEPENDPATH += $${QWT_ROOT}/src
QWTLIB = qwt$${SUFFIX_STR}
contains(CONFIG, QwtDll)
{
DEFINES += QT_DLL \
QWT_DLL
QWTLIB = $${QWTLIB}$${VER_MAJ}
}
win32-msvc:LIBS += $${QWT_ROOT}/lib/$${QWTLIB}.lib
win32-msvc.net:LIBS += $${QWT_ROOT}/lib/$${QWTLIB}.lib
win32-msvc2005:LIBS += $${QWT_ROOT}/lib/$${QWTLIB}.lib
win32-g++:LIBS += -L$${QWT_ROOT}/lib \
-l$${QWTLIB}
}
DESTDIR = ../Binary
OBJECTS_DIR = ../Binary/.build/QMK-Scope
UI_DIR = ../Binary/.build/QMK-Scope
MOC_DIR = ../Binary/.build/QMK-Scope
RCC_DIR = ../Binary/.build/QMK-Scope
debug {
DEFINES += _BETA_
LIBS += -lqwt
INCLUDEPATH += $(HOME)/include \
/usr/include/qwt
}
Suse {
LIBS += -lqwt
INCLUDEPATH += $(HOME)/include \
/usr/include/qwt
}
Debian {
LIBS += -lqwt-qt4
INCLUDEPATH += $(HOME)/include \
/usr/include/qwt-qt4
}
Gentoo {
LIBS += -lqwt
INCLUDEPATH += $(HOME)/include \
/usr/include/qwt5
}
OSX {
LIBS += -L/opt/local/lib \
-lqwt
INCLUDEPATH += /opt/local/include
}
RESOURCES += QMK-Scope.qrc
SOURCES += main.cpp \
Dialogs/dlg_Main.cpp \
Classes/cSettings.cpp \
Dialogs/wgt_Index.cpp
HEADERS += Defines.h \
../Global/Global.h \
Dialogs/dlg_Main.h \
Classes/cSettings.h \
TypeDefs.h \
Dialogs/wgt_Index.h
FORMS += Dialogs/dlg_Main.ui \
Dialogs/wgt_Index.ui
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Scope/QMK-Scope.qrc
0,0 → 1,14
<RCC>
<qresource prefix="Icon" >
<file>../Global/Images/Icons/QMK-Scope.png</file>
</qresource>
<qresource prefix="Actions" >
<file>../Global/Images/Actions/Exit.png</file>
<file>../Global/Images/Actions/Plotter-NO.png</file>
<file>../Global/Images/Actions/Plotter-OK.png</file>
<file>../Global/Images/Actions/Preferences-Data.png</file>
<file>../Global/Images/Actions/Connection-NO.png</file>
<file>../Global/Images/Actions/Debug.png</file>
<file>../Global/Images/Actions/Connection-OK.png</file>
</qresource>
</RCC>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Scope/TypeDefs.h
0,0 → 1,27
/***************************************************************************
* 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 TYPEDEFS_H
#define TYPEDEFS_H
 
#include <QString>
#include <QRgb>
 
static const QRgb DEF_DebugColors[] = {0x00FF0000, 0x0000FF00, 0x00FFFF00, 0x000000FF, 0x00FF00FF, 0x0000FFFF, 0x00FFFFFF, 0x00AA0000, 0x0000AA00, 0x00AAAA00, 0x000000AA, 0x00AA00AA, 0x0000AA, 0x00AAAAAA, 0x00990000, 0x00009900, 0x00999900, 0x00000099, 0x00990099, 0x00009999, 0x00999999, 0x00CC0000, 0x0000CC00, 0x00CCCC00, 0x000000CC, 0x00CC00CC, 0x0000CCCC, 0x00CCCCCC, 0x0066FF99, 0x009966FF, 0x00FF9966, 0x0099FF66};
 
#endif // TYPEDEFS_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Scope/main.cpp
0,0 → 1,36
/***************************************************************************
* 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. *
***************************************************************************/
 
#include <QtGui/QApplication>
#include "Dialogs/dlg_Main.h"
 
int main(int argc, char *argv[])
{
QApplication App(argc, argv);
 
dlg_Main *MainApp = new dlg_Main();
 
MainApp->show();
 
int iReturn = App.exec();
 
delete MainApp;
 
return iReturn;
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Classes/cSettings.cpp
0,0 → 1,61
/***************************************************************************
* 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. *
***************************************************************************/
#include <QSettings>
#include <QDir>
 
#include "cSettings.h"
 
cSettings::cSettings()
{
Settings_ID = 1;
 
read_Settings();
}
 
void cSettings::read_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Settings_ID = Setting.value("Settings ID", Settings_ID).toInt();
Setting.endGroup();
 
Setting.beginGroup("GUI");
GUI.isMax = Setting.value("IsMax",false).toBool();
GUI.Size = Setting.value("Size", QSize(500, 350)).toSize();
GUI.Point = Setting.value("Point",QPoint(1,1)).toPoint();
GUI.Toolbar = Setting.value("Toolbar",true).toBool();
Setting.endGroup();
}
 
void cSettings::write_Settings()
{
QSettings Setting("QMK", QA_NAME);
 
Setting.beginGroup("Global");
Setting.setValue("Settings ID", Settings_ID);
Setting.endGroup();
 
Setting.beginGroup("GUI");
Setting.setValue("IsMax", GUI.isMax);
Setting.setValue("Size", GUI.Size);
Setting.setValue("Point", GUI.Point);
Setting.setValue("Toolbar", GUI.Toolbar);
Setting.endGroup();
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Classes/cSettings.h
0,0 → 1,48
/***************************************************************************
* 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 CSETTINGS_H
#define CSETTINGS_H
 
#include <QSize>
#include <QPoint>
#include <QString>
 
#include "../Defines.h"
 
struct set_GUI
{
bool isMax;
QSize Size;
QPoint Point;
bool Toolbar;
};
 
class cSettings
{
public:
cSettings();
void read_Settings();
void write_Settings();
 
int Settings_ID;
 
set_GUI GUI;
};
 
#endif // CSETTINGS_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Defines.h
0,0 → 1,54
/***************************************************************************
* 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 DEFINES_H
#define DEFINES_H
 
#include <QString>
#include "../Global/Global.h"
#include "../Global/Kopter.h"
 
static const QString QA_NAME = "QMK-Settings";
static const QString QA_VERSION_NR = "1.3.0";
 
#ifdef _BETA_
static const QString QA_VERSION = QA_VERSION_NR + " (BETA)";
#else
static const QString QA_VERSION = QA_VERSION_NR;
#endif
 
static const QString QA_DATE = "25.08.2010";
static const QString QA_YEAR = "2008-2010";
 
static const QString QA_ABOUT =
"<HTML>"
"<p><b><font size=8>" + QA_NAME + "</font></b></p>"
"<br />"
"Version " + QA_VERSION + " - " + QA_DATE + " on " + QA_OS + ""
"<br /><br /><b>kompatibel zu " + QA_HWVERSION + "</b>"
"<br /><br />"
"(C) " + QA_YEAR + " by " + QA_AUTHOR + " - "
"<a href=\"mailto:" + QA_EMAIL + "\">" + QA_EMAIL + "</a> <br /><br />"
"Groundstation-Programm f&uuml;r den Mikrokopter<br /><br />"
"QMK-Settings - Konfiguration des Mikrokopter.<br /><br /> "
"Dieses Programm wird unter den Bedingungen der GPL v2 ver&ouml;ffentlicht."
"</HTML>";
 
static const QString DataFields = "VSQPMN";
 
#endif // DEFINES_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Dialogs/dlg_Main.cpp
0,0 → 1,1350
/***************************************************************************
* 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. *
***************************************************************************/
 
#include <QCryptographicHash>
#include <QFileDialog>
#include <QMessageBox>
#include <QSettings>
 
#include "dlg_Main.h"
 
// Konstruktor Main-Form
dlg_Main::dlg_Main()
{
setupUi(this);
 
o_Settings = new cSettings();
 
wg_Connection->set_Client(ID_SETTINGS, QA_NAME + " " + QA_VERSION, DataFields);
 
o_Timer = new QTimer();
o_Timer->setInterval(500);
 
f_MotorMixer = new dlg_MotorMixer(this);
f_MotorTest = new dlg_MotorTest(this);
 
init_Directorys();
init_GUI();
init_Connections();
}
 
// Grafische Oberfläche initialisieren
void dlg_Main::init_GUI()
{
setWindowTitle(QA_NAME + " " + QA_VERSION);
 
resize(o_Settings->GUI.Size);
move(o_Settings->GUI.Point);
 
if (o_Settings->GUI.isMax)
{
showMaximized();
}
 
wg_Connection->set_SelectVisible(false);
wg_Connection->set_IntervalVisible(false);
 
ac_Toolbar->setChecked(o_Settings->GUI.Toolbar);
 
if (ac_Toolbar->isChecked())
{
wg_Connection->set_ButtonVisible(false);
}
else
{
ToolBar->setVisible(false);
}
}
 
// Signale mit Slots verbinden
void dlg_Main::init_Connections()
{
connect(o_Timer, SIGNAL(timeout()), this, SLOT(slot_Timer()));
 
connect(ac_Connect, SIGNAL(triggered()), wg_Connection, SLOT(slot_btn_Connect()));
connect(ac_Toolbar, SIGNAL(triggered()), this, SLOT(slot_ac_Toolbar()));
 
connect(ac_Write, SIGNAL(triggered()), this, SLOT(slot_ac_Write()));
connect(ac_Read, SIGNAL(triggered()), this, SLOT(slot_ac_Read()));
connect(ac_Save, SIGNAL(triggered()), this, SLOT(slot_ac_Save()));
connect(ac_Load, SIGNAL(triggered()), this, SLOT(slot_ac_Load()));
 
connect(ac_MotorMixer, SIGNAL(triggered()), this, SLOT(slot_ac_MotorMixer()));
connect(ac_MotorTest, SIGNAL(triggered()), this, SLOT(slot_ac_MotorTest()));
 
connect(f_MotorMixer, SIGNAL(sig_SendData(QString,int)), wg_Connection, SLOT(slot_send_Data(QString,int)));
connect(f_MotorTest, SIGNAL(sig_SendData(QString,int)), wg_Connection, SLOT(slot_send_Data(QString,int)));
 
// About QMK-Settings & About-QT Dialog einfügen
connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About()));
menu_Help->addAction(trUtf8("Über &Qt"), qApp, SLOT(aboutQt()));
 
connect(wg_Connection, SIGNAL(sig_Status(int)), this, SLOT(slot_ConnectionStatus(int)));
connect(wg_Connection, SIGNAL(sig_MK_Version(s_Hardware)), this, SLOT(slot_MK_Version(s_Hardware)));
connect(wg_Connection, SIGNAL(sig_MK_ReadSettings(s_MK_Settings)), this, SLOT(slot_MK_ReadSettings(s_MK_Settings)));
connect(wg_Connection, SIGNAL(sig_MK_WriteSettings(int)), this, SLOT(slot_MK_WriteSettings(int)));
connect(wg_Connection, SIGNAL(sig_MK_ReadMotorMixer(s_MK_Mixer)), this, SLOT(slot_MK_ReadMotorMixer(s_MK_Mixer)));
connect(wg_Connection, SIGNAL(sig_MK_WriteMotorMixer(int)), this, SLOT(slot_MK_WriteMotorMixer(int)));
connect(wg_Connection, SIGNAL(sig_MK_PPMData(s_MK_PPM_Data)), this, SLOT(slot_MK_PPMData(s_MK_PPM_Data)));
 
connect(listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(slot_PageChange(int)));
 
// Settings - LED's J16
connect(J16_0, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_1, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_2, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_3, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_4, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_5, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_6, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_7, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
 
// Settings - LED's J17
connect(J17_0, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_1, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_2, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_3, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_4, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_5, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_6, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_7, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
 
// Settings - LED's J16
connect(J16_A_0, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_A_1, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_A_2, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_A_3, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_A_4, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_A_5, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_A_6, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J16_A_7, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
 
// Settings - LED's J17
connect(J17_A_0, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_A_1, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_A_2, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_A_3, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_A_4, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_A_5, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_A_6, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
connect(J17_A_7, SIGNAL(clicked()), this, SLOT(slot_LEDtoValue()));
 
connect(sb_11_1, SIGNAL(valueChanged(int)), this, SLOT(slot_ValuetoLED16(int)));
connect(sb_11_3, SIGNAL(valueChanged(int)), this, SLOT(slot_ValuetoLED17(int)));
connect(sb_11_5, SIGNAL(valueChanged(int)), this, SLOT(slot_ValuetoLED16A(int)));
connect(sb_11_6, SIGNAL(valueChanged(int)), this, SLOT(slot_ValuetoLED17A(int)));
 
connect(tb_9_6, SIGNAL(clicked()), this, SLOT(slot_tbUp()));
connect(tb_9_7, SIGNAL(clicked()), this, SLOT(slot_tbDown()));
connect(tb_9_8, SIGNAL(clicked()), this, SLOT(slot_tbLeft()));
connect(tb_9_9, SIGNAL(clicked()), this, SLOT(slot_tbRight()));
}
 
void dlg_Main::init_Directorys()
{
QDir *t_Dir = new QDir();
 
s_Dir.MainData = QDir::homePath() + "/QMK-Data";
if (!t_Dir->exists(s_Dir.MainData))
{
t_Dir->mkdir(s_Dir.MainData);
}
 
s_Dir.Settings = s_Dir.MainData + "/Settings";
if (!t_Dir->exists(s_Dir.Settings))
{
t_Dir->mkdir(s_Dir.Settings);
}
}
 
///////////
// Slots //
///////////
 
// About-Dialog
void dlg_Main::slot_ac_About()
{
QMessageBox::about(this, trUtf8(("Über ")) + QA_NAME, QA_ABOUT);
}
 
void dlg_Main::slot_ac_Toolbar()
{
if (ac_Toolbar->isChecked())
{
wg_Connection->set_ButtonVisible(false);
ToolBar->setVisible(true);
}
else
{
wg_Connection->set_ButtonVisible(true);
ToolBar->setVisible(false);
}
}
 
void dlg_Main::slot_ConnectionStatus(int li_Status)
{
if (li_Status)
{
ac_Connect->setChecked(true);
ac_Connect->setText(tr("Trennen"));
}
else
{
ac_Connect->setChecked(false);
ac_Connect->setText(tr("Verbinden"));
}
}
 
void dlg_Main::slot_MK_Version(s_Hardware ls_Version)
{
gs_Version = ls_Version;
setWindowTitle(QA_NAME + " " + QA_VERSION + " - " + ls_Version.Hardware + " " + ls_Version.Version);
 
if (gs_Version.ID == ADDRESS_FC)
{
c_Data[0] = 0xff;
wg_Connection->send_Data(HandlerMK::make_Frame('q', ADDRESS_FC, c_Data, 1).toLatin1().data(), DATA_READ_SETTINGS);
}
}
 
void dlg_Main::slot_MK_ReadSettings(s_MK_Settings ps_MK_Settings)
{
if (ps_MK_Settings.Revision == MK_VERSION_SETTINGS)
{
show_MK_Settings(ps_MK_Settings);
}
else
{
QMessageBox::warning(this, QA_NAME, tr("Versionen inkompatibel. \nParameterbearbeitung nicht moeglich."), QMessageBox::Ok);
ac_Read->setEnabled(false);
ac_Write->setEnabled(false);
}
}
 
void dlg_Main::slot_MK_WriteSettings(int pi_ID)
{
if (pi_ID == 0)
{
QMessageBox::warning(this, QA_NAME, tr("Fehler beim Settings-Schreiben."), QMessageBox::Ok);
}
else
{
QMessageBox::information(this, QA_NAME, tr("Setting geschrieben."), QMessageBox::Ok);
}
 
}
 
void dlg_Main::slot_MK_ReadMotorMixer(s_MK_Mixer ps_MK_MotorMixer)
{
if (ps_MK_MotorMixer.Revision == MK_VERSION_MIXER)
{
f_MotorMixer->set_MotorConfig(ps_MK_MotorMixer);
}
}
 
void dlg_Main::slot_MK_WriteMotorMixer(int pi_ID)
{
if (pi_ID == 0)
{
QMessageBox::warning(this, QA_NAME, tr("Fehler beim MotorMixer-Schreiben."), QMessageBox::Ok);
}
else
{
QMessageBox::information(this, QA_NAME, tr("MotorMixer geschrieben."), QMessageBox::Ok);
}
 
}
 
void dlg_Main::slot_MK_PPMData(s_MK_PPM_Data ps_PPMData)
{
qDebug("PPM-Data");
 
// qDebug() << ps_PPMData.Data[1] << ", " << ps_PPMData.Data[2] << ", " << ps_PPMData.Data[3] << ", " << ps_PPMData.Data[4];
 
pb_K1->setValue(ps_PPMData.Data[1]);
pb_K2->setValue(ps_PPMData.Data[2]);
pb_K3->setValue(ps_PPMData.Data[3]);
pb_K4->setValue(ps_PPMData.Data[4]);
pb_K5->setValue(ps_PPMData.Data[5]);
pb_K6->setValue(ps_PPMData.Data[6]);
pb_K7->setValue(ps_PPMData.Data[7]);
pb_K8->setValue(ps_PPMData.Data[8]);
pb_K9->setValue(ps_PPMData.Data[9]);
pb_K10->setValue(ps_PPMData.Data[10]);
pb_K11->setValue(ps_PPMData.Data[11]);
pb_K12->setValue(ps_PPMData.Data[12]);
pb_K1_2->setValue(ps_PPMData.Data[13]);
pb_K2_2->setValue(ps_PPMData.Data[14]);
pb_K3_2->setValue(ps_PPMData.Data[15]);
pb_K4_2->setValue(ps_PPMData.Data[16]);
pb_K5_2->setValue(ps_PPMData.Data[17]);
pb_K6_2->setValue(ps_PPMData.Data[18]);
pb_K7_2->setValue(ps_PPMData.Data[19]);
pb_K8_2->setValue(ps_PPMData.Data[20]);
pb_K9_2->setValue(ps_PPMData.Data[21]);
pb_K10_2->setValue(ps_PPMData.Data[22]);
pb_K11_2->setValue(ps_PPMData.Data[23]);
pb_K12_2->setValue(ps_PPMData.Data[24]);
}
 
///////////////////////////////////////////////////////////////////
// QMK-Settings //
///////////////////////////////////////////////////////////////////
 
 
void dlg_Main::slot_PageChange(int Page)
{
if (Page == 1)
o_Timer->start();
else
o_Timer->stop();
}
 
void dlg_Main::slot_Timer()
{
wg_Connection->send_Data(HandlerMK::make_Frame('p', ADDRESS_FC, c_Data, 0).toLatin1().data(), 0);
}
 
void dlg_Main::slot_ac_MotorMixer()
{
f_MotorMixer->set_Objects(o_Settings, s_Dir);
f_MotorMixer->read_Mixer();
 
if (f_MotorMixer->exec()==QDialog::Accepted)
{
}
}
 
void dlg_Main::slot_ac_MotorTest()
{
// f_MotorMixer->set_Objects(wg_Connection->o_Input, o_Settings, s_Dir);
// f_MotorMixer->read_Mixer();
 
if (f_MotorTest->exec()==QDialog::Accepted)
{
}
 
f_MotorTest->Stop();
}
 
// Settings-Funktionen
void dlg_Main::slot_ac_Write()
{
s_MK_Settings t_Set;
 
t_Set = get_MK_Settings();
 
memcpy((unsigned char *)&c_Data, (unsigned char *)&t_Set, sizeof(t_Set));
 
wg_Connection->send_Data(HandlerMK::make_Frame('s', ADDRESS_FC, c_Data, sizeof(t_Set)).toLatin1().data(), DATA_WRITE_SETTINGS);
}
 
void dlg_Main::slot_ac_Read()
{
c_Data[0] = sb_Set->value();
wg_Connection->send_Data(HandlerMK::make_Frame('q', ADDRESS_FC, c_Data, 1).toLatin1().data(), DATA_READ_SETTINGS);
}
 
void dlg_Main::slot_ac_Save()
{
QString Filename = QFileDialog::getSaveFileName(this, "Mikrokopter Parameter speichern", s_Dir.Settings + "/" + gs_Version.VersionShort + "_" + le_SetName->text() + ".mkp", "Mikrokopter Parameter(*.mkp);;Alle Dateien (*)");
 
if (!Filename.isEmpty())
{
if (!(Filename.endsWith(".mkp", Qt::CaseInsensitive)))
{
Filename = Filename + QString(".mkp");
}
 
s_MK_Settings t_Set = get_MK_Settings();
 
QSettings Setting(Filename, QSettings::IniFormat);
 
Setting.beginGroup("Setup");
Setting.setValue("Name", le_SetName->text());
Setting.setValue("IniVersion", 4);
Setting.setValue("GlobalConfig", t_Set.GlobalConfig);
Setting.setValue("GlobalConfig2", t_Set.ExtraConfig);
Setting.endGroup();
 
Setting.beginGroup("Channels");
Setting.setValue("Nick", t_Set.Kanalbelegung[0]);
Setting.setValue("Roll", t_Set.Kanalbelegung[1]);
Setting.setValue("Gas", t_Set.Kanalbelegung[2]);
Setting.setValue("Gier", t_Set.Kanalbelegung[3]);
Setting.setValue("Poti_1", t_Set.Kanalbelegung[4]);
Setting.setValue("Poti_2", t_Set.Kanalbelegung[5]);
Setting.setValue("Poti_3", t_Set.Kanalbelegung[6]);
Setting.setValue("Poti_4", t_Set.Kanalbelegung[7]);
Setting.setValue("Poti_5", t_Set.Kanalbelegung[8]);
Setting.setValue("Poti_6", t_Set.Kanalbelegung[9]);
Setting.setValue("Poti_7", t_Set.Kanalbelegung[10]);
Setting.setValue("Poti_8", t_Set.Kanalbelegung[11]);
Setting.setValue("Receiver", t_Set.Receiver);
Setting.endGroup();
 
Setting.beginGroup("Stick");
Setting.setValue("Nick_Roll-P", t_Set.Stick_P);
Setting.setValue("Nick_Roll-D", t_Set.Stick_D);
Setting.setValue("Gier-P", t_Set.Gier_P);
Setting.setValue("ExternalControl", t_Set.ExternalControl);
Setting.endGroup();
 
Setting.beginGroup("Altitude");
Setting.setValue("Setpoint", t_Set.MaxHoehe);
Setting.setValue("MinGas", t_Set.Hoehe_MinGas);
Setting.setValue("P", t_Set.Hoehe_P);
Setting.setValue("Barometric-D", t_Set.Luftdruck_D);
Setting.setValue("Z-ACC-Effect", t_Set.Hoehe_ACC_Wirkung);
Setting.setValue("Gain", t_Set.Hoehe_Verstaerkung);
Setting.setValue("HoverVariation", t_Set.Hoehe_HoverBand);
Setting.setValue("GPS_Z", t_Set.Hoehe_GPS_Z);
Setting.setValue("StickNeutralPoint", t_Set.Hoehe_StickNeutralPoint);
Setting.endGroup();
 
Setting.beginGroup("Gyro");
Setting.setValue("P", t_Set.Gyro_P);
Setting.setValue("I", t_Set.Gyro_I);
Setting.setValue("D", t_Set.Gyro_D);
Setting.setValue("Gier_P", t_Set.Gyro_Gier_P);
Setting.setValue("Gier_I", t_Set.Gyro_Gier_I);
Setting.setValue("DynamicStability", t_Set.DynamicStability);
Setting.setValue("ACC_Gyro-Factor", t_Set.GyroAccFaktor);
Setting.setValue("ACC_Gyro-Compensation", t_Set.GyroAccAbgleich);
Setting.setValue("DriftCompensation", t_Set.Driftkomp);
Setting.setValue("Stability", t_Set.Gyro_Stability);
Setting.setValue("Main-I", t_Set.I_Faktor);
Setting.endGroup();
 
Setting.beginGroup("Camera");
Setting.setValue("ServoNickControl", t_Set.ServoNickControl);
Setting.setValue("ServoNickCompensation", t_Set.ServoNickComp);
Setting.setValue("ServoNickMin", t_Set.ServoNickMin);
Setting.setValue("ServoNickMax", t_Set.ServoNickMax);
 
Setting.setValue("ServoRollControl", t_Set.ServoRollControl);
Setting.setValue("ServoRollCompensation", t_Set.ServoRollComp);
Setting.setValue("ServoRollMin", t_Set.ServoRollMin);
Setting.setValue("ServoRollMax", t_Set.ServoRollMax);
 
Setting.setValue("ServoInvert", t_Set.ServoCompInvert);
Setting.setValue("ServoNickRefreshRate", t_Set.ServoNickRefresh);
 
Setting.setValue("Servo3", t_Set.Servo3);
Setting.setValue("Servo4", t_Set.Servo4);
Setting.setValue("Servo5", t_Set.Servo5);
Setting.endGroup();
 
Setting.beginGroup("Others");
Setting.setValue("MinGas", t_Set.Gas_Min);
Setting.setValue("MaxGas", t_Set.Gas_Max);
Setting.setValue("Compass-Effect", t_Set.KompassWirkung);
Setting.setValue("UnderVoltage", t_Set.UnterspannungsWarnung);
Setting.setValue("NotGas", t_Set.NotGas);
Setting.setValue("NotGasTime", t_Set.NotGasZeit);
Setting.setValue("Orientation", t_Set.OrientationAngle);
Setting.setValue("CarefreeControl", t_Set.OrientationModeControl);
Setting.endGroup();
 
Setting.beginGroup("Coupling");
Setting.setValue("YawPosFeedback", t_Set.AchsKopplung1);
Setting.setValue("NickRollFeedback", t_Set.AchsKopplung2);
Setting.setValue("YawCorrection", t_Set.CouplingYawCorrection);
Setting.endGroup();
 
Setting.beginGroup("Loop");
Setting.setValue("Config", t_Set.BitConfig);
Setting.setValue("GasLimit", t_Set.LoopGasLimit);
Setting.setValue("StickThreshold", t_Set.LoopThreshold);
Setting.setValue("LoopHysteresis", t_Set.LoopHysterese);
Setting.setValue("TurnOverNick", t_Set.WinkelUmschlagNick);
Setting.setValue("TurnOverRoll", t_Set.WinkelUmschlagRoll);
Setting.endGroup();
 
Setting.beginGroup("User");
Setting.setValue("Parameter_1", t_Set.UserParam1);
Setting.setValue("Parameter_2", t_Set.UserParam2);
Setting.setValue("Parameter_3", t_Set.UserParam3);
Setting.setValue("Parameter_4", t_Set.UserParam4);
Setting.setValue("Parameter_5", t_Set.UserParam5);
Setting.setValue("Parameter_6", t_Set.UserParam6);
Setting.setValue("Parameter_7", t_Set.UserParam7);
Setting.setValue("Parameter_8", t_Set.UserParam8);
Setting.endGroup();
 
Setting.beginGroup("Output");
Setting.setValue("J16_Bitmask", t_Set.J16Bitmask);
Setting.setValue("J16_Timing", t_Set.J16Timing);
Setting.setValue("J17_Bitmask", t_Set.J17Bitmask);
Setting.setValue("J17_Timing", t_Set.J17Timing);
Setting.setValue("WARN_J16_Bitmask", t_Set.WARN_J16_Bitmask);
Setting.setValue("WARN_J17_Bitmask", t_Set.WARN_J17_Bitmask);
Setting.endGroup();
 
Setting.beginGroup("NaviCtrl");
Setting.setValue("GPS_ModeControl", t_Set.NaviGpsModeControl);
Setting.setValue("GPS_Gain", t_Set.NaviGpsGain);
Setting.setValue("GPS_P", t_Set.NaviGpsP);
Setting.setValue("GPS_I", t_Set.NaviGpsI);
Setting.setValue("GPS_D", t_Set.NaviGpsD);
Setting.setValue("GPS_P_Limit", t_Set.NaviGpsPLimit);
Setting.setValue("GPS_I_Limit", t_Set.NaviGpsILimit);
Setting.setValue("GPS_D_Limit", t_Set.NaviGpsDLimit);
Setting.setValue("GPS_Acc", t_Set.NaviGpsACC);
Setting.setValue("GPS_MinSat", t_Set.NaviGpsMinSat);
Setting.setValue("GPS_StickThreshold", t_Set.NaviStickThreshold);
Setting.setValue("GPS_WindCorrection", t_Set.NaviWindCorrection);
Setting.setValue("GPS_SpeedCompensation", t_Set.NaviSpeedCompensation);
Setting.setValue("GPS_MaxRadius", t_Set.NaviOperatingRadius);
Setting.setValue("GPS_AngleLimit", t_Set.NaviAngleLimitation);
Setting.setValue("GPS_PH_Login_Time", t_Set.NaviPH_LoginTime);
Setting.endGroup();
}
}
 
void dlg_Main::slot_ac_Load()
{
QString Filename = QFileDialog::getOpenFileName(this, "Mikrokopter Parameter laden", s_Dir.Settings + "", "Mikrokopter Parameter(*.mkp);;Alle Dateien (*)");
 
if (!Filename.isEmpty())
{
s_MK_Settings t_Set = get_MK_Settings();
 
t_Set.Index = sb_Set->value();
 
QSettings Setting(Filename, QSettings::IniFormat);
 
Setting.beginGroup("Setup");
QString Name = Setting.value("Name", QString("--noname--")).toString();
 
memcpy(t_Set.Name, Name.toLatin1().data(), 12);
 
t_Set.GlobalConfig = Setting.value("GlobalConfig", 104).toInt();
t_Set.ExtraConfig = Setting.value("GlobalConfig2", 1).toInt();
Setting.endGroup();
 
Setting.beginGroup("Channels");
t_Set.Kanalbelegung[0] = Setting.value("Nick", 1).toInt();
t_Set.Kanalbelegung[1] = Setting.value("Roll", 2).toInt();
t_Set.Kanalbelegung[2] = Setting.value("Gas", 3).toInt();
t_Set.Kanalbelegung[3] = Setting.value("Gier", 4).toInt();
t_Set.Kanalbelegung[4] = Setting.value("Poti_1", 5).toInt();
t_Set.Kanalbelegung[5] = Setting.value("Poti_2", 6).toInt();
t_Set.Kanalbelegung[6] = Setting.value("Poti_3", 7).toInt();
t_Set.Kanalbelegung[7] = Setting.value("Poti_4", 8).toInt();
t_Set.Kanalbelegung[8] = Setting.value("Poti_5", 9).toInt();
t_Set.Kanalbelegung[9] = Setting.value("Poti_6", 10).toInt();
t_Set.Kanalbelegung[10] = Setting.value("Poti_7", 11).toInt();
t_Set.Kanalbelegung[11] = Setting.value("Poti_8", 12).toInt();
t_Set.Receiver = Setting.value("Receiver", 0).toInt();
Setting.endGroup();
 
Setting.beginGroup("Stick");
t_Set.Stick_P = Setting.value("Nick_Roll-P", 10).toInt();
t_Set.Stick_D = Setting.value("Nick_Roll-D", 16).toInt();
t_Set.Gier_P = Setting.value("Gier-P", 6).toInt();
t_Set.ExternalControl = Setting.value("ExternalControl", 0).toInt();
Setting.endGroup();
 
Setting.beginGroup("Altitude");
t_Set.MaxHoehe = Setting.value("Setpoint", 251).toInt();
t_Set.Hoehe_MinGas = Setting.value("MinGas", 30).toInt();
t_Set.Hoehe_P = Setting.value("P", 10).toInt();
t_Set.Luftdruck_D = Setting.value("Barometric-D", 30).toInt();
t_Set.Hoehe_ACC_Wirkung = Setting.value("Z-ACC-Effect", 30).toInt();
t_Set.Hoehe_Verstaerkung = Setting.value("Gain", 15).toInt();
t_Set.Hoehe_HoverBand = Setting.value("HoverVariation", 5).toInt();
t_Set.Hoehe_GPS_Z = Setting.value("GPS_Z", 64).toInt();
t_Set.Hoehe_StickNeutralPoint = Setting.value("StickNeutralPoint", 0).toInt();
Setting.endGroup();
 
Setting.beginGroup("Gyro");
t_Set.Gyro_P = Setting.value("P", 90).toInt();
t_Set.Gyro_I = Setting.value("I", 120).toInt();
t_Set.Gyro_D = Setting.value("D", 3).toInt();
t_Set.Gyro_Gier_P = Setting.value("Gier_P", 100).toInt();
t_Set.Gyro_Gier_I = Setting.value("Gier_I", 120).toInt();
t_Set.DynamicStability = Setting.value("DynamicStability", 75).toInt();
t_Set.GyroAccFaktor = Setting.value("ACC_Gyro-Factor", 30).toInt();
t_Set.GyroAccAbgleich = Setting.value("ACC_Gyro-Compensation", 32).toInt();
t_Set.Driftkomp = Setting.value("DriftCompensation", 32).toInt();
t_Set.Gyro_Stability = Setting.value("Stability", 4).toInt();
t_Set.I_Faktor = Setting.value("Main-I", 32).toInt();
Setting.endGroup();
 
Setting.beginGroup("Camera");
t_Set.ServoNickControl = Setting.value("ServoNickControl", 100).toInt();
t_Set.ServoNickComp = Setting.value("ServoNickCompensation", 40).toInt();
t_Set.ServoNickMin = Setting.value("ServoNickMin", 0).toInt();
t_Set.ServoNickMax = Setting.value("ServoNickMax", 250).toInt();
 
t_Set.ServoRollControl = Setting.value("ServoRollControl", 100).toInt();
t_Set.ServoRollComp = Setting.value("ServoRollCompensation", 40).toInt();
t_Set.ServoRollMin = Setting.value("ServoRollMin", 0).toInt();
t_Set.ServoRollMax = Setting.value("ServoRollMax", 250).toInt();
 
t_Set.ServoCompInvert = Setting.value("ServoInvert", 0).toInt();
t_Set.ServoNickRefresh = Setting.value("ServoNickRefreshRate", 3).toInt();
 
t_Set.Servo3 = Setting.value("Servo3", 0).toInt();
t_Set.Servo4 = Setting.value("Servo4", 0).toInt();
t_Set.Servo5 = Setting.value("Servo5", 0).toInt();
Setting.endGroup();
 
Setting.beginGroup("Others");
t_Set.Gas_Min = Setting.value("MinGas", 8).toInt();
t_Set.Gas_Max = Setting.value("MaxGas", 230).toInt();
t_Set.KompassWirkung = Setting.value("Compass-Effect", 128).toInt();
t_Set.UnterspannungsWarnung = Setting.value("UnderVoltage", 99).toInt();
t_Set.NotGas = Setting.value("NotGas", 35).toInt();
t_Set.NotGasZeit = Setting.value("NotGasTime", 30).toInt();
 
t_Set.OrientationAngle = Setting.value("Orientation", 0).toInt();
t_Set.OrientationModeControl = Setting.value("CarefreeControl", 252).toInt();
Setting.endGroup();
 
Setting.beginGroup("Coupling");
t_Set.AchsKopplung1 = Setting.value("YawPosFeedback", 90).toInt();
t_Set.AchsKopplung2 = Setting.value("NickRollFeedback", 80).toInt();
t_Set.CouplingYawCorrection = Setting.value("YawCorrection", 60).toInt();
Setting.endGroup();
 
Setting.beginGroup("Loop");
t_Set.BitConfig = Setting.value("Config", 0).toInt();
t_Set.LoopGasLimit = Setting.value("GasLimit", 50).toInt();
t_Set.LoopThreshold = Setting.value("StickThreshold", 90).toInt();
t_Set.LoopHysterese = Setting.value("LoopHysteresis", 50).toInt();
t_Set.WinkelUmschlagNick = Setting.value("TurnOverNick", 85).toInt();
t_Set.WinkelUmschlagRoll = Setting.value("TurnOverRoll", 85).toInt();
Setting.endGroup();
 
Setting.beginGroup("User");
t_Set.UserParam1 = Setting.value("Parameter_1", 0).toInt();
t_Set.UserParam2 = Setting.value("Parameter_2", 0).toInt();
t_Set.UserParam3 = Setting.value("Parameter_3", 0).toInt();
t_Set.UserParam4 = Setting.value("Parameter_4", 0).toInt();
t_Set.UserParam5 = Setting.value("Parameter_5", 0).toInt();
t_Set.UserParam6 = Setting.value("Parameter_6", 0).toInt();
t_Set.UserParam7 = Setting.value("Parameter_7", 0).toInt();
t_Set.UserParam8 = Setting.value("Parameter_8", 0).toInt();
Setting.endGroup();
 
Setting.beginGroup("Output");
t_Set.J16Bitmask = Setting.value("J16_Bitmask", 255).toInt();
t_Set.J16Timing = Setting.value("J16_Timing", 15).toInt();
t_Set.J17Bitmask = Setting.value("J17_Bitmask", 255).toInt();
t_Set.J17Timing = Setting.value("J17_Timing", 15).toInt();
t_Set.WARN_J16_Bitmask = Setting.value("WARN_J16_Bitmask", 0xaa).toInt();
t_Set.WARN_J17_Bitmask = Setting.value("WARN_J17_Bitmask", 0xaa).toInt();
Setting.endGroup();
 
Setting.beginGroup("NaviCtrl");
t_Set.NaviGpsModeControl = Setting.value("GPS_ModeControl", 253).toInt();
t_Set.NaviGpsGain = Setting.value("GPS_Gain", 100).toInt();
t_Set.NaviGpsP = Setting.value("GPS_P", 90).toInt();
t_Set.NaviGpsI = Setting.value("GPS_I", 90).toInt();
t_Set.NaviGpsD = Setting.value("GPS_D", 90).toInt();
t_Set.NaviGpsPLimit = Setting.value("GPS_P_Limit", 75).toInt();
t_Set.NaviGpsILimit = Setting.value("GPS_I_Limit", 75).toInt();
t_Set.NaviGpsDLimit = Setting.value("GPS_D_Limit", 75).toInt();
t_Set.NaviGpsACC = Setting.value("GPS_Acc", 0).toInt();
t_Set.NaviGpsMinSat = Setting.value("GPS_MinSat", 6).toInt();
t_Set.NaviStickThreshold = Setting.value("GPS_StickThreshold", 8).toInt();
t_Set.NaviWindCorrection = Setting.value("GPS_WindCorrection", 90).toInt();
t_Set.NaviSpeedCompensation = Setting.value("GPS_SpeedCompensation", 30).toInt();
t_Set.NaviOperatingRadius = Setting.value("GPS_MaxRadius", 100).toInt();
t_Set.NaviAngleLimitation = Setting.value("GPS_AngleLimit", 100).toInt();
t_Set.NaviPH_LoginTime = Setting.value("GPS_PH_Login_Time", 4).toInt();
Setting.endGroup();
 
show_MK_Settings(t_Set);
}
}
 
void dlg_Main::show_MK_Settings(s_MK_Settings t_Set) // DONE 0.80g
{
sb_Set->setValue(int(t_Set.Index));
 
le_SetName->setText(QString(t_Set.Name));
 
sb_0_1->setValue(t_Set.OrientationAngle);
 
// Seite 1
{
s_1_1_cb->setChecked(t_Set.GlobalConfig & CFG_HOEHENREGELUNG);
s_1_2_cb->setChecked(t_Set.GlobalConfig & CFG_KOMPASS_AKTIV);
s_1_3_cb->setChecked(t_Set.GlobalConfig & CFG_KOMPASS_FIX);
s_1_4_cb->setChecked(t_Set.GlobalConfig & CFG_GPS_AKTIV);
s_1_5_cb->setChecked(t_Set.ExtraConfig & CFG_SENSITIVE_RC);
s_1_6_cb->setChecked(t_Set.GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV);
s_1_7_cb->setChecked(t_Set.GlobalConfig & CFG_DREHRATEN_BEGRENZER);
s_1_8_cb->setChecked(t_Set.GlobalConfig & CFG_HEADING_HOLD);
}
// Seite 2
{
cb_2_1->setCurrentIndex(t_Set.Kanalbelegung[2] - 1);
cb_2_2->setCurrentIndex(t_Set.Kanalbelegung[3] - 1);
cb_2_3->setCurrentIndex(t_Set.Kanalbelegung[0] - 1);
cb_2_4->setCurrentIndex(t_Set.Kanalbelegung[1] - 1);
cb_2_5->setCurrentIndex(t_Set.Kanalbelegung[4] - 1);
cb_2_6->setCurrentIndex(t_Set.Kanalbelegung[5] - 1);
cb_2_7->setCurrentIndex(t_Set.Kanalbelegung[6] - 1);
cb_2_8->setCurrentIndex(t_Set.Kanalbelegung[7] - 1);
cb_2_9->setCurrentIndex(t_Set.Kanalbelegung[8] - 1);
cb_2_10->setCurrentIndex(t_Set.Kanalbelegung[9] - 1);
cb_2_11->setCurrentIndex(t_Set.Kanalbelegung[10] - 1);
cb_2_12->setCurrentIndex(t_Set.Kanalbelegung[11] - 1);
s_2_13_cb->setCurrentIndex(t_Set.Receiver);
}
// Seite 3
{
sb_3_1->setValue(t_Set.Stick_P);
sb_3_2->setValue(t_Set.Stick_D);
cb_3_3 = setCombo(cb_3_3, t_Set.Gier_P);
cb_3_4 = setCombo(cb_3_4, t_Set.ExternalControl);
}
// Seite 4
{
// s_4_2_rb->setChecked(t_Set.ExtraConfig & CFG2_HEIGHT_LIMIT);
if (t_Set.ExtraConfig & CFG2_HEIGHT_LIMIT)
{
s_4_2_rb->setChecked(true);
}
else
{
s_4_3_rb->setChecked(true);
}
s_4_5_cb->setChecked(t_Set.ExtraConfig & CFG2_VARIO_BEEP);
s_4_4_cb->setChecked(t_Set.GlobalConfig & CFG_HOEHEN_SCHALTER);
 
cb_4_1 = setCombo(cb_4_1, t_Set.MaxHoehe);
sb_4_2->setValue(t_Set.Hoehe_MinGas);
cb_4_3 = setCombo(cb_4_3, t_Set.Hoehe_P);
cb_4_4 = setCombo(cb_4_4, t_Set.Luftdruck_D);
cb_4_5 = setCombo(cb_4_5, t_Set.Hoehe_ACC_Wirkung);
sb_4_6->setValue(t_Set.Hoehe_Verstaerkung);
sb_4_7->setValue(t_Set.Hoehe_HoverBand);
cb_4_8 = setCombo(cb_4_8, t_Set.Hoehe_GPS_Z);
sb_4_9->setValue(t_Set.Hoehe_StickNeutralPoint);
}
// Seite 5
{
cb_5_1 = setCombo(cb_5_1, t_Set.Gyro_P);
cb_5_2 = setCombo(cb_5_2, t_Set.Gyro_I);
cb_5_8 = setCombo(cb_5_8, t_Set.Gyro_D);
cb_5_3 = setCombo(cb_5_3, t_Set.DynamicStability);
sb_5_4->setValue(t_Set.GyroAccFaktor);
sb_5_5->setValue(t_Set.GyroAccAbgleich);
cb_5_6 = setCombo(cb_5_6, t_Set.I_Faktor);
sb_5_7->setValue(t_Set.Driftkomp);
cb_5_9 = setCombo(cb_5_9, t_Set.Gyro_Gier_P);
cb_5_10 = setCombo(cb_5_10, t_Set.Gyro_Gier_I);
cb_5_11 = setCombo(cb_5_11, t_Set.Gyro_Stability);
}
// Seite 6
{
cb_6_1 = setCombo(cb_6_1, t_Set.ServoNickControl);
sb_6_2->setValue(t_Set.ServoNickComp);
sb_6_3->setValue(t_Set.ServoNickMin);
sb_6_4->setValue(t_Set.ServoNickMax);
 
cb_6_7 = setCombo(cb_6_7, t_Set.ServoRollControl);
sb_6_8->setValue(t_Set.ServoRollComp);
sb_6_10->setValue(t_Set.ServoRollMin);
sb_6_11->setValue(t_Set.ServoRollMax);
 
cb_6_6->setChecked(t_Set.ServoCompInvert & 0x01);
cb_6_9->setChecked(t_Set.ServoCompInvert & 0x02);
 
sb_6_5->setValue(t_Set.ServoNickRefresh);
 
cb_6_12 = setCombo(cb_6_12, t_Set.Servo3);
cb_6_13 = setCombo(cb_6_13, t_Set.Servo4);
cb_6_14 = setCombo(cb_6_14, t_Set.Servo5);
 
}
// Seite 7
{
sb_7_1->setValue(t_Set.Gas_Min);
sb_7_2->setValue(t_Set.Gas_Max);
cb_7_3 = setCombo(cb_7_3, t_Set.KompassWirkung);
sb_7_4->setValue(t_Set.UnterspannungsWarnung);
sb_7_5->setValue(t_Set.NotGasZeit);
sb_7_6->setValue(t_Set.NotGas);
cb_7_7 = setCombo(cb_7_7, t_Set.OrientationModeControl);
 
}
// Seite 8
{
cb_8_1 = setCombo(cb_8_1, t_Set.AchsKopplung1);
cb_8_2 = setCombo(cb_8_2, t_Set.AchsKopplung2);
cb_8_3 = setCombo(cb_8_3, t_Set.CouplingYawCorrection);
}
// Seite 9 - Looping
{
if (t_Set.BitConfig & 0x01)
{
tb_9_6->setText("1");
tb_9_6->setChecked(true);
}
else
{
tb_9_6->setText("0");
tb_9_6->setChecked(false);
}
 
if (t_Set.BitConfig & 0x02)
{
tb_9_7->setText("1");
tb_9_7->setChecked(true);
}
else
{
tb_9_7->setText("0");
tb_9_7->setChecked(false);
}
 
if (t_Set.BitConfig & 0x04)
{
tb_9_8->setText("1");
tb_9_8->setChecked(true);
}
else
{
tb_9_8->setText("0");
tb_9_8->setChecked(false);
}
 
if (t_Set.BitConfig & 0x08)
{
tb_9_9->setText("1");
tb_9_9->setChecked(true);
}
else
{
tb_9_9->setText("0");
tb_9_9->setChecked(false);
}
 
cb_9_1 = setCombo(cb_9_1, t_Set.LoopGasLimit);
sb_9_2->setValue(t_Set.LoopThreshold);
sb_9_3->setValue(t_Set.WinkelUmschlagNick);
sb_9_4->setValue(t_Set.LoopHysterese);
sb_9_5->setValue(t_Set.WinkelUmschlagRoll);
 
}
// Seite 10 - Userparameter
{
cb_10_1 = setCombo(cb_10_1, t_Set.UserParam1);
cb_10_2 = setCombo(cb_10_2, t_Set.UserParam2);
cb_10_3 = setCombo(cb_10_3, t_Set.UserParam3);
cb_10_4 = setCombo(cb_10_4, t_Set.UserParam4);
cb_10_5 = setCombo(cb_10_5, t_Set.UserParam5);
cb_10_6 = setCombo(cb_10_6, t_Set.UserParam6);
cb_10_7 = setCombo(cb_10_7, t_Set.UserParam7);
cb_10_8 = setCombo(cb_10_8, t_Set.UserParam8);
}
// Seite 11 - Output
{
sb_11_1->setValue(t_Set.J16Bitmask);
cb_11_2 = setCombo(cb_11_2, int(t_Set.J16Timing));
sb_11_3->setValue(t_Set.J17Bitmask);
cb_11_4 = setCombo(cb_11_4, int(t_Set.J17Timing));
sb_11_5->setValue(t_Set.WARN_J16_Bitmask);
sb_11_6->setValue(t_Set.WARN_J17_Bitmask);
cb_11_7->setChecked(t_Set.BitConfig & CFG_MOTOR_BLINK);
 
if (t_Set.WARN_J16_Bitmask != 0)
s_11_7_cb->setChecked(true);
else
s_11_7_cb->setChecked(false);
 
if (t_Set.WARN_J17_Bitmask != 0)
s_11_8_cb->setChecked(true);
else
s_11_8_cb->setChecked(false);
}
// Seite 12
{
cb_12_1 = setCombo(cb_12_1, t_Set.NaviGpsModeControl);
cb_12_2 = setCombo(cb_12_2, t_Set.NaviGpsGain);
sb_12_3->setValue(t_Set.NaviStickThreshold);
sb_12_4->setValue(t_Set.NaviGpsMinSat);
cb_12_5 = setCombo(cb_12_5, t_Set.NaviGpsP);
cb_12_6 = setCombo(cb_12_6, t_Set.NaviGpsI);
cb_12_7 = setCombo(cb_12_7, t_Set.NaviGpsD);
cb_12_8 = setCombo(cb_12_8, t_Set.NaviGpsACC);
cb_12_9 = setCombo(cb_12_9, t_Set.NaviGpsPLimit);
cb_12_10 = setCombo(cb_12_10, t_Set.NaviGpsILimit);
cb_12_11 = setCombo(cb_12_11, t_Set.NaviGpsDLimit);
}
// Seite 13
{
cb_13_1 = setCombo(cb_13_1, t_Set.NaviWindCorrection);
cb_13_2 = setCombo(cb_13_2, t_Set.NaviSpeedCompensation);
cb_13_3 = setCombo(cb_13_3, t_Set.NaviOperatingRadius);
cb_13_4 = setCombo(cb_13_4, t_Set.NaviAngleLimitation);
sb_13_5->setValue(t_Set.NaviPH_LoginTime);
}
}
 
s_MK_Settings dlg_Main::get_MK_Settings() // DONE 0.75i
{
s_MK_Settings t_Set;
 
memcpy(t_Set.Name, le_SetName->text().toLatin1().data(), 12);
t_Set.Index = sb_Set->value();
t_Set.Revision = MK_VERSION_SETTINGS;
 
t_Set.OrientationAngle = sb_0_1->value();
 
// Seite 1
{
t_Set.GlobalConfig = 0;
t_Set.ExtraConfig = 0;
 
if (s_1_1_cb->isChecked())
t_Set.GlobalConfig = t_Set.GlobalConfig | CFG_HOEHENREGELUNG;
if (s_1_2_cb->isChecked())
t_Set.GlobalConfig = t_Set.GlobalConfig | CFG_KOMPASS_AKTIV;
if (s_1_3_cb->isChecked())
t_Set.GlobalConfig = t_Set.GlobalConfig | CFG_KOMPASS_FIX;
if (s_1_4_cb->isChecked())
t_Set.GlobalConfig = t_Set.GlobalConfig | CFG_GPS_AKTIV;
if (s_1_5_cb->isChecked())
t_Set.ExtraConfig = t_Set.ExtraConfig | CFG_SENSITIVE_RC;
if (s_1_6_cb->isChecked())
t_Set.GlobalConfig = t_Set.GlobalConfig | CFG_ACHSENKOPPLUNG_AKTIV;
if (s_1_7_cb->isChecked())
t_Set.GlobalConfig = t_Set.GlobalConfig | CFG_DREHRATEN_BEGRENZER;
if (s_1_8_cb->isChecked())
t_Set.GlobalConfig = t_Set.GlobalConfig | CFG_HEADING_HOLD;
}
// Seite 2
{
t_Set.Kanalbelegung[2] = cb_2_1->currentIndex() + 1;
t_Set.Kanalbelegung[3] = cb_2_2->currentIndex() + 1;
t_Set.Kanalbelegung[0] = cb_2_3->currentIndex() + 1;
t_Set.Kanalbelegung[1] = cb_2_4->currentIndex() + 1;
t_Set.Kanalbelegung[4] = cb_2_5->currentIndex() + 1;
t_Set.Kanalbelegung[5] = cb_2_6->currentIndex() + 1;
t_Set.Kanalbelegung[6] = cb_2_7->currentIndex() + 1;
t_Set.Kanalbelegung[7] = cb_2_8->currentIndex() + 1;
t_Set.Kanalbelegung[8] = cb_2_9->currentIndex() + 1;
t_Set.Kanalbelegung[9] = cb_2_10->currentIndex() + 1;
t_Set.Kanalbelegung[10] = cb_2_11->currentIndex() + 1;
t_Set.Kanalbelegung[11] = cb_2_12->currentIndex() + 1;
t_Set.Receiver = s_2_13_cb->currentIndex();
}
// Seite 3
{
t_Set.Stick_P = sb_3_1->value();
t_Set.Stick_D = sb_3_2->value();
t_Set.Gier_P = get_Value(cb_3_3);
t_Set.ExternalControl = get_Value(cb_3_4);
}
// Seite 4
{
t_Set.MaxHoehe = get_Value(cb_4_1);
t_Set.Hoehe_MinGas = sb_4_2->value();
t_Set.Hoehe_P = get_Value(cb_4_3);
t_Set.Luftdruck_D = get_Value(cb_4_4);
t_Set.Hoehe_ACC_Wirkung = get_Value(cb_4_5);
t_Set.Hoehe_Verstaerkung = sb_4_6->value();
t_Set.Hoehe_HoverBand = sb_4_7->value();
t_Set.Hoehe_GPS_Z = get_Value(cb_4_8);
t_Set.Hoehe_StickNeutralPoint = sb_4_9->value();
 
if (s_4_2_rb->isChecked())
t_Set.ExtraConfig = t_Set.ExtraConfig | CFG2_HEIGHT_LIMIT;
if (s_4_4_cb->isChecked())
t_Set.GlobalConfig = t_Set.GlobalConfig | CFG_HOEHEN_SCHALTER;
if (s_4_5_cb->isChecked())
t_Set.ExtraConfig = t_Set.ExtraConfig | CFG2_VARIO_BEEP;
}
// Seite 5
{
t_Set.Gyro_P = get_Value(cb_5_1);
t_Set.Gyro_I = get_Value(cb_5_2);
t_Set.Gyro_D = get_Value(cb_5_8);
t_Set.DynamicStability = get_Value(cb_5_3);
t_Set.GyroAccFaktor = sb_5_4->value();
t_Set.GyroAccAbgleich = sb_5_5->value();
t_Set.I_Faktor = get_Value(cb_5_6);
t_Set.Driftkomp = sb_5_7->value();
t_Set.Gyro_Gier_P = get_Value(cb_5_9);
t_Set.Gyro_Gier_I = get_Value(cb_5_10);
t_Set.Gyro_Stability = get_Value(cb_5_11);
}
// Seite 6
{
t_Set.ServoNickControl = get_Value(cb_6_1);
t_Set.ServoNickComp = sb_6_2->value();
t_Set.ServoNickMin = sb_6_3->value();
t_Set.ServoNickMax = sb_6_4->value();
 
t_Set.ServoRollControl = get_Value(cb_6_7);
t_Set.ServoRollComp = sb_6_8->value();
t_Set.ServoRollMin = sb_6_10->value();
t_Set.ServoRollMax = sb_6_11->value();
 
t_Set.ServoNickRefresh = sb_6_5->value();
 
t_Set.Servo3 = get_Value(cb_6_12);
t_Set.Servo4 = get_Value(cb_6_13);
t_Set.Servo5 = get_Value(cb_6_14);
 
if (cb_6_6->isChecked())
t_Set.ServoCompInvert = t_Set.ServoCompInvert | 0x01;
if (cb_6_9->isChecked())
t_Set.ServoCompInvert = t_Set.ServoCompInvert | 0x02;
}
// Seite 7
{
t_Set.Gas_Min = sb_7_1->value();
t_Set.Gas_Max = sb_7_2->value();
t_Set.KompassWirkung = get_Value(cb_7_3);
t_Set.UnterspannungsWarnung = sb_7_4->value();
t_Set.NotGasZeit = sb_7_5->value();
t_Set.NotGas = sb_7_6->value();
t_Set.OrientationModeControl = get_Value(cb_7_7);
}
// Seite 8
{
t_Set.AchsKopplung1 = get_Value(cb_8_1);
t_Set.AchsKopplung2 = get_Value(cb_8_2);
t_Set.CouplingYawCorrection = get_Value(cb_8_3);
}
// Seite 9
{
t_Set.BitConfig = 0;
if (tb_9_6->text() == QString("1"))
t_Set.BitConfig = t_Set.BitConfig | 0x01;
if (tb_9_7->text() == QString("1"))
t_Set.BitConfig = t_Set.BitConfig | 0x02;
if (tb_9_8->text() == QString("1"))
t_Set.BitConfig = t_Set.BitConfig | 0x04;
if (tb_9_9->text() == QString("1"))
t_Set.BitConfig = t_Set.BitConfig | 0x08;
 
 
t_Set.LoopGasLimit = get_Value(cb_9_1);
t_Set.LoopThreshold = sb_9_2->value();
t_Set.WinkelUmschlagNick = sb_9_3->value();
t_Set.LoopHysterese = sb_9_4->value();
t_Set.WinkelUmschlagRoll = sb_9_5->value();
}
// Seite 10
{
t_Set.UserParam1 = get_Value(cb_10_1);
t_Set.UserParam2 = get_Value(cb_10_2);
t_Set.UserParam3 = get_Value(cb_10_3);
t_Set.UserParam4 = get_Value(cb_10_4);
t_Set.UserParam5 = get_Value(cb_10_5);
t_Set.UserParam6 = get_Value(cb_10_6);
t_Set.UserParam7 = get_Value(cb_10_7);
t_Set.UserParam8 = get_Value(cb_10_8);
}
// Seite 11
{
t_Set.J16Bitmask = sb_11_1->value();
t_Set.J16Timing = get_Value(cb_11_2);
t_Set.J17Bitmask = sb_11_3->value();
t_Set.J17Timing = get_Value(cb_11_4);
t_Set.WARN_J16_Bitmask = sb_11_5->value();
t_Set.WARN_J17_Bitmask = sb_11_6->value();
 
if (cb_11_7->isChecked())
t_Set.BitConfig = t_Set.BitConfig | CFG_MOTOR_BLINK;
 
if (!s_11_7_cb->isChecked())
t_Set.WARN_J16_Bitmask = 0;
if (!s_11_8_cb->isChecked())
t_Set.WARN_J17_Bitmask = 0;
 
}
// Seite 12
{
t_Set.NaviGpsModeControl = get_Value(cb_12_1);
t_Set.NaviGpsGain = get_Value(cb_12_2);
t_Set.NaviStickThreshold = sb_12_3->value();
t_Set.NaviGpsMinSat = sb_12_4->value();
t_Set.NaviGpsP = get_Value(cb_12_5);
t_Set.NaviGpsI = get_Value(cb_12_6);
t_Set.NaviGpsD = get_Value(cb_12_7);
t_Set.NaviGpsACC = get_Value(cb_12_8);
t_Set.NaviGpsPLimit = get_Value(cb_12_9);
t_Set.NaviGpsILimit = get_Value(cb_12_10);
t_Set.NaviGpsDLimit = get_Value(cb_12_11);
}
// Seite 13
{
t_Set.NaviWindCorrection = get_Value(cb_13_1);
t_Set.NaviSpeedCompensation = get_Value(cb_13_2);
t_Set.NaviOperatingRadius = get_Value(cb_13_3);
t_Set.NaviAngleLimitation = get_Value(cb_13_4);
t_Set.NaviPH_LoginTime = sb_13_5->value();
}
 
return t_Set;
}
 
int dlg_Main::get_Value(QComboBox *Combo)
{
if (Combo->currentText() == QString("Poti 1"))
return 255;
if (Combo->currentText() == QString("Poti 2"))
return 254;
if (Combo->currentText() == QString("Poti 3"))
return 253;
if (Combo->currentText() == QString("Poti 4"))
return 252;
if (Combo->currentText() == QString("Poti 5"))
return 251;
if (Combo->currentText() == QString("Poti 6"))
return 250;
if (Combo->currentText() == QString("Poti 7"))
return 249;
if (Combo->currentText() == QString("Poti 8"))
return 248;
return Combo->currentText().toInt();
}
 
QComboBox *dlg_Main::setCombo(QComboBox *Combo, int Wert)
{
if (Wert <= 245)
{
Combo->setItemText(8, QString("%1").arg(Wert));
Combo->setCurrentIndex(8);
}
else
{
Combo->setCurrentIndex(255 - Wert);
}
return Combo;
}
 
void dlg_Main::set_LED(QToolButton *ToolButton, bool On)
{
QIcon Icons[2] ;
Icons[0].addPixmap(QPixmap(QString::fromUtf8(":/Flags/Global/Images/Actions/LED_Off.png")), QIcon::Normal, QIcon::Off);
Icons[1].addPixmap(QPixmap(QString::fromUtf8(":/Flags/Global/Images/Actions/LED_Red.png")), QIcon::Normal, QIcon::Off);
 
if (ToolButton->text() == QString("0") && On)
{
ToolButton->setIcon(Icons[1]);
ToolButton->setText("1");
}
else if (ToolButton->text() == QString("1") && !On)
{
ToolButton->setIcon(Icons[0]);
ToolButton->setText("0");
}
else if (ToolButton->text() == QString("00") && On)
{
ToolButton->setIcon(Icons[1]);
ToolButton->setText("11");
}
else if (ToolButton->text() == QString("11") && !On)
{
ToolButton->setIcon(Icons[0]);
ToolButton->setText("00");
}
else if (ToolButton->text() == QString("000") && On)
{
ToolButton->setIcon(Icons[1]);
ToolButton->setText("111");
}
else if (ToolButton->text() == QString("111") && !On)
{
ToolButton->setIcon(Icons[0]);
ToolButton->setText("000");
}
else if (ToolButton->text() == QString("0000") && On)
{
ToolButton->setIcon(Icons[1]);
ToolButton->setText("1111");
}
else if (ToolButton->text() == QString("1111") && !On)
{
ToolButton->setIcon(Icons[0]);
ToolButton->setText("0000");
}
}
 
void dlg_Main::slot_LEDtoValue()
{
QToolButton *ToolButton = (QToolButton*)sender();
 
if (ToolButton->text() == QString("0"))
{
set_LED(ToolButton, true);
sb_11_1->setValue(sb_11_1->value() + ToolButton->toolTip().toInt());
}
else if (ToolButton->text() == QString("1"))
{
set_LED(ToolButton);
sb_11_1->setValue(sb_11_1->value() - ToolButton->toolTip().toInt());
}
 
else if (ToolButton->text() == QString("00"))
{
set_LED(ToolButton, true);
sb_11_3->setValue(sb_11_3->value() + ToolButton->toolTip().toInt());
}
else if (ToolButton->text() == QString("11"))
{
set_LED(ToolButton);
sb_11_3->setValue(sb_11_3->value() - ToolButton->toolTip().toInt());
}
 
else if (ToolButton->text() == QString("000"))
{
set_LED(ToolButton, true);
sb_11_5->setValue(sb_11_5->value() + ToolButton->toolTip().toInt());
}
else if (ToolButton->text() == QString("111"))
{
set_LED(ToolButton);
sb_11_5->setValue(sb_11_5->value() - ToolButton->toolTip().toInt());
}
 
else if (ToolButton->text() == QString("0000"))
{
set_LED(ToolButton, true);
sb_11_6->setValue(sb_11_6->value() + ToolButton->toolTip().toInt());
}
else if (ToolButton->text() == QString("1111"))
{
set_LED(ToolButton);
sb_11_6->setValue(sb_11_6->value() - ToolButton->toolTip().toInt());
}
 
 
}
 
void dlg_Main::slot_ValuetoLED16(int Wert)
{
set_LED(J16_0, Wert & 0x80);
set_LED(J16_1, Wert & 0x40);
set_LED(J16_2, Wert & 0x20);
set_LED(J16_3, Wert & 0x10);
set_LED(J16_4, Wert & 0x08);
set_LED(J16_5, Wert & 0x04);
set_LED(J16_6, Wert & 0x02);
set_LED(J16_7, Wert & 0x01);
}
 
void dlg_Main::slot_ValuetoLED17(int Wert)
{
set_LED(J17_0, Wert & 0x80);
set_LED(J17_1, Wert & 0x40);
set_LED(J17_2, Wert & 0x20);
set_LED(J17_3, Wert & 0x10);
set_LED(J17_4, Wert & 0x08);
set_LED(J17_5, Wert & 0x04);
set_LED(J17_6, Wert & 0x02);
set_LED(J17_7, Wert & 0x01);
}
 
void dlg_Main::slot_ValuetoLED16A(int Wert)
{
set_LED(J16_A_0, Wert & 0x80);
set_LED(J16_A_1, Wert & 0x40);
set_LED(J16_A_2, Wert & 0x20);
set_LED(J16_A_3, Wert & 0x10);
set_LED(J16_A_4, Wert & 0x08);
set_LED(J16_A_5, Wert & 0x04);
set_LED(J16_A_6, Wert & 0x02);
set_LED(J16_A_7, Wert & 0x01);
}
 
void dlg_Main::slot_ValuetoLED17A(int Wert)
{
set_LED(J17_A_0, Wert & 0x80);
set_LED(J17_A_1, Wert & 0x40);
set_LED(J17_A_2, Wert & 0x20);
set_LED(J17_A_3, Wert & 0x10);
set_LED(J17_A_4, Wert & 0x08);
set_LED(J17_A_5, Wert & 0x04);
set_LED(J17_A_6, Wert & 0x02);
set_LED(J17_A_7, Wert & 0x01);
}
 
void dlg_Main::slot_tbUp()
{
if (tb_9_6->text() == QString("0"))
{
tb_9_6->setText("1");
}
else
{
tb_9_6->setText("0");
}
}
 
void dlg_Main::slot_tbDown()
{
if (tb_9_7->text() == QString("0"))
{
tb_9_7->setText("1");
}
else
{
tb_9_7->setText("0");
}
}
 
void dlg_Main::slot_tbLeft()
{
if (tb_9_8->text() == QString("0"))
{
tb_9_8->setText("1");
}
else
{
tb_9_8->setText("0");
}
}
 
void dlg_Main::slot_tbRight()
{
if (tb_9_9->text() == QString("0"))
{
tb_9_9->setText("1");
}
else
{
tb_9_9->setText("0");
}
}
 
// Programm Ende
dlg_Main::~dlg_Main()
{
o_Settings->GUI.isMax = isMaximized();
o_Settings->GUI.Size = size();
o_Settings->GUI.Point = pos();
o_Settings->GUI.Toolbar = ac_Toolbar->isChecked();
 
o_Settings->write_Settings();
// qDebug("Ende.");
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Dialogs/dlg_Main.h
0,0 → 1,114
/***************************************************************************
* 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 "dlg_MotorTest.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;
 
// MotorTest GUI
dlg_MotorTest *f_MotorTest;
 
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_ac_MotorTest();
 
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
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Dialogs/dlg_Main.ui
0,0 → 1,9828
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_Main_UI</class>
<widget class="QMainWindow" name="dlg_Main_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>753</width>
<height>353</height>
</rect>
</property>
<property name="windowTitle">
<string>QMK-Template</string>
</property>
<property name="windowIcon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Settings.png</normaloff>:/Icon/Global/Images/Icons/QMK-Settings.png</iconset>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout_28">
<item row="0" column="0" colspan="2">
<widget class="wgt_Connection" name="wg_Connection" native="true"/>
</item>
<item row="0" column="2">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_27">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QWidget" name="wg_Set" native="true">
<layout class="QGridLayout" name="gridLayout_8">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_146">
<property name="text">
<string>Parametersatz</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="sb_Set">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>5</number>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="le_SetName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QListWidget" name="listWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font/>
</property>
<item>
<property name="text">
<string>Konfiguration</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Kanäle</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Stick</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Höhe</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Gyro</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Kamera</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Sonstiges</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Kopplung</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Looping</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>User</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Output</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Navi-Ctrl</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Navi-Ctrl 2</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QStackedWidget" name="stackedWidget">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="page">
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="3">
<widget class="QTextEdit" name="te_Help_1">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;Diese Seite dient der Konfiguration der Hardware bzw. der verschiedenen Funktionen des Mikrokopters.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Höhenregler&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;: Häkchen setzen, wenn der Luftdrucksensor bestückt ist und die Höhenregelung benutzt werden soll. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Höhenfunktion per Schalter&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;: wenn die Fernsteuerung mit einem Kippschalter auf einem freien Kanal erweitert wurde, kann die Funktion „Halten der aktuell geflogenen Höhe“ zugeschaltet werden. Wenn dies nicht angewählt wird, gilt der Setpoint (siehe unten), also z.B. ein Poti. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Heading Hold&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;: In diesem Modus richtet sich der MikroKopter nicht waagerecht aus wenn der Stick in Neutralstellung ist. Diese Funktion ist eher etwas für erfahrenen Piloten, oder Piloten, die an X-3D-Steuerung gewöhnt sind. Mit dieser Einstellung sind alle Arten der Loopings möglich. &lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; font-size:11pt;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;--&amp;gt; Achtung: Wer HH fliegen möchte, muss den I-Anteil des Hauptreglers erhöhen (auf 30 z.B.)! &lt;/li&gt;&lt;/ul&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Kompass&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;: Häkchen setzen, wenn das Kompassmodul angeschlossen ist und genutzt werden soll. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Kompass Ausrichtung fest&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;: Der MikroKopter richtet sich dann immer wieder in die Richtung aus, in die er beim Start gestanden hat. Ist das Feld nicht markiert, lässt sich die Richtung mit dem Gier-Stick ändern. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;GPS&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;: alternative Software-Versionen unterstützen ein ublox-GPS-Modul. Damit sind dann GPS-Funktionen wie Position halten, Position anfliegen, coming home und das Abfliegen von Waypoints möglich. Stichwort &amp;quot;Autonomes Fliegen&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Achsenkopplung&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;:Hier lässt sich die Achsenkopplung global aktivieren oder deaktivieren. Die Achsenkopplung verhindert, dass der MikroKopter nach einer Kurve schief steht, weil die Winkel intern beim Gieren korrigiert werden. Sollte immer aktiviert sein. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Drehratenbegrenzung&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;: Zusätzliche Begrenzung der Drehrate. Mit dieser Option wird die Kennlinie des Gyros an den Enden angehoben. Dies verhindert schnelle Manöver, da ab einer bestimmten Drehrate stärker gegengeregelt wird. Betrifft nur Nick und Roll. (Nur für Anfänger interessant) &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QFrame" name="frame_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="s_1_1_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Höhenregelung</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="s_1_4_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS aktiv</string>
</property>
</widget>
</item>
<item row="2" column="0" rowspan="2" colspan="3">
<widget class="QCheckBox" name="s_1_2_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Kompass</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_22">
<property name="minimumSize">
<size>
<width>10</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>10</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="0" colspan="3">
<widget class="QCheckBox" name="s_1_5_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Erweiterte Empfangssignalprüfung</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="3">
<widget class="QCheckBox" name="s_1_6_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Achs-(ent-)kopplung</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="3">
<widget class="QCheckBox" name="s_1_7_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Drehratenbegrenzung</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="3">
<widget class="QCheckBox" name="s_1_8_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Heading Hold (Nick/Roll)</string>
</property>
</widget>
</item>
<item row="9" column="0">
<spacer name="verticalSpacer_17">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="s_1_3_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Feste Ausrichtung</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_2">
<layout class="QGridLayout" name="gridLayout_21">
<item row="0" column="0">
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="font">
<font/>
</property>
<property name="text">
<string>Gas:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="cb_2_1">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_11">
<property name="font">
<font/>
</property>
<property name="text">
<string>Poti 3:</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QComboBox" name="cb_2_7">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 1</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 2</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 3</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 4</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 5</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 6</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 7</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 8</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 9</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 10</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 11</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 12</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="font">
<font/>
</property>
<property name="text">
<string>Gier:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="cb_2_2">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_12">
<property name="font">
<font/>
</property>
<property name="text">
<string>Poti 4:</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QComboBox" name="cb_2_8">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 1</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 2</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 3</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 4</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 5</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 6</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 7</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 8</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 9</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 10</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 11</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 12</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="font">
<font/>
</property>
<property name="text">
<string>Nick:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="cb_2_3">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_32">
<property name="font">
<font/>
</property>
<property name="text">
<string>Poti 5:</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QComboBox" name="cb_2_9">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 1</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 2</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 3</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 4</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 5</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 6</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 7</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 8</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 9</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 10</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 11</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 12</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_8">
<property name="font">
<font/>
</property>
<property name="text">
<string>Roll:</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QComboBox" name="cb_2_4">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_34">
<property name="font">
<font/>
</property>
<property name="text">
<string>Poti 6:</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QComboBox" name="cb_2_10">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 1</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 2</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 3</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 4</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 5</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 6</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 7</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 8</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 9</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 10</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 11</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 12</string>
</property>
</item>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_9">
<property name="font">
<font/>
</property>
<property name="text">
<string>Poti 1:</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QComboBox" name="cb_2_5">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 1</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 2</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 3</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 4</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 5</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 6</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 7</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 8</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 9</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 10</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 11</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 12</string>
</property>
</item>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_33">
<property name="font">
<font/>
</property>
<property name="text">
<string>Poti 7:</string>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QComboBox" name="cb_2_11">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 1</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 2</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 3</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 4</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 5</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 6</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 7</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 8</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 9</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 10</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 11</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 12</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_10">
<property name="font">
<font/>
</property>
<property name="text">
<string>Poti 2:</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QComboBox" name="cb_2_6">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 1</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 2</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 3</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 4</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 5</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 6</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 7</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 8</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 9</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 10</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 11</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 12</string>
</property>
</item>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="label_35">
<property name="font">
<font/>
</property>
<property name="text">
<string>Poti 8:</string>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QComboBox" name="cb_2_12">
<item>
<property name="text">
<string>RC 1</string>
</property>
</item>
<item>
<property name="text">
<string>RC 2</string>
</property>
</item>
<item>
<property name="text">
<string>RC 3</string>
</property>
</item>
<item>
<property name="text">
<string>RC 4</string>
</property>
</item>
<item>
<property name="text">
<string>RC 5</string>
</property>
</item>
<item>
<property name="text">
<string>RC 6</string>
</property>
</item>
<item>
<property name="text">
<string>RC 7</string>
</property>
</item>
<item>
<property name="text">
<string>RC 8</string>
</property>
</item>
<item>
<property name="text">
<string>RC 9</string>
</property>
</item>
<item>
<property name="text">
<string>RC 10</string>
</property>
</item>
<item>
<property name="text">
<string>RC 11</string>
</property>
</item>
<item>
<property name="text">
<string>RC 12</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 1</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 2</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 3</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 4</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 5</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 6</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 7</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 8</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 9</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 10</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 11</string>
</property>
</item>
<item>
<property name="text">
<string>Ser 12</string>
</property>
</item>
</widget>
</item>
<item row="6" column="2">
<spacer name="verticalSpacer_21">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0" colspan="5">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_155">
<property name="font">
<font/>
</property>
<property name="text">
<string>Empfänger wählen:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="s_2_13_cb">
<item>
<property name="text">
<string>Multisignal (PPM)</string>
</property>
</item>
<item>
<property name="text">
<string>Spectrum Satellit</string>
</property>
</item>
<item>
<property name="text">
<string>Spectrum Satellit (HiRes)</string>
</property>
</item>
<item>
<property name="text">
<string>Spectrum Satellit (LowRes)</string>
</property>
</item>
<item>
<property name="text">
<string>Jeti Satellit</string>
</property>
</item>
<item>
<property name="text">
<string>ACT DSL</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="7" column="0" colspan="5">
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Fernsteuerung</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="8" column="2">
<widget class="QProgressBar" name="pb_K7">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="label_17">
<property name="text">
<string>7</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QProgressBar" name="pb_K2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QLabel" name="label_4">
<property name="text">
<string>2</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QProgressBar" name="pb_K1">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>1</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="8" column="4">
<widget class="QProgressBar" name="pb_K8">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QLabel" name="label_18">
<property name="text">
<string>8</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="8" column="6">
<widget class="QProgressBar" name="pb_K10">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="6" column="6">
<widget class="QLabel" name="label_36">
<property name="text">
<string>10</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="8" column="7">
<widget class="QProgressBar" name="pb_K11">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="8" column="8">
<widget class="QProgressBar" name="pb_K12">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="6" column="8">
<widget class="QLabel" name="label_47">
<property name="text">
<string>12</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="5">
<widget class="QProgressBar" name="pb_K3">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QLabel" name="label_13">
<property name="text">
<string>3</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QLabel" name="label_14">
<property name="text">
<string>4</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="6">
<widget class="QProgressBar" name="pb_K4">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="3" column="8">
<widget class="QProgressBar" name="pb_K6">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="3" column="7">
<widget class="QProgressBar" name="pb_K5">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="2" column="7">
<widget class="QLabel" name="label_15">
<property name="text">
<string>5</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="8">
<widget class="QLabel" name="label_16">
<property name="text">
<string>6</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="8" column="5">
<widget class="QProgressBar" name="pb_K9">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="6" column="5">
<widget class="QLabel" name="label_49">
<property name="text">
<string>9</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="6" column="7">
<widget class="QLabel" name="label_46">
<property name="text">
<string>11</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4">
<attribute name="title">
<string>Seriell</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_18">
<item row="0" column="0">
<widget class="QLabel" name="label_132">
<property name="text">
<string>1</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_78">
<property name="text">
<string>2</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_76">
<property name="text">
<string>3</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_136">
<property name="text">
<string>4</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="label_133">
<property name="text">
<string>5</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QLabel" name="label_154">
<property name="text">
<string>6</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QProgressBar" name="pb_K1_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QProgressBar" name="pb_K2_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QProgressBar" name="pb_K3_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QProgressBar" name="pb_K4_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QProgressBar" name="pb_K5_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QProgressBar" name="pb_K6_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_117">
<property name="text">
<string>7</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_50">
<property name="text">
<string>8</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_111">
<property name="text">
<string>9</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_128">
<property name="text">
<string>10</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QLabel" name="label_121">
<property name="text">
<string>11</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QLabel" name="label_118">
<property name="text">
<string>12</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QProgressBar" name="pb_K7_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QProgressBar" name="pb_K8_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QProgressBar" name="pb_K9_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QProgressBar" name="pb_K10_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QProgressBar" name="pb_K11_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
<item row="3" column="5">
<widget class="QProgressBar" name="pb_K12_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string> %v</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="0" column="2" rowspan="2">
<widget class="QTextEdit" name="te_Help_2">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;Hier können die vom Sender übertragenen Kanäle den Funktionen des MikroKopters zugeordnet werden. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Port 1-8 sind per Sender frei einstellbare Werte.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Die Balken zeigen den Ausschlag des jeweiligen Kanals an.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="s_2_9_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Erweiterte Empfangssignalprüfung</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_3">
<layout class="QGridLayout" name="gridLayout_19">
<item row="0" column="0">
<widget class="QFrame" name="frame_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_19">
<property name="font">
<font/>
</property>
<property name="text">
<string>Nick / Roll P-Anteil:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="sb_3_1">
<property name="maximum">
<number>64</number>
</property>
<property name="value">
<number>4</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_20">
<property name="font">
<font/>
</property>
<property name="text">
<string>Nick / Roll D-Anteil:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="sb_3_2">
<property name="maximum">
<number>64</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_21">
<property name="font">
<font/>
</property>
<property name="text">
<string>Gier P-Anteil:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="cb_3_3">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_24">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_51">
<property name="font">
<font/>
</property>
<property name="text">
<string>Externe Kontrolle:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="cb_3_4">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="7" column="1">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>85</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="1">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_52">
<property name="text">
<string>0=OFF, Dubwise: Gain, </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_53">
<property name="text">
<string>Riddim &gt; 128 = ON</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QTextEdit" name="te_Help_3">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;Diese Parameter dienen zur Einstellung der Stickwirkung.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;P-Anteil:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Stick-Verstärkung. Je grösser, desto stärker reagiert der MK auf die Stickbewegungen. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;D-Anteil:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Der MikroKopter folgt den Bewegungen des Sticks umso spontaner, je grösser dieser Wert ist. Genaugenommen wirkt hier zusätzlich die Stick&lt;/span&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;geschwindigkeit&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; auf den MK. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Gier-P: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Verhältnis Gier-Geschwindigkeit zum Stickausschlag.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_4">
<layout class="QGridLayout" name="gridLayout_42">
<item row="0" column="2">
<widget class="QTextEdit" name="te_Help_4">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;Hier kann der Höhenregler parametriert werden.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Soll-Höhe:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Gibt die maximale Höhe an. Normalerweise wird hier ein Poti als Kanal der Funke eingetragen. Kleine Werte ermöglichen nur niedrige Maximalhöhen.&lt;/span&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Fluganfänger sollten das Feature nutzen, hier evtl. 0 eintragen und den Höhenregler aktivieren (siehe oben). Dann kann es nicht passieren, dass der MikroKopter zu hoch steigt. Bei Nutzung des Höhenreglers als Schalter ist hier auch das entsprechende Poti einzutragen, um den Kanal der Funke damit festzulegen. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Min Gas:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; unter diesen Wert wird das Gas nicht gestellt, wenn die Höhe überschritten wurde. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;P-Anteil:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Abhängigkeit von Rücknahme von Gas bei Höhe über. Je höher dieser Wert, desto kleiner ist der Flugbereich oberhalb der Maximalhöhe. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Luftdruck-D:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Dämpft das Schwingverhalten des Höhenreglers. Geringste Luftdruckänderungen haben damit grosse Wirkung auf Gas. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Z-ACC:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Dämpft das Schwingverhalten mittels des Beschleunigungssensors. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Verstärkung:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; ermöglicht grössere Flughöhen, wenn dieser Wert vergrößert wird. Der Setpiont wird mit diesem Wert multipliziert. &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QFrame" name="frame_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_17">
<item row="0" column="0">
<widget class="QCheckBox" name="s_4_1_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Höhenregelung aktiv</string>
</property>
</widget>
</item>
<item row="1" column="0" rowspan="2" colspan="2">
<widget class="QFrame" name="Frame_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_11">
<item row="0" column="0">
<widget class="QLabel" name="label_23">
<property name="minimumSize">
<size>
<width>10</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>10</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QRadioButton" name="s_4_2_rb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Höhenbegrenzung</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="3" colspan="3">
<widget class="QCheckBox" name="s_4_4_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Schalter für Höhe</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QRadioButton" name="s_4_3_rb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Vario-Höhe</string>
</property>
</widget>
</item>
<item row="1" column="3" colspan="3">
<widget class="QCheckBox" name="s_4_5_cb">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font/>
</property>
<property name="text">
<string>akustisches Variometer</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_25">
<property name="font">
<font/>
</property>
<property name="text">
<string>Sollwert:</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QComboBox" name="cb_4_1">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_26">
<property name="font">
<font/>
</property>
<property name="text">
<string>Min. Gas:</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QSpinBox" name="sb_4_2">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="label_27">
<property name="font">
<font/>
</property>
<property name="text">
<string>Höhe P-Anteil:</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QComboBox" name="cb_4_3">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="13" column="0" colspan="2">
<widget class="QLabel" name="label_29">
<property name="font">
<font/>
</property>
<property name="text">
<string>Z-ACC Wirkung:</string>
</property>
</widget>
</item>
<item row="13" column="2">
<widget class="QComboBox" name="cb_4_5">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="6" column="2">
<widget class="QComboBox" name="cb_4_4">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="label_28">
<property name="font">
<font/>
</property>
<property name="text">
<string>Luftdruck D-Anteil:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_30">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font/>
</property>
<property name="text">
<string>Verstärkung/Rate:</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QSpinBox" name="sb_4_6">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximum">
<number>50</number>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_109">
<property name="font">
<font/>
</property>
<property name="text">
<string>Schwebe-Gas +/-:</string>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QSpinBox" name="sb_4_7">
<property name="maximum">
<number>50</number>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="label_114">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS Z:</string>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QComboBox" name="cb_4_8">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="label_147">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font/>
</property>
<property name="text">
<string>Stick Neutral-Punkt:</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QSpinBox" name="sb_4_9">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximum">
<number>240</number>
</property>
<property name="value">
<number>120</number>
</property>
</widget>
</item>
<item row="13" column="3" colspan="2">
<widget class="QLabel" name="label_31">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string> 0 = automatisch
120 = Mittelposition</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_14">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_5">
<layout class="QGridLayout" name="gridLayout_41">
<item row="0" column="4">
<widget class="QTextEdit" name="te_Help_5">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;Hier werden die Parameter für die Gyroskope eingestellt.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Gyro-P: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Einfluss des Gyros auf die Nick- und Rollgeschwindigkeit. Je höher wer Wert, desto träger bewegt sich der MikroKopter. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Gyro&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;-I: Lagestabilisierung. Je höher der Wert, desto stärker der Zusammenhang von Stickwinkel und Lagewinkel. Führt bei zu grossen Werten (gegenüber Gyro-P) zum Schwingen. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Gyro-D:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; TEXT&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Dynamic Stability&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Mit diesem Wert lässt sich nun einstellen, wieviel Schub die Achsenregelung zur Verfügung hat, um zu Regeln Einige haben sich daran gestört, dass der MK beim starken Regeln steigt. Das war auch der Grund für das Steigen bei Wind oder sonstigen Phänomenen wie Lagerschaden zum Beispiel. Ausserdem haben Anfänger Probleme mit dem Springen bei der Landung, was auch diese Ursache hat. Kleiner 64 -&amp;gt; der Schub wird auf unter Gas limitiert -&amp;gt; kein Steigen bei starkem Regeln Grösser 64 -&amp;gt; der Schub darf grösser werden als Gas -&amp;gt; hartes Regeln der Achsen -&amp;gt; Steigen bei starken Regeln In den Settings ist es so verteilt: 1.Sport: 100 -&amp;gt; steigt 2.Normal: 75 -&amp;gt; steigt etwas 3.Beginner: 50 -&amp;gt; steigt nicht &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;ACC/Gyro-Faktor: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;: Abhängigkeit zwischen ACC-Sensorwert und Gyrointegral. Wird der MK einige Grad gekippt, müssen ACC-Linie und Gyro-Integral deckungsgleich sein. Ggf. kann das hier korrigiert werden. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;ACC/Gyro-Comp.: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Grad des Fusion zwischen ACC und Gyro (reziprok). Je kleiner der Wert, desto schneller wird der Gyrowinkel dem ACC-Sensor angepasst. Zum Schweben sind größere Werte vorteilhaft (&amp;gt;100). Zum Heizen sollte man kleine Werte nehmen (10-50) &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Hauptregler I:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Summe der Winkelfehler. Sorgt für grössere Präzision zwischen Stick und Lage. Sollte beim Fliegen mit Heading Hold (oben) erhöht werden. Kann bei zu grossen Werten überschwingen. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Driftkompensation:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Gibt an, wieviel Digits pro 500ms der Drift nachgeführt werden darf. Hier sollte ein kleiner Wert (1-3) angestrebt werden. Wert zu klein -&amp;gt; Gyrodrift (z.B. bei Temperaturänderungen) zieht den MK stark in eine Richtung. Wert zu gross -&amp;gt; MK schwebt nicht so gern still auf einer Stelle. Null -&amp;gt; Driftkompensation aus, Standart ist 4, also eher konservativ &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QFrame" name="frame_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_25">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_37">
<property name="font">
<font/>
</property>
<property name="text">
<string>Gyro P-Anteil:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="cb_5_1">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_44">
<property name="font">
<font/>
</property>
<property name="text">
<string>Gier P-Anteil</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QComboBox" name="cb_5_9">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_38">
<property name="font">
<font/>
</property>
<property name="text">
<string>Gyro I-Anteil:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cb_5_2">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_45">
<property name="font">
<font/>
</property>
<property name="text">
<string>Gier I-Anteil</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QComboBox" name="cb_5_10">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_135">
<property name="font">
<font/>
</property>
<property name="text">
<string>Gyro D-Anteil:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="cb_5_8">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_160">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_39">
<property name="font">
<font/>
</property>
<property name="text">
<string>Dynamische Stabilität:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="cb_5_3">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="label_43">
<property name="font">
<font/>
</property>
<property name="text">
<string>Driftkompensation:</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QSpinBox" name="sb_5_7">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_108">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_40">
<property name="font">
<font/>
</property>
<property name="text">
<string>ACC/Gyro-Faktor:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QSpinBox" name="sb_5_4">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="label_41">
<property name="font">
<font/>
</property>
<property name="text">
<string>ACC/Gyro-Komp.:</string>
</property>
</widget>
</item>
<item row="6" column="3">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QSpinBox" name="sb_5_5">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_48">
<property name="text">
<string>(1/x)</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_42">
<property name="font">
<font/>
</property>
<property name="text">
<string>Hauptregler I-Anteil:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QComboBox" name="cb_5_6">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="label">
<property name="text">
<string>Gyro stabilität</string>
</property>
</widget>
</item>
<item row="8" column="3">
<widget class="QComboBox" name="cb_5_11">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_161">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_6">
<layout class="QGridLayout" name="gridLayout_39">
<item row="0" column="5">
<widget class="QTextEdit" name="te_Help_6">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;Einstellungen für das Kamera-Servo an J7 der FlightCtrl.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Servo-Control: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Servowert zum Schwenken der Kamera. Entweder fixen Wert, oder Poti eintragen. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Nick-Kompensation: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Einfluss des Nickwinkels auf den Servo. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Invert direction:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Drehrichtung invertieren. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Servo Min:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Minimalwert als Anschlag. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Servo Max:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Maximalwert als Anschlag. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Servo Refresh-Rate:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Ansteuergeschwindigkeit. Einige Servos können nicht mit schnellen Werten angesteuert werden &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QFrame" name="frame_8">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_24">
<item row="0" column="0" rowspan="2">
<layout class="QGridLayout" name="gridLayout_22">
<item row="0" column="1">
<widget class="QLabel" name="label_137">
<property name="font">
<font/>
</property>
<property name="text">
<string>Nick</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_138">
<property name="font">
<font/>
</property>
<property name="text">
<string>Roll</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_55">
<property name="font">
<font/>
</property>
<property name="text">
<string>Servo Ansteuerung:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cb_6_1">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="1" column="3">
<widget class="QComboBox" name="cb_6_7">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_56">
<property name="font">
<font/>
</property>
<property name="text">
<string>Kompensation:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="sb_6_2">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QSpinBox" name="sb_6_8">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_130">
<property name="font">
<font/>
</property>
<property name="text">
<string>Richtung umkehren</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="cb_6_6">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QCheckBox" name="cb_6_9">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_57">
<property name="font">
<font/>
</property>
<property name="text">
<string>Servo min:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="sb_6_3">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QSpinBox" name="sb_6_10">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_58">
<property name="font">
<font/>
</property>
<property name="text">
<string>Servo max:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="sb_6_4">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QSpinBox" name="sb_6_11">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="0" column="2" rowspan="6">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_54">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_61">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_59">
<property name="font">
<font/>
</property>
<property name="text">
<string>Ansteuergeschwindigkeit</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="sb_6_5">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_62">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="0">
<widget class="QLabel" name="label_156">
<property name="font">
<font/>
</property>
<property name="text">
<string>Servo 3:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="cb_6_12">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_157">
<property name="font">
<font/>
</property>
<property name="text">
<string>Servo 4:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QComboBox" name="cb_6_13">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_158">
<property name="font">
<font/>
</property>
<property name="text">
<string>Servo 5:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cb_6_14">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_7">
<layout class="QGridLayout" name="gridLayout_38">
<item row="0" column="1">
<widget class="QTextEdit" name="te_Help_7">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Bei Empfangsverlust: Geht der Funkempfang verloren (außer Reichweite oder Sender aus), tritt die Not-Gas-Regelung in Kraft um dem Piloten Zeit für Gegenmaßnahmen zu geben. Die gesamte Not-Gas-Regelung wird allerdings erst aktiv, wenn ein Gas-Wert von 40 für mindestens 4 Sekunden überschritten war (d.h. der Kopter wahrscheinlich fliegt)! &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:1; text-indent:1px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Min.Gas &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Minimaler Gaswert, der an die Motoren geht &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:1; text-indent:1px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Max.Gas &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Maximaler Gaswert, der an die Motoren geht. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:1; text-indent:1px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Kompasswirkung &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;:Ist ein Kompass angeschlossen, kann hiermit der Einfluss auf Gier eingestellt werden &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:1; text-indent:1px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Unterspannung &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Schwellwert in 0,1V zum Melden der Akku-Unterspannung &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:1; text-indent:1px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Not-Gas Zeit [0.1s]:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Hier wird die Zeit in Zehntelsekunden eingetragen, für die das Not-Gas nach Empfangsverlust aktiv wird. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:1; text-indent:1px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Not-Gas:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Wert für das Not-Gas. &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QFrame" name="frame_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_26">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_23">
<item row="0" column="0">
<widget class="QLabel" name="label_68">
<property name="font">
<font/>
</property>
<property name="text">
<string>Min. Gas:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="sb_7_1">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_67">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_65">
<property name="font">
<font/>
</property>
<property name="text">
<string>Max. Gas:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="sb_7_2">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_64">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_60">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_66">
<property name="font">
<font/>
</property>
<property name="text">
<string>Kompass-Wirkung:</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_159">
<property name="text">
<string>Carefree Seuerung</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="cb_7_7">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="label_69">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_70">
<property name="font">
<font/>
</property>
<property name="text">
<string>Unterspannung [0.1V]:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QSpinBox" name="sb_7_4">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="label_71">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_75">
<property name="text">
<string>Bei Empfangsverlust:</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QLabel" name="label_73">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_72">
<property name="font">
<font/>
</property>
<property name="text">
<string>Not-Gas Zeit [0.1s]:</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QSpinBox" name="sb_7_5">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_74">
<property name="font">
<font/>
</property>
<property name="text">
<string>Not-Gas:</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QSpinBox" name="sb_7_6">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="cb_7_3">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="8" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<widget class="QLabel" name="label_142">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#550000;&quot;&gt;Eine Zelle oder Total &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lb_7_4">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; color:#550000;&quot;&gt;(3s = 0.0V 4s = 0.0V)&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_8">
<layout class="QGridLayout" name="gridLayout_37">
<item row="0" column="0">
<widget class="QFrame" name="frame_10">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_20">
<item row="0" column="0">
<widget class="QCheckBox" name="s_8_4_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>Achs-(ent-)kopplung</string>
</property>
</widget>
</item>
<item row="1" column="0" rowspan="2">
<widget class="QFrame" name="frame_15">
<property name="enabled">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_80">
<property name="font">
<font/>
</property>
<property name="text">
<string>Gier pos. Rückkopplung:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="cb_8_1">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_79">
<property name="font">
<font/>
</property>
<property name="text">
<string>Nick/Roll Rückkopplung:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cb_8_2">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_81">
<property name="font">
<font/>
</property>
<property name="text">
<string>Gier-Korrektur:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="cb_8_3">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_11">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>156</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QTextEdit" name="te_Help_8">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;Achskopplung&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Eine Gierbewegung verkoppelt jetzt Nick und Roll. Das bedeutet, dass der MK jetzt eine Kurve fliegt, wenn man z.B. nickt und gleichzeitig giert. Es verhindert, dass dem MK nach Kurven schwindelig wird &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:1px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Gier-Feedback &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;: Der Grad der Achsenkopplung. Ist der Wert zu klein, hängt der MK bei (und nach) einer Linkskurve nach rechts &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:1px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Nick/Roll-Feedback&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;: TEXT&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:1px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Gier-Korrektion: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Damit versucht der MK, der (evtl. ungewollten) Richtungsänderung (siehe Video) entgegenzuwirken. Das funktioniert allerdings nur bei langsamen Manövern, weil Gier erheblich träger ist, als Nick oder Roll.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_9">
<layout class="QGridLayout" name="gridLayout_36">
<item row="0" column="0">
<widget class="QFrame" name="frame_11">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_31">
<item row="0" column="0" colspan="4">
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_104">
<property name="text">
<string>loop, while stick up</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_105">
<property name="text">
<string>Loop, while&lt;br&gt; stick left</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="tb_9_8">
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Arrows/Global/Images/Arrows/Left-1.png</normaloff>
<normalon>:/Arrows/Global/Images/Arrows/Left-2.png</normalon>:/Arrows/Global/Images/Arrows/Left-1.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="tb_9_6">
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Arrows/Global/Images/Arrows/Up-1.png</normaloff>
<normalon>:/Arrows/Global/Images/Arrows/Up-2.png</normalon>:/Arrows/Global/Images/Arrows/Up-1.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="tb_9_7">
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Arrows/Global/Images/Arrows/Down-1.png</normaloff>
<normalon>:/Arrows/Global/Images/Arrows/Down-2.png</normalon>:/Arrows/Global/Images/Arrows/Down-1.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QToolButton" name="tb_9_9">
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Arrows/Global/Images/Arrows/Right-1.png</normaloff>
<normalon>:/Arrows/Global/Images/Arrows/Right-2.png</normalon>:/Arrows/Global/Images/Arrows/Right-1.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="popupMode">
<enum>QToolButton::DelayedPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
<property name="arrowType">
<enum>Qt::NoArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_106">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;right&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Loop, while&lt;br /&gt;stick right&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_103">
<property name="text">
<string>Loop, while stick down</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_99">
<property name="font">
<font/>
</property>
<property name="text">
<string>Gas limit:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cb_9_1">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_98">
<property name="font">
<font/>
</property>
<property name="text">
<string>Ansprechschwelle:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="sb_9_2">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_102">
<property name="font">
<font/>
</property>
<property name="text">
<string>Hysterese:</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QSpinBox" name="sb_9_4">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_100">
<property name="font">
<font/>
</property>
<property name="text">
<string>Turn over Nick:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="sb_9_3">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QSpinBox" name="sb_9_5">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_101">
<property name="font">
<font/>
</property>
<property name="text">
<string>Turn over Roll:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<spacer name="verticalSpacer_19">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QTextEdit" name="te_Help_9">
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Pfeile:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Der Looping wird in diese entsprechende Richtung zugelassen. Dabei zeigt der Pfeil den entsprechenden Stickanschlag an &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Gas Limit:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Auf diesen Wert wird das Gas während des Loopings begrenzt &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Ansprechschwelle:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Ab diesen Stickwert wird aus der Lageregelung eine Drehratenregelung, um den Looping durchzuführen &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Hysteresis:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Stick-Hysterese für die Ansprechschwelle. In der Regel immer niedriger, als die Ansprechschwelle &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;TurnOver Nick: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;100 bedeutet 100% einer 360° Drehung. Wenn nach dem Looping der MK zu weit dreht, muss der Wert verringert werden. Dreht er nicht weit genug, muss der Wert vergrößert werden. Also entspricht 1 einem Winkel von 3,6° &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;TurnOver Roll:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; analog &lt;/span&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;TurnOver Nick&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Wichtig:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Ansprechschwelle - Hysteresis sollte etwa bei 20-40 liegen, da sonst der Kopter beim verlassen der Loopingfunktion versucht, sehr schnell die Schräglage, die man mit dem Stick vorgibt, einzunehmen. Dies kann gerade bei sehr flotten Settings dazu führen, das der Kopter bei der Drehung &amp;quot;springt&amp;quot; und einige Gerade der Winkelbewegung nicht mitbekommt, was dazu führt, das sich der Kopter sehr schräg steht. &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_10">
<layout class="QGridLayout" name="gridLayout_35">
<item row="0" column="0">
<widget class="QFrame" name="frame_12">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_14">
<item row="0" column="0">
<widget class="QLabel" name="label_83">
<property name="font">
<font/>
</property>
<property name="text">
<string>Parameter 1:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="cb_10_1">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_82">
<property name="text">
<string>[0..250]</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_85">
<property name="font">
<font/>
</property>
<property name="text">
<string>Parameter 2:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cb_10_2">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_84">
<property name="text">
<string>[0..250]</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_87">
<property name="font">
<font/>
</property>
<property name="text">
<string>Parameter 3:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="cb_10_3">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_86">
<property name="text">
<string>[0..250]</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_89">
<property name="font">
<font/>
</property>
<property name="text">
<string>Parameter 4:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="cb_10_4">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_88">
<property name="text">
<string>[0..250]</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_91">
<property name="font">
<font/>
</property>
<property name="text">
<string>Parameter 5:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="cb_10_5">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="label_90">
<property name="text">
<string>[0..250]</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_93">
<property name="font">
<font/>
</property>
<property name="text">
<string>Parameter 6:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="cb_10_6">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="label_92">
<property name="text">
<string>[0..250]</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_95">
<property name="font">
<font/>
</property>
<property name="text">
<string>Parameter 7:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="cb_10_7">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="label_94">
<property name="text">
<string>[0..250]</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_97">
<property name="font">
<font/>
</property>
<property name="text">
<string>Parameter 8:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="cb_10_8">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="label_96">
<property name="text">
<string>[0..250]</string>
</property>
</widget>
</item>
<item row="8" column="1">
<spacer name="verticalSpacer_18">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QTextEdit" name="te_Help_10">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;Frei definierbare Parameter für eigene Erweiterungen im Quellcode. &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Die Werte sind für Softwareentwickler zur freien Verfügung &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_11">
<layout class="QGridLayout" name="gridLayout_34">
<item row="1" column="2">
<widget class="QTextEdit" name="te_Help_11">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;Einstellungen für die Ausgänge J16 und J17.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Blinkmuster&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;&lt;br /&gt;Man kann ein Blinkmuster (von links nach rechts) und das Timing dafür im Koptertool einstellen. Automatisches Schalten von 10ms bis 20sek ist damit möglich&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Schaltfunktion&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;&lt;br /&gt;Wenn man als Timing einen Schalter auf der Funke belegt, kann man auch den Ausgang damit schalten. Dann nimmt der Ausgang den Pegel des obersten Bits (in der Darstellung links) an. Wenn damit etwas geschaltet werden soll (z.B. Kameraauslöser usw.), ist es besser, kein Blinkmuster einzugeben, sondern dann alle Bits entweder ein- oder auszuschalten. Ansonsten könnte das Blinkmuster während des Umschaltens einmal kurz durchlaufen.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QFrame" name="frame_13">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_12">
<item row="0" column="0">
<widget class="QLabel" name="label_116">
<property name="font">
<font/>
</property>
<property name="text">
<string>Ausgang J16</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="sb_11_1">
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="0" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="J16_0">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>128</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_1">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>64</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>32</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_3">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>16</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_4">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>8</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_5">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>4</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_6">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>2</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_7">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>1</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_107">
<property name="font">
<font/>
</property>
<property name="text">
<string>Timing:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cb_11_2">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_110">
<property name="text">
<string>[x 10ms]</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_115">
<property name="font">
<font/>
</property>
<property name="text">
<string>Ausgang J17</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="sb_11_3">
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="2" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="J17_0">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>128</string>
</property>
<property name="text">
<string>00</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_1">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>64</string>
</property>
<property name="text">
<string>00</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>32</string>
</property>
<property name="text">
<string>00</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_3">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>16</string>
</property>
<property name="text">
<string>00</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_4">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>8</string>
</property>
<property name="text">
<string>00</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_5">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>4</string>
</property>
<property name="text">
<string>00</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_6">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>2</string>
</property>
<property name="text">
<string>00</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_7">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>1</string>
</property>
<property name="text">
<string>00</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_112">
<property name="font">
<font/>
</property>
<property name="text">
<string>Timing:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="cb_11_4">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_113">
<property name="text">
<string>[x 10ms]</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="4">
<widget class="QCheckBox" name="cb_11_7">
<property name="font">
<font/>
</property>
<property name="text">
<string>Nur bei laufenden Motoren einschalten</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="4">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="label_144">
<property name="font">
<font/>
</property>
<property name="text">
<string>Unterspannungswarnung:</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font/>
</property>
<property name="text">
<string>an J16</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QSpinBox" name="sb_11_5">
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="7" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_12">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="J16_A_0">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>128</string>
</property>
<property name="text">
<string>000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_A_1">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>64</string>
</property>
<property name="text">
<string>000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_A_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>32</string>
</property>
<property name="text">
<string>000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_A_3">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>16</string>
</property>
<property name="text">
<string>000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_A_4">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>8</string>
</property>
<property name="text">
<string>000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_A_5">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>4</string>
</property>
<property name="text">
<string>000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_A_6">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>2</string>
</property>
<property name="text">
<string>000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J16_A_7">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>1</string>
</property>
<property name="text">
<string>000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_145">
<property name="font">
<font/>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="text">
<string>an J17</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QSpinBox" name="sb_11_6">
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="8" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="J17_A_0">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>128</string>
</property>
<property name="text">
<string>0000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_A_1">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>64</string>
</property>
<property name="text">
<string>0000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_A_2">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>32</string>
</property>
<property name="text">
<string>0000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_A_3">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>16</string>
</property>
<property name="text">
<string>0000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_A_4">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>8</string>
</property>
<property name="text">
<string>0000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_A_5">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>4</string>
</property>
<property name="text">
<string>0000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_A_6">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>2</string>
</property>
<property name="text">
<string>0000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="J17_A_7">
<property name="maximumSize">
<size>
<width>15</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>1</string>
</property>
<property name="text">
<string>0000</string>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Flags/Global/Images/Actions/LED_Off.png</normaloff>:/Flags/Global/Images/Actions/LED_Off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="10" column="1">
<spacer name="verticalSpacer_16">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="9" column="1" colspan="2">
<widget class="QLabel" name="label_63">
<property name="font">
<font/>
</property>
<property name="text">
<string>festes Timing 0.1s</string>
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QCheckBox" name="s_11_7_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>aktiv</string>
</property>
</widget>
</item>
<item row="8" column="3">
<widget class="QCheckBox" name="s_11_8_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>aktiv</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_2">
<layout class="QGridLayout" name="gridLayout_33">
<item row="0" column="0">
<widget class="QFrame" name="frame_14">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_15">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="s_12_1_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS aktiv</string>
</property>
</widget>
</item>
<item row="1" column="0" rowspan="2" colspan="2">
<widget class="QFrame" name="Frame_GPS1">
<property name="enabled">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_16">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_120">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS Modus Steuerung:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="cb_12_1">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_123">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS Verstärkung</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="cb_12_2">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_124">
<property name="text">
<string>[%]</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_119">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS Stick Schwelle:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QSpinBox" name="sb_12_3">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_122">
<property name="font">
<font/>
</property>
<property name="text">
<string>Min. Sat.</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QSpinBox" name="sb_12_4">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_125">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS P:</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QComboBox" name="cb_12_5">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_77">
<property name="font">
<font/>
</property>
<property name="text">
<string>Limit:</string>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QComboBox" name="cb_12_9">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_127">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS I:</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QComboBox" name="cb_12_6">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="label_126">
<property name="font">
<font/>
</property>
<property name="text">
<string>Limit:</string>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QComboBox" name="cb_12_10">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_129">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS D:</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QComboBox" name="cb_12_7">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="label_134">
<property name="font">
<font/>
</property>
<property name="text">
<string>Limit</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QComboBox" name="cb_12_11">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="label_131">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS ACC:</string>
</property>
</widget>
</item>
<item row="7" column="2" rowspan="2">
<widget class="QComboBox" name="cb_12_8">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QTextEdit" name="te_Help_12">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;Einstellungen für das Navi-Ctrl.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;GPS Modus Steuerung:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;0 = Free, 100 = Position Hold, 200 = Coming Home&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;GPS Stick Schwelle:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;0 = Position Hold by Mode Control&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite_12">
<layout class="QGridLayout" name="gridLayout_30">
<item row="0" column="0">
<widget class="QFrame" name="frame_19">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QCheckBox" name="s_13_1_cb">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS aktiv</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="Frame_GPS2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QLabel" name="label_139">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS Windkorrektur:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="cb_13_1">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_140">
<property name="text">
<string>[%]</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_141">
<property name="font">
<font/>
</property>
<property name="text">
<string>Bremswirkung:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cb_13_2">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_143">
<property name="text">
<string>[%]</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_148">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS-Maxradius:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="cb_13_3">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_149">
<property name="text">
<string>[m]</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_151">
<property name="font">
<font/>
</property>
<property name="text">
<string>GPS Winkelbegrenzung:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="cb_13_4">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Poti 1</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 2</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 3</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 4</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 5</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 6</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 7</string>
</property>
</item>
<item>
<property name="text">
<string>Poti 8</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_150">
<property name="text">
<string>[x 0.5 Grad]</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_153">
<property name="font">
<font/>
</property>
<property name="text">
<string>Position Hold Login-Zeit:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="sb_13_5">
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="label_152">
<property name="text">
<string>[s]</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QTextEdit" name="te_Help_13">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;Einstellungen für das Navi-Ctrl (Seite 2).&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt; font-weight:600; text-decoration: underline;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;GPS-Wind-Correction: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;soll den MK bei Coming-Home direkter zurückfliegen und die Drift durch Wind kompensieren&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Speed Compensation: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Greift bei AID unterstützend ein, wenn man einen neuen Punkt anfliegt Wenn zuviel Geschwindigkeit aufgebaut wird, bremst das den MK&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;GPS-Maxradius: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Soll eine virtuelle Grenze bilden, die mit GPS nicht überschritten wird.&lt;br /&gt;Wenn der MK ausserhalb des Kreises einloggen soll, nimmt er als neue Position einen Punkt auf dem Kreisrand.&lt;br /&gt;Man kann den Radius auch auf ein Poti legen. Wegpunkte und Soll-Positionen werden damit auch auf einen Kreis von max. 512m Durchmesser begrenzt.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;GPS Winkelbegrenzung: &lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Damit lässt sich die maximale Neigung der GPS-Regelung begrenzen. &lt;br /&gt;Ein Wert von 60 entspricht ca.35°&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Position Hold Login Time:&lt;/span&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt; Das ist die maximale Zeit, nach der der MK die neue Position einloggt.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite">
<widget class="QSpinBox" name="sb_0_1">
<property name="geometry">
<rect>
<x>210</x>
<y>120</y>
<width>50</width>
<height>24</height>
</rect>
</property>
</widget>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>753</width>
<height>19</height>
</rect>
</property>
<widget class="QMenu" name="menu_Program">
<property name="title">
<string>Programm</string>
</property>
<addaction name="ac_Quit"/>
<addaction name="ac_Connect"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>Hilfe</string>
</property>
<addaction name="ac_About"/>
</widget>
<widget class="QMenu" name="menuKonfiguration">
<property name="title">
<string>Konfiguration</string>
</property>
<addaction name="ac_Read"/>
<addaction name="ac_Write"/>
<addaction name="separator"/>
<addaction name="ac_Load"/>
<addaction name="ac_Save"/>
</widget>
<widget class="QMenu" name="menuA_nsicht">
<property name="title">
<string>Ansicht</string>
</property>
<addaction name="ac_Toolbar"/>
<addaction name="ac_SmallIcons"/>
</widget>
<widget class="QMenu" name="menuExtras">
<property name="title">
<string>Extras</string>
</property>
<addaction name="ac_MotorMixer"/>
<addaction name="ac_MotorTest"/>
</widget>
<addaction name="menu_Program"/>
<addaction name="menuA_nsicht"/>
<addaction name="menuKonfiguration"/>
<addaction name="menuExtras"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QToolBar" name="ToolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="allowedAreas">
<set>Qt::LeftToolBarArea</set>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<attribute name="toolBarArea">
<enum>LeftToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="ac_Connect"/>
<addaction name="separator"/>
<addaction name="ac_Read"/>
<addaction name="ac_Write"/>
<addaction name="separator"/>
<addaction name="ac_Load"/>
<addaction name="ac_Save"/>
</widget>
<action name="ac_Quit">
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Actions/Global/Images/Actions/Exit.png</normaloff>:/Actions/Global/Images/Actions/Exit.png</iconset>
</property>
<property name="text">
<string>Beenden</string>
</property>
</action>
<action name="ac_About">
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Icon/Global/Images/Icons/QMK-Settings.png</normaloff>:/Icon/Global/Images/Icons/QMK-Settings.png</iconset>
</property>
<property name="text">
<string>Über QMK-Settings</string>
</property>
</action>
<action name="ac_Connect">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Actions/Global/Images/Actions/Connection-NO.png</normaloff>
<normalon>:/Actions/Global/Images/Actions/Connection-OK.png</normalon>:/Actions/Global/Images/Actions/Connection-NO.png</iconset>
</property>
<property name="text">
<string>Verbinden</string>
</property>
</action>
<action name="ac_Read">
<property name="enabled">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Actions/Global/Images/Actions/Read.png</normaloff>:/Actions/Global/Images/Actions/Read.png</iconset>
</property>
<property name="text">
<string>Lesen</string>
</property>
<property name="toolTip">
<string>Settings aus der FC lesen</string>
</property>
</action>
<action name="ac_Write">
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Actions/Global/Images/Actions/Write.png</normaloff>:/Actions/Global/Images/Actions/Write.png</iconset>
</property>
<property name="text">
<string>Schreiben</string>
</property>
<property name="toolTip">
<string>Settings in die FC schreiben</string>
</property>
</action>
<action name="ac_Load">
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Actions/Global/Images/Actions/Load.png</normaloff>:/Actions/Global/Images/Actions/Load.png</iconset>
</property>
<property name="text">
<string>Laden</string>
</property>
</action>
<action name="ac_Save">
<property name="icon">
<iconset resource="../QMK-Settings.qrc">
<normaloff>:/Actions/Global/Images/Actions/Save.png</normaloff>:/Actions/Global/Images/Actions/Save.png</iconset>
</property>
<property name="text">
<string>Speichern</string>
</property>
</action>
<action name="ac_MotorMixer">
<property name="text">
<string>Motor-Mixer</string>
</property>
</action>
<action name="ac_Toolbar">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Toolbar anzeigen</string>
</property>
</action>
<action name="ac_SmallIcons">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>nur kleine Icons</string>
</property>
</action>
<action name="ac_MotorTest">
<property name="text">
<string>Motor-Test</string>
</property>
</action>
</widget>
<layoutdefault spacing="4" margin="11"/>
<customwidgets>
<customwidget>
<class>wgt_Connection</class>
<extends>QWidget</extends>
<header>wgt_Connection.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../QMK-Settings.qrc"/>
</resources>
<connections>
<connection>
<sender>ac_Quit</sender>
<signal>triggered()</signal>
<receiver>dlg_Main_UI</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>182</x>
<y>88</y>
</hint>
</hints>
</connection>
<connection>
<sender>listWidget</sender>
<signal>currentRowChanged(int)</signal>
<receiver>stackedWidget</receiver>
<slot>setCurrentIndex(int)</slot>
<hints>
<hint type="sourcelabel">
<x>135</x>
<y>197</y>
</hint>
<hint type="destinationlabel">
<x>479</x>
<y>197</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_4_2_rb</sender>
<signal>toggled(bool)</signal>
<receiver>s_4_4_cb</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>279</x>
<y>97</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>97</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_4_3_rb</sender>
<signal>toggled(bool)</signal>
<receiver>s_4_5_cb</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>279</x>
<y>97</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>97</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_1_1_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_4_1_cb</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>363</x>
<y>93</y>
</hint>
<hint type="destinationlabel">
<x>204</x>
<y>80</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_4_1_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_1_1_cb</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>204</x>
<y>80</y>
</hint>
<hint type="destinationlabel">
<x>363</x>
<y>93</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_12_1_cb</sender>
<signal>toggled(bool)</signal>
<receiver>Frame_GPS1</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>220</x>
<y>78</y>
</hint>
<hint type="destinationlabel">
<x>220</x>
<y>82</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_13_1_cb</sender>
<signal>toggled(bool)</signal>
<receiver>Frame_GPS2</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>220</x>
<y>78</y>
</hint>
<hint type="destinationlabel">
<x>220</x>
<y>82</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_1_4_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_12_1_cb</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>272</x>
<y>129</y>
</hint>
<hint type="destinationlabel">
<x>220</x>
<y>78</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_1_4_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_13_1_cb</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>272</x>
<y>129</y>
</hint>
<hint type="destinationlabel">
<x>220</x>
<y>78</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_12_1_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_1_4_cb</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>220</x>
<y>78</y>
</hint>
<hint type="destinationlabel">
<x>272</x>
<y>129</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_13_1_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_1_4_cb</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>220</x>
<y>78</y>
</hint>
<hint type="destinationlabel">
<x>272</x>
<y>129</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_4_1_cb</sender>
<signal>toggled(bool)</signal>
<receiver>Frame_4</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>204</x>
<y>80</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>97</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_1_4_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_1_2_cb</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>272</x>
<y>129</y>
</hint>
<hint type="destinationlabel">
<x>226</x>
<y>136</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_1_2_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_1_3_cb</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>272</x>
<y>156</y>
</hint>
<hint type="destinationlabel">
<x>346</x>
<y>183</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_1_4_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_1_2_cb</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>249</x>
<y>118</y>
</hint>
<hint type="destinationlabel">
<x>248</x>
<y>147</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_2_9_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_1_5_cb</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>279</x>
<y>97</y>
</hint>
<hint type="destinationlabel">
<x>367</x>
<y>199</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_1_5_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_2_9_cb</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>367</x>
<y>199</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>97</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_4_2_rb</sender>
<signal>toggled(bool)</signal>
<receiver>label_30</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>279</x>
<y>97</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>97</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_4_2_rb</sender>
<signal>toggled(bool)</signal>
<receiver>sb_4_6</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>279</x>
<y>97</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>97</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_4_2_rb</sender>
<signal>toggled(bool)</signal>
<receiver>label_147</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>279</x>
<y>97</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>97</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_4_2_rb</sender>
<signal>toggled(bool)</signal>
<receiver>sb_4_9</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>279</x>
<y>97</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>97</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_4_2_rb</sender>
<signal>toggled(bool)</signal>
<receiver>label_31</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>279</x>
<y>97</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>97</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_8_4_cb</sender>
<signal>toggled(bool)</signal>
<receiver>frame_15</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>279</x>
<y>97</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>97</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_8_4_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_1_6_cb</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>279</x>
<y>97</y>
</hint>
<hint type="destinationlabel">
<x>367</x>
<y>226</y>
</hint>
</hints>
</connection>
<connection>
<sender>s_1_6_cb</sender>
<signal>toggled(bool)</signal>
<receiver>s_8_4_cb</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>367</x>
<y>226</y>
</hint>
<hint type="destinationlabel">
<x>279</x>
<y>97</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Dialogs/dlg_MotorMixer.cpp
0,0 → 1,368
/***************************************************************************
* 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. *
***************************************************************************/
#include "dlg_MotorMixer.h"
 
dlg_MotorMixer::dlg_MotorMixer(QWidget *parent) : QDialog(parent)
{
setupUi(this);
connect(pb_READ, SIGNAL(clicked()), this, SLOT(slot_pb_READ()));
connect(pb_LOAD, SIGNAL(clicked()), this, SLOT(slot_pb_LOAD()));
connect(pb_SAVE, SIGNAL(clicked()), this, SLOT(slot_pb_SAVE()));
connect(pb_WRITE, SIGNAL(clicked()), this, SLOT(slot_pb_WRITE()));
 
connect(sb_NICK_1, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_NICK_2, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_NICK_3, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_NICK_4, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_NICK_5, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_NICK_6, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_NICK_7, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_NICK_8, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_NICK_9, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_NICK_10, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_NICK_11, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_NICK_12, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
 
connect(sb_ROLL_1, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_ROLL_2, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_ROLL_3, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_ROLL_4, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_ROLL_5, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_ROLL_6, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_ROLL_7, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_ROLL_8, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_ROLL_9, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_ROLL_10, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_ROLL_11, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_ROLL_12, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
 
connect(sb_GIER_1, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_GIER_2, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_GIER_3, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_GIER_4, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_GIER_5, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_GIER_6, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_GIER_7, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_GIER_8, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_GIER_9, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_GIER_10, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_GIER_11, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
connect(sb_GIER_12, SIGNAL(valueChanged(int)), this, SLOT(slot_CheckValue(int)));
 
}
 
// Connection-Object übergeben.
void dlg_MotorMixer::set_Objects(cSettings *t_Settings, s_Directorys t_Dir)
{
o_Settings = t_Settings;
s_Dir = t_Dir;
}
 
// Motordaten übernehmen.
void dlg_MotorMixer::set_MotorConfig(s_MK_Mixer t_Mixer)
{
MK_Mixer = t_Mixer;
 
set_MotorData();
}
 
// Motordaten aus GUI übernehmen
void dlg_MotorMixer::get_MotorData()
{
memcpy(MK_Mixer.Name, le_NAME->text().toLatin1().data(), 12);
 
MK_Mixer.Motor[0][0] = sb_GAS_1->value();
MK_Mixer.Motor[1][0] = sb_GAS_2->value();
MK_Mixer.Motor[2][0] = sb_GAS_3->value();
MK_Mixer.Motor[3][0] = sb_GAS_4->value();
MK_Mixer.Motor[4][0] = sb_GAS_5->value();
MK_Mixer.Motor[5][0] = sb_GAS_6->value();
MK_Mixer.Motor[6][0] = sb_GAS_7->value();
MK_Mixer.Motor[7][0] = sb_GAS_8->value();
MK_Mixer.Motor[8][0] = sb_GAS_9->value();
MK_Mixer.Motor[9][0] = sb_GAS_10->value();
MK_Mixer.Motor[10][0] = sb_GAS_11->value();
MK_Mixer.Motor[11][0] = sb_GAS_12->value();
 
MK_Mixer.Motor[0][1] = sb_NICK_1->value();
MK_Mixer.Motor[1][1] = sb_NICK_2->value();
MK_Mixer.Motor[2][1] = sb_NICK_3->value();
MK_Mixer.Motor[3][1] = sb_NICK_4->value();
MK_Mixer.Motor[4][1] = sb_NICK_5->value();
MK_Mixer.Motor[5][1] = sb_NICK_6->value();
MK_Mixer.Motor[6][1] = sb_NICK_7->value();
MK_Mixer.Motor[7][1] = sb_NICK_8->value();
MK_Mixer.Motor[8][1] = sb_NICK_9->value();
MK_Mixer.Motor[9][1] = sb_NICK_10->value();
MK_Mixer.Motor[10][1] = sb_NICK_11->value();
MK_Mixer.Motor[11][1] = sb_NICK_12->value();
 
MK_Mixer.Motor[0][2] = sb_ROLL_1->value();
MK_Mixer.Motor[1][2] = sb_ROLL_2->value();
MK_Mixer.Motor[2][2] = sb_ROLL_3->value();
MK_Mixer.Motor[3][2] = sb_ROLL_4->value();
MK_Mixer.Motor[4][2] = sb_ROLL_5->value();
MK_Mixer.Motor[5][2] = sb_ROLL_6->value();
MK_Mixer.Motor[6][2] = sb_ROLL_7->value();
MK_Mixer.Motor[7][2] = sb_ROLL_8->value();
MK_Mixer.Motor[8][2] = sb_ROLL_9->value();
MK_Mixer.Motor[9][2] = sb_ROLL_10->value();
MK_Mixer.Motor[10][2] = sb_ROLL_11->value();
MK_Mixer.Motor[11][2] = sb_ROLL_12->value();
 
MK_Mixer.Motor[0][3] = sb_GIER_1->value();
MK_Mixer.Motor[1][3] = sb_GIER_2->value();
MK_Mixer.Motor[2][3] = sb_GIER_3->value();
MK_Mixer.Motor[3][3] = sb_GIER_4->value();
MK_Mixer.Motor[4][3] = sb_GIER_5->value();
MK_Mixer.Motor[5][3] = sb_GIER_6->value();
MK_Mixer.Motor[6][3] = sb_GIER_7->value();
MK_Mixer.Motor[7][3] = sb_GIER_8->value();
MK_Mixer.Motor[8][3] = sb_GIER_9->value();
MK_Mixer.Motor[9][3] = sb_GIER_10->value();
MK_Mixer.Motor[10][3] = sb_GIER_11->value();
MK_Mixer.Motor[11][3] = sb_GIER_12->value();
}
 
// Motordaten anzeigen
void dlg_MotorMixer::set_MotorData()
{
le_NAME->setText(QString(MK_Mixer.Name));
 
sb_GAS_1->setValue(MK_Mixer.Motor[0][0]);
sb_GAS_2->setValue(MK_Mixer.Motor[1][0]);
sb_GAS_3->setValue(MK_Mixer.Motor[2][0]);
sb_GAS_4->setValue(MK_Mixer.Motor[3][0]);
sb_GAS_5->setValue(MK_Mixer.Motor[4][0]);
sb_GAS_6->setValue(MK_Mixer.Motor[5][0]);
sb_GAS_7->setValue(MK_Mixer.Motor[6][0]);
sb_GAS_8->setValue(MK_Mixer.Motor[7][0]);
sb_GAS_9->setValue(MK_Mixer.Motor[8][0]);
sb_GAS_10->setValue(MK_Mixer.Motor[9][0]);
sb_GAS_11->setValue(MK_Mixer.Motor[10][0]);
sb_GAS_12->setValue(MK_Mixer.Motor[11][0]);
 
sb_NICK_1->setValue(MK_Mixer.Motor[0][1]);
sb_NICK_2->setValue(MK_Mixer.Motor[1][1]);
sb_NICK_3->setValue(MK_Mixer.Motor[2][1]);
sb_NICK_4->setValue(MK_Mixer.Motor[3][1]);
sb_NICK_5->setValue(MK_Mixer.Motor[4][1]);
sb_NICK_6->setValue(MK_Mixer.Motor[5][1]);
sb_NICK_7->setValue(MK_Mixer.Motor[6][1]);
sb_NICK_8->setValue(MK_Mixer.Motor[7][1]);
sb_NICK_9->setValue(MK_Mixer.Motor[8][1]);
sb_NICK_10->setValue(MK_Mixer.Motor[9][1]);
sb_NICK_11->setValue(MK_Mixer.Motor[10][1]);
sb_NICK_12->setValue(MK_Mixer.Motor[11][1]);
 
sb_ROLL_1->setValue(MK_Mixer.Motor[0][2]);
sb_ROLL_2->setValue(MK_Mixer.Motor[1][2]);
sb_ROLL_3->setValue(MK_Mixer.Motor[2][2]);
sb_ROLL_4->setValue(MK_Mixer.Motor[3][2]);
sb_ROLL_5->setValue(MK_Mixer.Motor[4][2]);
sb_ROLL_6->setValue(MK_Mixer.Motor[5][2]);
sb_ROLL_7->setValue(MK_Mixer.Motor[6][2]);
sb_ROLL_8->setValue(MK_Mixer.Motor[7][2]);
sb_ROLL_9->setValue(MK_Mixer.Motor[8][2]);
sb_ROLL_10->setValue(MK_Mixer.Motor[9][2]);
sb_ROLL_11->setValue(MK_Mixer.Motor[10][2]);
sb_ROLL_12->setValue(MK_Mixer.Motor[11][2]);
 
sb_GIER_1->setValue(MK_Mixer.Motor[0][3]);
sb_GIER_2->setValue(MK_Mixer.Motor[1][3]);
sb_GIER_3->setValue(MK_Mixer.Motor[2][3]);
sb_GIER_4->setValue(MK_Mixer.Motor[3][3]);
sb_GIER_5->setValue(MK_Mixer.Motor[4][3]);
sb_GIER_6->setValue(MK_Mixer.Motor[5][3]);
sb_GIER_7->setValue(MK_Mixer.Motor[6][3]);
sb_GIER_8->setValue(MK_Mixer.Motor[7][3]);
sb_GIER_9->setValue(MK_Mixer.Motor[8][3]);
sb_GIER_10->setValue(MK_Mixer.Motor[9][3]);
sb_GIER_11->setValue(MK_Mixer.Motor[10][3]);
sb_GIER_12->setValue(MK_Mixer.Motor[11][3]);
}
 
// Prüfen auf vollstaändigkeit
void dlg_MotorMixer::slot_CheckValue(int Wert)
{
Wert = Wert;
 
int NICK = sb_NICK_1->value() + sb_NICK_2->value() + sb_NICK_3->value() + sb_NICK_4->value() + sb_NICK_5->value() + sb_NICK_6->value() +
sb_NICK_7->value() + sb_NICK_8->value() + sb_NICK_9->value() + sb_NICK_10->value() + sb_NICK_11->value() + sb_NICK_12->value();
 
int ROLL = sb_ROLL_1->value() + sb_ROLL_2->value() + sb_ROLL_3->value() + sb_ROLL_4->value() + sb_ROLL_5->value() + sb_ROLL_6->value() +
sb_ROLL_7->value() + sb_ROLL_8->value() + sb_ROLL_9->value() + sb_ROLL_10->value() + sb_ROLL_11->value() + sb_ROLL_12->value();
 
int GIER = sb_GIER_1->value() + sb_GIER_2->value() + sb_GIER_3->value() + sb_GIER_4->value() + sb_GIER_5->value() + sb_GIER_6->value() +
sb_GIER_7->value() + sb_GIER_8->value() + sb_GIER_9->value() + sb_GIER_10->value() + sb_GIER_11->value() + sb_GIER_12->value();
 
if (NICK == 0)
{
lb_NICK->setEnabled(true);
}
else
{
lb_NICK->setEnabled(false);
}
 
if (ROLL == 0)
{
lb_ROLL->setEnabled(true);
}
else
{
lb_ROLL->setEnabled(false);
}
 
if (GIER == 0)
{
lb_GIER->setEnabled(true);
}
else
{
lb_GIER->setEnabled(false);
}
}
 
// Mixer von der FC Lesen.
void dlg_MotorMixer::read_Mixer()
{
c_Data[0] = 0;
// o_Input->send_Data(HandlerMK::make_Frame('n', ADDRESS_FC, c_Data, 0).toLatin1().data(), DATA_READ_MIXER);
emit sig_SendData(HandlerMK::make_Frame('n', ADDRESS_FC, c_Data, 0).toLatin1().data(), DATA_READ_MIXER);
}
 
// Button-Slots
void dlg_MotorMixer::slot_pb_READ()
{
read_Mixer();
}
 
void dlg_MotorMixer::slot_pb_WRITE()
{
get_MotorData();
 
memcpy((unsigned char *)&c_Data, (unsigned char *)&MK_Mixer, sizeof(MK_Mixer));
 
// o_Input->send_Data(HandlerMK::make_Frame('m', ADDRESS_FC, c_Data, sizeof(MK_Mixer)).toLatin1().data(), DATA_WRITE_MIXER);
emit sig_SendData(HandlerMK::make_Frame('m', ADDRESS_FC, c_Data, sizeof(MK_Mixer)).toLatin1().data(), DATA_WRITE_MIXER);
}
 
void dlg_MotorMixer::slot_pb_LOAD()
{
QString Dir = QDir::homePath();
 
QString Filename = QFileDialog::getOpenFileName(this, tr("Mikrokopter MotorMixer laden"), s_Dir.Settings + "", tr("MK MotorMixer(*.mkm);;Alle Dateien (*)"));
 
if (!Filename.isEmpty())
{
QSettings Setting(Filename, QSettings::IniFormat);
 
Setting.beginGroup("Info");
memcpy(MK_Mixer.Name, Setting.value("Name", QString("--noname--")).toString().toLatin1().data(), 12);
MK_Mixer.Revision = Setting.value("Version", 0).toInt();
Setting.endGroup();
 
Setting.beginGroup("Gas");
for (int z = 0; z < MK_MAX_MOTOR; z++)
{
MK_Mixer.Motor[z][0] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt();
}
Setting.endGroup();
 
Setting.beginGroup("Nick");
for (int z = 0; z < MK_MAX_MOTOR; z++)
{
MK_Mixer.Motor[z][1] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt();
}
Setting.endGroup();
 
Setting.beginGroup("Roll");
for (int z = 0; z < MK_MAX_MOTOR; z++)
{
MK_Mixer.Motor[z][2] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt();
}
Setting.endGroup();
 
Setting.beginGroup("Yaw");
for (int z = 0; z < MK_MAX_MOTOR; z++)
{
MK_Mixer.Motor[z][3] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt();
}
Setting.endGroup();
 
if (MK_Mixer.Revision == MK_VERSION_MIXER)
{
set_MotorData();
}
}
}
 
void dlg_MotorMixer::slot_pb_SAVE()
{
QString Dir = QDir::homePath();
 
QString Filename = QFileDialog::getSaveFileName(this, tr("Mikrokopter MotorMixer speichern"), s_Dir.Settings + "/" + le_NAME->text(), tr("MK MotorMixer(*.mkm);;Alle Dateien (*)"));
 
if (!Filename.isEmpty())
{
if (!(Filename.endsWith(".mkm", Qt::CaseInsensitive)))
{
Filename = Filename + QString(".mkm");
}
 
get_MotorData();
 
QSettings Setting(Filename, QSettings::IniFormat);
 
Setting.beginGroup("Info");
Setting.setValue("Name", QString(MK_Mixer.Name));
Setting.setValue("Version", MK_VERSION_MIXER);
Setting.endGroup();
 
Setting.beginGroup("Gas");
for (int z = 0; z < MK_MAX_MOTOR; z++)
{
Setting.setValue(QString("Motor%1").arg(z+1), MK_Mixer.Motor[z][0]);
}
Setting.endGroup();
 
Setting.beginGroup("Nick");
for (int z = 0; z < MK_MAX_MOTOR; z++)
{
Setting.setValue(QString("Motor%1").arg(z+1), MK_Mixer.Motor[z][1]);
}
Setting.endGroup();
 
Setting.beginGroup("Roll");
for (int z = 0; z < MK_MAX_MOTOR; z++)
{
Setting.setValue(QString("Motor%1").arg(z+1), MK_Mixer.Motor[z][2]);
}
Setting.endGroup();
 
Setting.beginGroup("Yaw");
for (int z = 0; z < MK_MAX_MOTOR; z++)
{
Setting.setValue(QString("Motor%1").arg(z+1), MK_Mixer.Motor[z][3]);
}
Setting.endGroup();
}
}
 
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Dialogs/dlg_MotorMixer.h
0,0 → 1,68
/***************************************************************************
* 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_MOTORMIXER_H
#define DLG_MOTORMIXER_H
 
#include <QObject>
#include <QFileDialog>
#include <QSettings>
 
#include "ui_dlg_MotorMixer.h"
 
#include "../Classes/cSettings.h"
 
#include "../../Global/Kopter.h"
#include "../../Global/Global.h"
#include "../../Global/MK_Datatypes.h"
#include "../../Global/Class_HandlerMK/HandlerMK.h"
 
class dlg_MotorMixer : public QDialog, public Ui::dlg_MotorMixer_UI
{
Q_OBJECT
 
public:
dlg_MotorMixer(QWidget *parent = 0);
void set_Objects(cSettings *t_Settings, s_Directorys t_Dir);
void set_MotorConfig(s_MK_Mixer t_Mixer);
void read_Mixer();
private:
cSettings *o_Settings;
 
s_MK_Mixer MK_Mixer;
 
s_Directorys s_Dir;
 
char c_Data[150];
 
void set_MotorData();
void get_MotorData();
 
private slots:
void slot_pb_READ();
void slot_pb_WRITE();
void slot_pb_LOAD();
void slot_pb_SAVE();
void slot_CheckValue(int Wert);
 
signals:
void sig_SendData(QString ,int);
 
};
 
#endif // DLG_MOTORMIXER_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Dialogs/dlg_MotorMixer.ui
0,0 → 1,1733
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_MotorMixer_UI</class>
<widget class="QDialog" name="dlg_MotorMixer_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>470</width>
<height>414</height>
</rect>
</property>
<property name="windowTitle">
<string>MotorMixer-Einstellungen</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>2</number>
</property>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 1:</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_1">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="2" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_1">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QSpinBox" name="sb_ROLL_1">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QSpinBox" name="sb_GIER_1">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 2:</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_2">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="3" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_2">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="3" column="5">
<widget class="QSpinBox" name="sb_ROLL_2">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="3" column="6">
<widget class="QSpinBox" name="sb_GIER_2">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 3:</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_3">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="4" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_3">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="4" column="5">
<widget class="QSpinBox" name="sb_ROLL_3">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="4" column="6">
<widget class="QSpinBox" name="sb_GIER_3">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 4:</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_4">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="5" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_4">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="5" column="5">
<widget class="QSpinBox" name="sb_ROLL_4">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="5" column="6">
<widget class="QSpinBox" name="sb_GIER_4">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 5:</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_5">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="6" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_5">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="6" column="5">
<widget class="QSpinBox" name="sb_ROLL_5">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="6" column="6">
<widget class="QSpinBox" name="sb_GIER_5">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 6:</string>
</property>
</widget>
</item>
<item row="7" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_6">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="7" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_6">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="7" column="5">
<widget class="QSpinBox" name="sb_ROLL_6">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="7" column="6">
<widget class="QSpinBox" name="sb_GIER_6">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 7:</string>
</property>
</widget>
</item>
<item row="8" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_7">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="8" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_7">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="8" column="5">
<widget class="QSpinBox" name="sb_ROLL_7">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="8" column="6">
<widget class="QSpinBox" name="sb_GIER_7">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_8">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 8:</string>
</property>
</widget>
</item>
<item row="9" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_8">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="9" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_8">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="9" column="5">
<widget class="QSpinBox" name="sb_ROLL_8">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="9" column="6">
<widget class="QSpinBox" name="sb_GIER_8">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_9">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 9:</string>
</property>
</widget>
</item>
<item row="10" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_9">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="10" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_9">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="10" column="5">
<widget class="QSpinBox" name="sb_ROLL_9">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="10" column="6">
<widget class="QSpinBox" name="sb_GIER_9">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_10">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 10:</string>
</property>
</widget>
</item>
<item row="11" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_10">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="11" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_10">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="11" column="5">
<widget class="QSpinBox" name="sb_ROLL_10">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="11" column="6">
<widget class="QSpinBox" name="sb_GIER_10">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_11">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 11:</string>
</property>
</widget>
</item>
<item row="12" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_11">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="12" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_11">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="12" column="5">
<widget class="QSpinBox" name="sb_ROLL_11">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="12" column="6">
<widget class="QSpinBox" name="sb_GIER_11">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="label_12">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Motor 12:</string>
</property>
</widget>
</item>
<item row="13" column="1" colspan="2">
<widget class="QSpinBox" name="sb_GAS_12">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="13" column="3" colspan="2">
<widget class="QSpinBox" name="sb_NICK_12">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="13" column="5">
<widget class="QSpinBox" name="sb_ROLL_12">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="13" column="6">
<widget class="QSpinBox" name="sb_GIER_12">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QLabel" name="lb_ROLL">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>62</red>
<green>207</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>62</red>
<green>207</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>ROLL</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLabel" name="label_13">
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>GAS</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QLabel" name="lb_GIER">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>62</red>
<green>207</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>62</red>
<green>207</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>GIER</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="3" colspan="2">
<widget class="QLabel" name="lb_NICK">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>62</red>
<green>207</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>62</red>
<green>207</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>19</green>
<blue>18</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>179</red>
<green>14</green>
<blue>17</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Courier 10 Pitch</family>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>NICK</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<widget class="QLineEdit" name="le_NAME"/>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pb_READ">
<property name="text">
<string>Lesen</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="pb_WRITE">
<property name="text">
<string>Schreiben</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QPushButton" name="pb_LOAD">
<property name="text">
<string>Laden</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QPushButton" name="pb_SAVE">
<property name="text">
<string>Speichern</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item row="7" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0">
<widget class="QPushButton" name="pb_Close">
<property name="text">
<string>Schließen</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../MKTool.qrc"/>
</resources>
<connections>
<connection>
<sender>pb_Close</sender>
<signal>clicked()</signal>
<receiver>dlg_MotorMixer_UI</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>414</x>
<y>390</y>
</hint>
<hint type="destinationlabel">
<x>234</x>
<y>206</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Dialogs/dlg_MotorTest.cpp
0,0 → 1,86
/***************************************************************************
* 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. *
***************************************************************************/
#include "dlg_MotorTest.h"
 
dlg_MotorTest::dlg_MotorTest(QWidget *parent) : QDialog(parent)
{
setupUi(this);
 
Timer = new QTimer();
Timer->setInterval(250);
 
connect(sl_Speed, SIGNAL(valueChanged(int)), this, SLOT(slot_MotorTest(int)));
connect(Timer, SIGNAL(timeout()), this, SLOT(slot_Timer()));
}
 
void dlg_MotorTest::slot_MotorTest(int Wert)
{
if ((Wert > 0) && !(Timer->isActive()))
{
Timer->start();
}
 
for (int z = 0; z < 16; z++)
{
Motor[z] = 0;
}
 
if (cb_1->isChecked())
Motor[0] = Wert;
if (cb_2->isChecked())
Motor[1] = Wert;
if (cb_3->isChecked())
Motor[2] = Wert;
if (cb_4->isChecked())
Motor[3] = Wert;
if (cb_5->isChecked())
Motor[4] = Wert;
if (cb_6->isChecked())
Motor[5] = Wert;
if (cb_7->isChecked())
Motor[6] = Wert;
if (cb_8->isChecked())
Motor[7] = Wert;
if (cb_9->isChecked())
Motor[8] = Wert;
if (cb_10->isChecked())
Motor[9] = Wert;
if (cb_11->isChecked())
Motor[10] = Wert;
if (cb_12->isChecked())
Motor[11] = Wert;
}
 
void dlg_MotorTest::slot_Timer()
{
memcpy((unsigned char *)&c_Data, (unsigned char *)&Motor, sizeof(Motor));
 
emit sig_SendData(HandlerMK::make_Frame('t', ADDRESS_FC, c_Data, sizeof(Motor)).toLatin1().data(), 0);
}
 
void dlg_MotorTest::Stop()
{
Timer->stop();
}
 
dlg_MotorTest::~dlg_MotorTest()
{
}
 
 
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Dialogs/dlg_MotorTest.h
0,0 → 1,57
/***************************************************************************
* 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 DLG_MOTORTEST_H
#define DLG_MOTORTEST_H
 
#include <QObject>
#include <QTimer>
 
#include "ui_dlg_MotorTest.h"
 
#include "../../Global/Kopter.h"
#include "../../Global/Global.h"
#include "../../Global/MK_Datatypes.h"
#include "../../Global/Class_HandlerMK/HandlerMK.h"
 
 
class dlg_MotorTest : public QDialog, public Ui::dlg_MotorTest_UI
{
Q_OBJECT
 
public:
dlg_MotorTest(QWidget *parent = 0);
 
void Stop();
 
~dlg_MotorTest();
 
private:
QTimer *Timer;
unsigned char Motor[16];
char c_Data[150];
 
private slots:
void slot_MotorTest(int Wert);
void slot_Timer();
 
signals:
void sig_SendData(QString ,int);
};
 
#endif
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/Dialogs/dlg_MotorTest.ui
0,0 → 1,350
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>dlg_MotorTest_UI</class>
<widget class="QDialog" name="dlg_MotorTest_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>194</width>
<height>208</height>
</rect>
</property>
<property name="windowTitle">
<string>Motor-Test</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Motoren</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="cb_1">
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="cb_2">
<property name="text">
<string>2</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="cb_3">
<property name="text">
<string>3</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QCheckBox" name="cb_4">
<property name="text">
<string>4</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cb_5">
<property name="text">
<string>5</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="cb_6">
<property name="text">
<string>6</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="cb_7">
<property name="text">
<string>7</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="cb_8">
<property name="text">
<string>8</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="cb_9">
<property name="text">
<string>9</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="cb_10">
<property name="text">
<string>10</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QCheckBox" name="cb_11">
<property name="text">
<string>11</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QCheckBox" name="cb_12">
<property name="text">
<string>12</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="4">
<widget class="QCheckBox" name="cb_ALL">
<property name="text">
<string>Alle auswählen</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QSlider" name="sl_Speed">
<property name="maximum">
<number>255</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="pb_OK">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>pb_OK</sender>
<signal>clicked()</signal>
<receiver>dlg_MotorTest_UI</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>63</x>
<y>174</y>
</hint>
<hint type="destinationlabel">
<x>29</x>
<y>177</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_1</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>29</x>
<y>47</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_2</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>71</x>
<y>47</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_3</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>115</x>
<y>47</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_4</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>160</x>
<y>47</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_5</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>29</x>
<y>74</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_6</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>71</x>
<y>74</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_7</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>115</x>
<y>74</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_8</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>160</x>
<y>74</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_9</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>29</x>
<y>101</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_10</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>71</x>
<y>101</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_11</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>115</x>
<y>101</y>
</hint>
</hints>
</connection>
<connection>
<sender>cb_ALL</sender>
<signal>toggled(bool)</signal>
<receiver>cb_12</receiver>
<slot>setChecked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>96</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>160</x>
<y>101</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/QMK-Settings.pro
0,0 → 1,35
# -------------------------------------------------
# Project created by QtCreator 2009-07-20T20:04:00
# -------------------------------------------------
 
include(../Global/Widget_Connection.pri)
 
QT += network
TARGET = QMK-Settings
TEMPLATE = app
DESTDIR = ../Binary
 
debug {
DEFINES += _BETA_
}
 
OBJECTS_DIR = ../Binary/.build/QMK-Settings
UI_DIR = ../Binary/.build/QMK-Settings
MOC_DIR = ../Binary/.build/QMK-Settings
RCC_DIR = ../Binary/.build/QMK-Settings
RESOURCES += QMK-Settings.qrc
SOURCES += main.cpp \
Dialogs/dlg_Main.cpp \
Dialogs/dlg_MotorMixer.cpp \
Dialogs/dlg_MotorTest.cpp \
Classes/cSettings.cpp
HEADERS += Defines.h \
../Global/Global.h \
Dialogs/dlg_Main.h \
Dialogs/dlg_MotorMixer.h \
Dialogs/dlg_MotorTest.h \
Classes/cSettings.h \
TypeDefs.h
FORMS += Dialogs/dlg_Main.ui \
Dialogs/dlg_MotorMixer.ui \
Dialogs/dlg_MotorTest.ui
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/QMK-Settings.qrc
0,0 → 1,30
<RCC>
<qresource prefix="Icon" >
<file>../Global/Images/Icons/QMK-Settings.png</file>
</qresource>
<qresource prefix="Flags" >
<file>../Global/Images/Actions/LED_Green.png</file>
<file>../Global/Images/Actions/LED_Yellow.png</file>
<file>../Global/Images/Actions/LED_Off.png</file>
<file>../Global/Images/Actions/LED_Red.png</file>
</qresource>
<qresource prefix="Arrows" >
<file>../Global/Images/Arrows/Down-1.png</file>
<file>../Global/Images/Arrows/Down-2.png</file>
<file>../Global/Images/Arrows/Left-1.png</file>
<file>../Global/Images/Arrows/Left-2.png</file>
<file>../Global/Images/Arrows/Right-1.png</file>
<file>../Global/Images/Arrows/Right-2.png</file>
<file>../Global/Images/Arrows/Up-1.png</file>
<file>../Global/Images/Arrows/Up-2.png</file>
</qresource>
<qresource prefix="Actions" >
<file>../Global/Images/Actions/Save.png</file>
<file>../Global/Images/Actions/Load.png</file>
<file>../Global/Images/Actions/Read.png</file>
<file>../Global/Images/Actions/Write.png</file>
<file>../Global/Images/Actions/Exit.png</file>
<file>../Global/Images/Actions/Connection-NO.png</file>
<file>../Global/Images/Actions/Connection-OK.png</file>
</qresource>
</RCC>
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/TypeDefs.h
0,0 → 1,24
/***************************************************************************
* 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 TYPEDEFS_H
#define TYPEDEFS_H
 
#include <QString>
 
#endif // TYPEDEFS_H
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/QMK-Settings/main.cpp
0,0 → 1,36
/***************************************************************************
* 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. *
***************************************************************************/
 
#include <QtGui/QApplication>
#include "Dialogs/dlg_Main.h"
 
int main(int argc, char *argv[])
{
QApplication App(argc, argv);
 
dlg_Main *MainApp = new dlg_Main();
 
MainApp->show();
 
int iReturn = App.exec();
 
delete MainApp;
 
return iReturn;
}
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/build-debian.sh
0,0 → 1,44
#!/bin/sh
 
QMAKE="qmake"
MAKEOPT=""
 
case "$1" in
"beta")
CONFIG=""
;;
*)
CONFIG="CONFIG-=debug"
;;
esac
 
# QMK-Communicator erstellen
######################
cd ./QMK-Communicator
${QMAKE} QMK-Communicator.pro ${CONFIG}
make ${MAKEOPT}
cd ..
cd ./QMK-Settings
${QMAKE} QMK-Settings.pro ${CONFIG}
make ${MAKEOPT}
cd ..
cd ./QMK-Maps
${QMAKE} QMK-Maps.pro ${CONFIG}
make ${MAKEOPT}
cd ..
cd ./QMK-Scope
${QMAKE} QMK-Scope.pro CONFIG+=Debian ${CONFIG}
make ${MAKEOPT}
cd ..
#cd ./QMK-Voice
#qmake QMK-Voice.pro ${CONFIG}
#make ${MAKEOPT}
#cd ..
#cd ./QMK-Logger
#qmake QMK-Logger.pro ${CONFIG}
#make ${MAKEOPT}
#cd ..
#cd ./QMK-Control
#${QMAKE} QMK-Control.pro CONFIG+=Debian ${CONFIG}
#make ${MAKEOPT}
#cd ..
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/build-gentoo.sh
0,0 → 1,44
#!/bin/sh
 
QMAKE="qmake"
MAKEOPT=""
 
case "$1" in
"beta")
CONFIG=""
;;
*)
CONFIG="CONFIG-=debug"
;;
esac
 
# QMK-Communicator erstellen
######################
cd ./QMK-Communicator
${QMAKE} QMK-Communicator.pro ${CONFIG}
make ${MAKEOPT}
cd ..
cd ./QMK-Settings
${QMAKE} QMK-Settings.pro ${CONFIG}
make ${MAKEOPT}
cd ..
cd ./QMK-Maps
${QMAKE} QMK-Maps.pro ${CONFIG}
make ${MAKEOPT}
cd ..
cd ./QMK-Scope
${QMAKE} QMK-Scope.pro CONFIG+=Gentoo ${CONFIG}
make ${MAKEOPT}
cd ..
#cd ./QMK-Voice
#qmake QMK-Voice.pro ${CONFIG}
#make ${MAKEOPT}
#cd ..
#cd ./QMK-Logger
#qmake QMK-Logger.pro ${CONFIG}
#make ${MAKEOPT}
#cd ..
#cd ./QMK-Control
#${QMAKE} QMK-Control.pro CONFIG+=Gentoo ${CONFIG}
#make ${MAKEOPT}
#cd ..
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/build-opensuse.sh
0,0 → 1,45
#!/bin/sh
 
QMAKE="qmake"
#MAKEOPT=""
MAKEOPT="-j4"
 
case "$1" in
"beta")
CONFIG=""
;;
*)
CONFIG="CONFIG-=debug"
;;
esac
 
# QMK-Communicator erstellen
######################
cd ./QMK-Communicator
${QMAKE} QMK-Communicator.pro ${CONFIG}
make ${MAKEOPT}
cd ..
cd ./QMK-Settings
${QMAKE} QMK-Settings.pro ${CONFIG}
make ${MAKEOPT}
cd ..
cd ./QMK-Maps
${QMAKE} QMK-Maps.pro ${CONFIG}
make ${MAKEOPT}
cd ..
cd ./QMK-Scope
${QMAKE} QMK-Scope.pro CONFIG+=Suse ${CONFIG}
make ${MAKEOPT}
cd ..
#cd ./QMK-Voice
#${QMAKE} QMK-Voice.pro ${CONFIG}
#make ${MAKEOPT}
#cd ..
#cd ./QMK-Logger
#${QMAKE} QMK-Logger.pro ${CONFIG}
#make ${MAKEOPT}
#cd ..
#cd ./QMK-Control
#${QMAKE} QMK-Control.pro CONFIG+=Suse ${CONFIG}
#make ${MAKEOPT}
#cd ..
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en/build-osx.sh
0,0 → 1,72
#!/bin/sh
 
QMAKE="qmake-mac"
MAKEOPT=""
 
case "$1" in
"beta")
CONFIG=""
;;
*)
CONFIG="CONFIG-=debug"
;;
esac
 
# QMK-Communicator erstellen
######################
cd ./QMK-Communicator
${QMAKE} QMK-Communicator.pro ${CONFIG}
make clean
make ${MAKEOPT}
cd ..
 
cd ./QMK-Settings
${QMAKE} QMK-Settings.pro ${CONFIG}
make clean
make ${MAKEOPT}
cd ..
cd Binary
macdeployqt QMK-Settings.app
cp QMK-Settings.app/Contents/MacOS/* QMK-Communicator.app/Contents/MacOS/.
cd ..
 
cd ./QMK-Maps
${QMAKE} QMK-Maps.pro ${CONFIG}
make clean
make ${MAKEOPT}
cd ..
cd Binary
macdeployqt QMK-Maps.app
cp QMK-Maps.app/Contents/MacOS/* QMK-Communicator.app/Contents/MacOS/.
cd ..
 
#cd ./QMK-Scope
#${QMAKE} QMK-Scope.pro CONFIG+=OSX CONFIG-=debug
#make clean
#make ${MAKEOPT}
#cd ..
#cd Binary
#macdeployqt QMK-Scope.app
#cp QMK-Scope.app/Contents/MacOS/* QMK-Communicator.app/Contents/MacOS/.
#cd ..
 
#cd ./QMK-Voice
#${QMAKE} QMK-Voice.pro ${CONFIG}
#make clean
#make ${MAKEOPT}
#cd ..
 
#cd ./QMK-Logger
#${QMAKE} QMK-Logger.pro ${CONFIG}
#make clean
#make ${MAKEOPT}
#cd ..
 
#cd ./QMK-Control
#${QMAKE} QMK-Control.pro CONFIG+=OSX ${CONFIG}
#make clean
#make ${MAKEOPT}
#cd ..
 
cd Binary
macdeployqt QMK-Communicator.app -dmg
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/QMK-Groundstation/tags/QMK-Tools v1.3.0-voodoo-en
Property changes:
Added: svn:ignore
+Doxyfile
+build
+groundstation.kdevses
+QMKGroundStation.kdevelop.pcs
+Makefile