# HG changeset patch # User Paul LEROY # Date 2013-07-02 14:03:50 # Node ID 66e3fbb189eb775df3a7fe3997f2b66efabb99a2 # Parent 237de88e9fa6fa5b434d044f7b7d4a91721bb3e5 QSettings used in the lfrsgse to store the IP address of the echo bridge diff --git a/PAULs_LPPMON_PLUGINS.pro.user b/PAULs_LPPMON_PLUGINS.pro.user --- a/PAULs_LPPMON_PLUGINS.pro.user +++ b/PAULs_LPPMON_PLUGINS.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/common_PLE/qipdialogbox.cpp b/common_PLE/qipdialogbox.cpp --- a/common_PLE/qipdialogbox.cpp +++ b/common_PLE/qipdialogbox.cpp @@ -77,3 +77,23 @@ void QIPDialogBox::setIP(unsigned char a addressPart3->repaint(); addressPart4->repaint(); } + +unsigned char QIPDialogBox::getAddressPart1() +{ + return (unsigned char) addressPart1->value(); +} + +unsigned char QIPDialogBox::getAddressPart2() +{ + return (unsigned char) addressPart2->value(); +} + +unsigned char QIPDialogBox::getAddressPart3() +{ + return (unsigned char) addressPart3->value(); +} + +unsigned char QIPDialogBox::getAddressPart4() +{ + return (unsigned char) addressPart4->value(); +} diff --git a/common_PLE/qipdialogbox.h b/common_PLE/qipdialogbox.h --- a/common_PLE/qipdialogbox.h +++ b/common_PLE/qipdialogbox.h @@ -18,6 +18,10 @@ signals: public slots: void valueChanged(); QString getIP(); + unsigned char getAddressPart1(); + unsigned char getAddressPart2(); + unsigned char getAddressPart3(); + unsigned char getAddressPart4(); private: QSpinBox *addressPart1; diff --git a/gse_lesia/gselesia.pro b/gse_lesia/gselesia.pro --- a/gse_lesia/gselesia.pro +++ b/gse_lesia/gselesia.pro @@ -8,7 +8,7 @@ QT += core gui QT += network QT += xml -TARGET = gselesia +TARGET = lfrsgse TEMPLATE = app INCLUDEPATH += \ diff --git a/gse_lesia/gselesia.pro.user b/gse_lesia/gselesia.pro.user --- a/gse_lesia/gselesia.pro.user +++ b/gse_lesia/gselesia.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/gse_lesia/mainwindow.cpp b/gse_lesia/mainwindow.cpp --- a/gse_lesia/mainwindow.cpp +++ b/gse_lesia/mainwindow.cpp @@ -28,6 +28,8 @@ MainWindow::MainWindow(QWidget *parent) lfrXmlParser = new LFRXmlParser(); UI = new MainWindowUI(); + readSettings(); + this->UI->serverTMEchoDialogBox->setIP(echoBridgeIP0, echoBridgeIP1, echoBridgeIP2, echoBridgeIP3); lfrXmlParser->generalCCSDSPacketStore = &this->generalCCSDSPacketStore; @@ -470,3 +472,26 @@ void MainWindow::processPacketStore() delete(packet); } } + +void MainWindow::readSettings() +{ + QSettings settings("lpp", "lfrsge"); + echoBridgeIP0 = (unsigned char) settings.value("echoBridgeIP0", 127).toInt(); + echoBridgeIP1 = (unsigned char) settings.value("echoBridgeIP1", 0).toInt(); + echoBridgeIP2 = (unsigned char) settings.value("echoBridgeIP2", 0).toInt(); + echoBridgeIP3 = (unsigned char) settings.value("echoBridgeIP3", 1).toInt(); +} + +void MainWindow::writeSettings() +{ + QSettings settings("lpp", "lfrsge"); + settings.setValue("echoBridgeIP0", this->UI->serverTMEchoDialogBox->getAddressPart1()); + settings.setValue("echoBridgeIP1", this->UI->serverTMEchoDialogBox->getAddressPart2()); + settings.setValue("echoBridgeIP2", this->UI->serverTMEchoDialogBox->getAddressPart3()); + settings.setValue("echoBridgeIP3", this->UI->serverTMEchoDialogBox->getAddressPart4()); +} + +void MainWindow::closeEvent(QCloseEvent *) +{ + writeSettings(); +} diff --git a/gse_lesia/mainwindow.h b/gse_lesia/mainwindow.h --- a/gse_lesia/mainwindow.h +++ b/gse_lesia/mainwindow.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -29,7 +30,17 @@ public: void buildWFAndDisplaySBM1(TMPacketToRead *packet, WFPacket *wfPacket); void buildWFAndDisplaySBM2(TMPacketToRead *packet, WFPacket *wfPacket); +protected: + void closeEvent(QCloseEvent *); + private: + void readSettings(); + void writeSettings(); + unsigned char echoBridgeIP0; + unsigned char echoBridgeIP1; + unsigned char echoBridgeIP2; + unsigned char echoBridgeIP3; + QByteArray dataArray; QList generalCCSDSPacketStore; diff --git a/rmapplugin/rmapplugin.cpp b/rmapplugin/rmapplugin.cpp --- a/rmapplugin/rmapplugin.cpp +++ b/rmapplugin/rmapplugin.cpp @@ -245,7 +245,7 @@ void rmapplugin::receivePacketFromBridge preProcessPacket(packet); // Send the packet to the TM echo bridge for processing - this->UI->tmEchoBridge->sendTMPacket_v2(packet); + this->UI->tmEchoBridge->sendTMPacket(packet); //this->UI->tmEchoBridge->sendTMPacket_alternative(packet); this->generalCCSDSPacketStore.append(packet); diff --git a/rmapplugin/tmechobridge.cpp b/rmapplugin/tmechobridge.cpp --- a/rmapplugin/tmechobridge.cpp +++ b/rmapplugin/tmechobridge.cpp @@ -157,52 +157,6 @@ void TMEchoBridge::sendXML_GSE_HK() void TMEchoBridge::sendTMPacket(TMPacketToRead *tmPacketToRead) { - if (tmEchoBridgeSocket->state() == QAbstractSocket::ConnectedState) - { - // START DOCUMENT - //xmlWriter->writeStartDocument(); - - // - xmlWriter->writeStartElement("Event"); - - // - xmlWriter->writeStartElement("EventDate"); - xmlWriter->writeEndElement(); - - // - xmlWriter->writeStartElement("EventTime"); - xmlWriter->writeEndElement(); - - // - xmlWriter->writeStartElement("EventBinary"); - xmlWriter->writeCharacters( - QByteArray::fromRawData( (char*) tmPacketToRead->Value, tmPacketToRead->size).toHex() - ); - //tmEchoBridgeSocket->write(QByteArray::fromRawData( (char*) tmPacketToRead->Value, tmPacketToRead->size)); - xmlWriter->writeEndElement(); - - // - xmlWriter->writeEndElement(); - - // END DOCUMENT - xmlWriter->writeEndDocument(); - - tmEchoBridgeSocket->flush(); - - totalOfBytes = totalOfBytes + tmPacketToRead->size; - totalOfPackets = totalOfPackets + 1; - label_totalOfBytes->setText("Number of TM bytes sent: " + QString::number(totalOfBytes)); - label_totalOfPackets->setText("Number of TM packets sent: " + QString::number(totalOfPackets)); - } - else - { - totalOfPacketsDropped = totalOfPacketsDropped + 1; - label_totalOfPacketsDropped->setText("Number of TM packets dropped: " + QString::number(totalOfPacketsDropped)); - } -} - -void TMEchoBridge::sendTMPacket_v2(TMPacketToRead *tmPacketToRead) -{ QByteArray ccsdsArray; QTime echoBridgeTimeout; diff --git a/rmapplugin/tmechobridge.h b/rmapplugin/tmechobridge.h --- a/rmapplugin/tmechobridge.h +++ b/rmapplugin/tmechobridge.h @@ -32,7 +32,6 @@ public slots: void newConnectionOnTCServer(); void sendXML_GSE_HK(); void sendTMPacket(TMPacketToRead *tmPacketToRead); - void sendTMPacket_v2(TMPacketToRead *tmPacketToRead); void clearConsole(); void resetTMStatistics(); diff --git a/wfdisplay/wfdisplay/wfdisplay.pro.user b/wfdisplay/wfdisplay/wfdisplay.pro.user --- a/wfdisplay/wfdisplay/wfdisplay.pro.user +++ b/wfdisplay/wfdisplay/wfdisplay.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget