/QMK-Groundstation/branches/own_com_lib/Classes/ToolBox.cpp |
---|
36,6 → 36,7 |
#endif |
} |
/* |
QString ToolBox::get_Float(long Wert, int Count) |
{ |
QString Temp, s_Wert; |
45,7 → 46,7 |
Temp = s_Wert.left(s_Wert.length() - Count) + QString(".") + s_Wert.right(Count); |
return Temp; |
} |
}*/ |
// Datensatz nach QString |
QString ToolBox::dataToQString(int Data[150], int Start, int End) |
/QMK-Groundstation/branches/own_com_lib/Classes/ToolBox.h |
---|
29,7 → 29,7 |
public : |
static QString dataToQString(int Data[150], int Start = 0, int End = 150); |
static QIcon Icon(int ID); |
static QString get_Float(long Wert, int Count); |
//static QString get_Float(long Wert, int Count); |
static void wait(int Time); |
}; |
/QMK-Groundstation/branches/own_com_lib/Forms/mktool.cpp |
---|
399,15 → 399,17 |
void MKTool::parse_TargetKML() |
{ |
QString Tmp = te_KML->toPlainText().simplified(); |
QStringList List; |
QStringList list; |
if ((Tmp.contains("<kml xmlns=\"http://earth.google.com/kml/2.2\">")) && (Tmp.contains("<coordinates>"))) |
{ |
List = Tmp.split("<coordinates>"); |
List = List[1].split(","); |
list = Tmp.split("<coordinates>"); |
list = list[1].split(","); |
le_TarLong->setText(ToolBox::get_Float((List[0].toDouble() * 10000000), 7)); |
le_TarLat->setText(ToolBox::get_Float((List[1].toDouble() * 10000000), 7)); |
le_TarLong->setText( QString::number( list[0].toDouble() ) ); |
le_TarLat->setText( QString::number( list[1].toDouble() ) ); |
//le_TarLong->setText(ToolBox::get_Float((List[0].toDouble() * 10000000), 7)); |
//le_TarLat->setText(ToolBox::get_Float((List[1].toDouble() * 10000000), 7)); |
} |
} |
470,10 → 472,10 |
msg += tr("Bitte die Eingabe ueberpruefen!\n"); |
msg += tr("Die Werte muessen sich in der Naehe der aktuellen Koordinaten befinden\n"); |
msg += "(Lon: "; |
msg += ToolBox::get_Float(Navi.Current.Longitude,7); |
msg += QString::number(Navi.Current.Longitude); |
msg += ", "; |
msg += "Lat: "; |
msg += ToolBox::get_Float(Navi.Current.Latitude,7); |
msg += QString::number(Navi.Current.Latitude); |
msg += ")"; |
msgB.setText(msg); |
msgB.exec(); |
/QMK-Groundstation/branches/own_com_lib/com/Communication.h |
---|
11,9 → 11,9 |
class Communication{ |
public: |
//connect to MK |
virtual void connectMK(string) {}; |
virtual void connect_MK(string) {}; |
//send command to MK |
virtual bool sendCmd(char, int, char[150],unsigned int, bool) { return false; }; |
virtual void stopReSend() {}; |
virtual bool send_cmd(char, int, char[150],unsigned int, bool) { return false; }; |
virtual void stop_resend() {}; |
}; |
#endif |
/QMK-Groundstation/branches/own_com_lib/com/Handler.cpp |
---|
13,7 → 13,7 |
void Handler::read_mixer() { |
char tx_data[1] = {0}; |
//com->log("read motor mixer"); |
com->sendCmd('n', ADDRESS_FC, tx_data, 1, true); |
com->send_cmd('n', ADDRESS_FC, tx_data, 1, true); |
} |
void Handler::get_motor_config() { |
31,7 → 31,7 |
case 'N' : |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
if (RX.decode[0] == VERSION_MIXER) |
{ |
43,7 → 43,7 |
case 'M' : |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
if (RX.decode[0] == 1) |
{ |
70,7 → 70,7 |
case 'Q' : // DONE 0.71g |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
if (RX.decode[1] == VERSION_SETTINGS) |
{ |
101,7 → 101,7 |
break; |
// Settings written |
case 'S' : // DONE 0.71g |
com->stopReSend(); |
com->stop_resend(); |
//TODO: QMessagebox("settings written successful") ? |
break; |
} |
126,7 → 126,7 |
case 'L' : // DONE 0.71g |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
/*int LCD[150]; |
memcpy(LCD,RX.decode, sizeof(RX.decode)); |
142,7 → 142,7 |
case 'A' : // DONE 0.71g |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
int Position = RX.decode[0]; |
if (Position != 31) |
185,7 → 185,7 |
case 'V' : // DONE 0.71h |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
/* |
Mode.ID = HardwareID; |
Mode.VERSION_MAJOR = RX.decode[0]; |
/QMK-Groundstation/branches/own_com_lib/com/QTCommunication.cpp |
---|
1,13 → 1,19 |
#include <QTCommunication.h> |
void QTCommunication::connectMK(string addr) { |
/** |
* connect to Mikrokopter |
*/ |
void QTCommunication::connect_MK(string addr) { |
}; |
bool QTCommunication::sendCmd(char cmd, int address, char data[150], unsigned int length, bool resend) { |
/** |
* send command to Mikrokopter |
*/ |
bool QTCommunication::send_cmd(char cmd, int address, char data[150], unsigned int length, bool resend) { |
return true; |
}; |
void QTCommunication::stopReSend() { |
void QTCommunication::stop_resend() { |
}; |
/QMK-Groundstation/branches/own_com_lib/com/QTCommunication.h |
---|
14,8 → 14,8 |
class QTCommunication : public Communication { |
public: |
void connectMK(string addr); |
bool sendCmd(char cmd, int address, char data[150], unsigned int length, bool resend); |
void stopReSend(); |
void connect_MK(string addr); |
bool send_cmd(char cmd, int address, char data[150], unsigned int length, bool resend); |
void stop_resend(); |
}; |
#endif |