##// END OF EJS Templates
lfrsgse is a QMainWindow...
lfrsgse is a QMainWindow Reorganize HK information display

File last commit:

r25:361dd727106d default
r39:f8ba3aa4aa6e default
Show More
rmappluginui.cpp
296 lines | 12.7 KiB | text/x-c | CppLexer
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 /*------------------------------------------------------------------------------
-- This file is a part of the LPPMON Software
-- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
--
-- 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 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 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
-------------------------------------------------------------------------------*/
/*-- Author : Alexis Jeandet
-- Mail : alexis.jeandet@lpp.polytechnique.fr
----------------------------------------------------------------------------*/
#include "rmapplugin.h"
rmapPluginUI::rmapPluginUI(QWidget *parent) :
QWidget(parent)
{
spwTabWidget = new QTabWidget;
waveform display added for the normal mode...
r19 //
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 QWidget* spwTabWidgetPage0 = new QWidget;
QWidget* spwTabWidgetPage2 = new QWidget;
QWidget* spwTabWidgetPage3 = new QWidget;
QWidget* spwTabWidgetPage4 = new QWidget;
first version of the waveform display...
r17 QWidget* spwTabWidgetPage5 = new QWidget;
First version of the gse-lesia module...
r23 QWidget* spwTabWidgetPage6 = new QWidget;
waveform display added for the normal mode...
r19 //
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 bridgeWidget = new QWidget;
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 mainLayout = new QVBoxLayout;
ccsdsLayout = new QVBoxLayout;
consoleLayout = new QVBoxLayout;
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 selectionLayout = new QVBoxLayout;
first version of the waveform display...
r17 connectionLayout = new QGridLayout;
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 bridgeSelection_LAYOUT = new QGridLayout;
generalParameters_LAYOUT = new QGridLayout;
gresb_GROUPBOX = new QGroupBox(tr("GRESB bridge parameters"));
stardundee_GROUPBOX = new QGroupBox(tr("Star Dundee brick parameters"));
selection_GROUPBOX = new QGroupBox(tr("Bridge selection"));
generalParameters_GROUPBOX = new QGroupBox(tr("General parameters"));
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0
//*** QLABEL ***//
Minor updates
r3 gresbBridgeIPLabel = new QLabel(tr("Bridge IP: "));
gresbVirtualLinkLabel = new QLabel(tr("Virtual Link: "));
spwLinkLabel = new QLabel(tr("SPW Link: "));
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 rmapSourceLogicalAddressLabel = new QLabel(tr("RMAP Source Logical Address: "));
rmapTargetLogicalAddressLabel = new QLabel(tr("RMAP Target Logical Address: "));
logFileName = new QLabel;
Minor updates
r3 gresbStatusQueryLabel = new QLabel(tr("Status query socket (port 3010): waiting for connection"));
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running"));
plugin updated, TM packet store reworked to store any TM continuously...
r13 nbPacketInStore = new QLabel(tr("nb packets in store: -"));
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0
//*** QPUSHBUTTON ***//
Minor updates
r3 rmapOpenCommunicationButton = new QPushButton(tr("Open selected bridge"));
rmapCloseCommunicationButton = new QPushButton(tr("Close selected bridge"));
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 rmapOpenCommunicationButton->setEnabled(false);
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 rmapCloseCommunicationButton->setEnabled(false);
logFileChooseButton = new QPushButton(tr("Choose file"));
gresbStatusQueryRetryButton = new QPushButton(tr("Retry"));
gresbStatusQueryAbortButton = new QPushButton(tr("Abort"));
clearConsoleButton = new QPushButton(tr("Clear"));
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 selectGRESB_BUTTON = new QRadioButton(tr("GRESB"));
selectStarDundee_BUTTON = new QRadioButton(tr("Star Dundee"));
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 //*** SPINBOX ***//
gresbVirtualLinkSpinBox = new QSpinBox;
rmapSourceLogicalAddressSpinBox = new QSpinBox;
rmapTargetLogicalAddressSpinBox = new QSpinBox;
spwLinkSpinBox = new QSpinBox;;
CCSDSTargetLogicalAddressSpinBox = new QSpinBox;
gresbVirtualLinkSpinBox->setRange(0, 4);
gresbVirtualLinkSpinBox->setValue(1);
rmapSourceLogicalAddressSpinBox->setRange(0, 255);
rmapTargetLogicalAddressSpinBox->setRange(0, 255);
spwLinkSpinBox->setRange(0, 2);
spwLinkSpinBox->setValue(0);
//*** MISC **//
starDundee = new StarDundee;
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 gresbBridge = new gresb;
First version of the gse-lesia module...
r23 tmEchoBridge = new TMEchoBridge();
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 console = new QTextEdit;
gresbStatusQueryDialog = new QDialog;
logEnableCheckBox = new QCheckBox(tr("Enable Logs"));
RMAP_write_verify = new QCheckBox(tr("data checked before write\nlimited to 4 bytes\nNOT IMPLEMENTED"));
RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable"));
logFile = new QFile();
first version of the waveform display...
r17 wfDisplay = new WFDisplay();
waveform display added for the normal mode...
r19 tmStatistics = new TMStatistics();
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0
logFileEn = false;
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 connectionLayout->setRowStretch(7, 1);
connectionLayout->setColumnStretch(2, 1);
bridgeSelection_LAYOUT->addWidget(selectGRESB_BUTTON, 0, 0, 1, 1);
bridgeSelection_LAYOUT->addWidget(selectStarDundee_BUTTON, 0, 1, 1, 1);
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0
rmap source target set to 1 by default
r22 bridgeSelection_LAYOUT->setRowStretch(1, 1);
bridgeSelection_LAYOUT->setColumnStretch(2, 1);
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 generalParameters_LAYOUT->addWidget(logEnableCheckBox, 0, 0, 1, 1);
generalParameters_LAYOUT->addWidget(logFileChooseButton, 0, 1, 1, 1);
Plugin modified to allow the launch of interactiv tests from the python interpreter...
r11 generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressLabel, 1, 0, 0);
generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressSpinBox, 1, 1, 0);
generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressLabel, 2, 0, 0);
generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressSpinBox, 2, 1, 0);
generalParameters_LAYOUT->addWidget(rmapOpenCommunicationButton, 3, 0, 1, 1);
generalParameters_LAYOUT->addWidget(rmapCloseCommunicationButton, 3, 1, 1, 1);
generalParameters_LAYOUT->addWidget(RMAP_write_verify, 4, 0, 1, 2);
generalParameters_LAYOUT->addWidget(RMAP_write_reply, 5, 0, 1, 2);
plugin updated, TM packet store reworked to store any TM continuously...
r13
Plugin modified to allow the launch of interactiv tests from the python interpreter...
r11 generalParameters_LAYOUT->setRowStretch(6, 1);
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 generalParameters_LAYOUT->setColumnStretch(2, 1);
class gresb fully functional, writeSPW function not tested yet
r9 gresb_GROUPBOX->setLayout(gresbBridge->layout());
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 gresb_GROUPBOX->setVisible(false);
stardundee_GROUPBOX->setLayout(starDundee->layout());
stardundee_GROUPBOX->setVisible(false);
selection_GROUPBOX->setLayout(bridgeSelection_LAYOUT);
generalParameters_GROUPBOX->setLayout(generalParameters_LAYOUT);
selectionLayout->addWidget(selection_GROUPBOX);
selectionLayout->addWidget(generalParameters_GROUPBOX);
selectionLayout->addWidget(gresb_GROUPBOX);
selectionLayout->addWidget(stardundee_GROUPBOX);
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0
first version of the waveform display...
r17 //********
// CONSOLE
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 consoleLayout->addWidget(console);
consoleLayout->addWidget(clearConsoleButton);
plugin updated, TM packet store reworked to store any TM continuously...
r13 consoleLayout->addWidget(nbPacketInStore);
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0
connect(this->logFileChooseButton, SIGNAL(clicked()), this, SLOT(chooseLogFile()));
connect(this, SIGNAL(setLogFileName(QString)), this->logFileName, SLOT(setText(QString)));
connect(this->logEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(logFileEnDisable(int)));
spwTabWidget->addTab(spwTabWidgetPage0, tr("connection"));
spwTabWidget->addTab(spwTabWidgetPage2, tr("status"));
spwTabWidget->addTab(spwTabWidgetPage3, tr("console"));
waveform display added for the normal mode...
r19 spwTabWidget->addTab(spwTabWidgetPage4, tr("TM statistics"));
rmapplugin updated, waveform plots removed (exported in gse_lesia)...
r25 //spwTabWidget->addTab(spwTabWidgetPage5, tr("waveforms"));
First version of the gse-lesia module...
r23 spwTabWidget->addTab(spwTabWidgetPage6, tr("TM Echo Bridge"));
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1
spwTabWidgetPage0->setLayout(selectionLayout);
waveform display added for the normal mode...
r19 spwTabWidgetPage2->setLayout(this->gresbBridge->spwLinkStatusEnquiry->mainLayout);
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 spwTabWidgetPage3->setLayout(consoleLayout);
waveform display added for the normal mode...
r19 spwTabWidgetPage4->setLayout(tmStatistics->layout());
first version of the waveform display...
r17 spwTabWidgetPage5->setLayout(wfDisplay->layout());
First version of the gse-lesia module...
r23 spwTabWidgetPage6->setLayout(tmEchoBridge->layout());
class gresb fully functional, writeSPW function not tested yet
r9
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 mainLayout->addWidget(spwTabWidget);
setLayout(mainLayout);
connect(this->clearConsoleButton, SIGNAL(clicked()), this->console, SLOT(clear()));
the two bridges, Star Dundee and GRESB are fully functional
r10
class gresb fully functional, writeSPW function not tested yet
r9 // briges
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 connect(this->selectGRESB_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
connect(this->selectStarDundee_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
Minor updates
r3 connect(this->starDundee, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
class gresb fully functional, writeSPW function not tested yet
r9 connect(this->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
Plugin modified to allow the launch of interactiv tests from the python interpreter...
r11 connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(sourceHasChanged(int)));
connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(targetHasChanged(int)));
connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(sourceHasChanged(int)));
Minor updates
r3 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(targetHasChanged(int)));
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1
// command code
connect(this->RMAP_write_reply, SIGNAL(clicked()), this, SLOT(getCommandCode()));
connect(this->RMAP_write_verify, SIGNAL(clicked()), this, SLOT(getCommandCode()));
class gresb fully functional, writeSPW function not tested yet
r9 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
this->starDundee, SLOT(commandCodeHasChanged(RMAP_command_codes)));
connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
this->gresbBridge, SLOT(commandCodeHasChanged(RMAP_command_codes)));
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1
getCommandCode(); // init the command code value
Plugin modified to allow the launch of interactiv tests from the python interpreter...
r11 rmapSourceLogicalAddressSpinBox->setValue(DEFAULT_SOURCE);
rmapTargetLogicalAddressSpinBox->setValue(DEFAULT_TARGET);
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 }
rmapPluginUI::~rmapPluginUI()
{
//delete ui;
}
void rmapPluginUI::chooseLogFile()
{
if(this->logFile->isOpen())
this->logFile->close();
this->logFile->setFileName(QFileDialog::getSaveFileName(this,tr("Open Log file"),
QDir::homePath()
+ "/"
+ QDate::currentDate().toString()
+ "_"
+ QTime::currentTime().toString()
+ "_rmapPluginUI.log",
tr("Log Files (*.txt *.log)")));
if(this->logFile->open(QIODevice::WriteOnly))
{
this->logFileStrm = new QTextStream(this->logFile);
emit this->setLogFileName(this->logFile->fileName());
}
}
void rmapPluginUI::logFileEnDisable(int state)
{
if(state==Qt::Checked)
{
this->logFileEn = true;
}
else if(state==Qt::Unchecked)
{
this->logFileEn = false;
}
}
bool rmapPluginUI::islogfileenable()
{
return this->logFileEn;
}
void rmapPluginUI::appendToLogFile(const QString & text)
{
if(this->logFileEn && this->logFile->isOpen())
{
*(this->logFileStrm) << text << endl;
}
}
void rmapPluginUI::closeEvent(QCloseEvent *event)
{
if(this->logFile->isOpen())
{
this->logFileStrm->flush();
this->logFile->waitForBytesWritten(3000);
this->logFile->close();
}
event->accept();
}
RMAP_command_codes rmapPluginUI::getCommandCode()
{
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 RMAP_command_codes commandCode = invalid0;
if (RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_rep;
if (RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_noRep;
if (!RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_Rep;
if (!RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_noRep;
emit commandCodeHasChanged(commandCode);
return commandCode;
Initial commit: rmapplugin fully operational with the GRESB Ethernet/SpaceWire bridge.
r0 }
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1
// SLOT
void rmapPluginUI::selectionBetweenGresbAndStarDundee() //SLOT
{
if (selectGRESB_BUTTON->isChecked())
{
gresb_GROUPBOX->setVisible(true);
stardundee_GROUPBOX->setVisible(false);
rmapOpenCommunicationButton->setEnabled(true);
emit bridgeHasChanged(selectedBridgeIsGRESB);
}
if (selectStarDundee_BUTTON->isChecked())
{
stardundee_GROUPBOX->setVisible(true);
gresb_GROUPBOX->setVisible(false);
rmapOpenCommunicationButton->setEnabled(true);
emit bridgeHasChanged(selectedBridgeIsStarDundee);
}
}
Minor updates
r3 void rmapPluginUI::isOpen(bool flag)
paul@pc-solar1.lab-lpp.local
First version with the Star Dundee bridge operational
r1 {
if (flag == true)
{
selection_GROUPBOX->setEnabled(false);
this->rmapOpenCommunicationButton->setEnabled(false);
this->rmapCloseCommunicationButton->setEnabled(true);
}
if (flag == false)
{
selection_GROUPBOX->setEnabled(true);
this->rmapOpenCommunicationButton->setEnabled(true);
this->rmapCloseCommunicationButton->setEnabled(false);
}
}