diff options
Diffstat (limited to 'clients')
-rw-r--r-- | clients/tde/src/part/fpgaview/layout.ui | 476 | ||||
-rw-r--r-- | clients/tde/src/part/fpgaview/part.cpp | 49 | ||||
-rw-r--r-- | clients/tde/src/part/fpgaview/part.h | 3 |
3 files changed, 369 insertions, 159 deletions
diff --git a/clients/tde/src/part/fpgaview/layout.ui b/clients/tde/src/part/fpgaview/layout.ui index 8fa3afe..32cfc90 100644 --- a/clients/tde/src/part/fpgaview/layout.ui +++ b/clients/tde/src/part/fpgaview/layout.ui @@ -229,7 +229,7 @@ <property name="name"> <cstring>unnamed_grid</cstring> </property> - <widget class="TQLayoutWidget" row="0" column="1" colspan="2"> + <widget class="TQLayoutWidget" row="0" column="1"> <property name="name"> <cstring>unnamed_layout</cstring> </property> @@ -237,147 +237,157 @@ <property name="name"> <cstring>unnamed_grid</cstring> </property> - <spacer row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="1" colspan="2"> <property name="name"> - <cstring>unnamed_spacer</cstring> + <cstring>unnamed_layout</cstring> </property> - <property name="orientation"> - <enum>Horizontal</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> + <grid> + <property name="name"> + <cstring>unnamed_grid</cstring> + </property> + <spacer row="0" column="0"> + <property name="name"> + <cstring>unnamed_spacer</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="FPGAPushButton" row="0" column="1"> + <property name="name"> + <cstring>group4BitInputLED0</cstring> + </property> + </widget> + <spacer row="0" column="2"> + <property name="name"> + <cstring>unnamed_spacer</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </grid> + </widget> + <widget class="FPGAPushButton" row="1" column="0" rowspan="2"> + <property name="name"> + <cstring>group4BitInputLED3</cstring> </property> - </spacer> - <widget class="FPGAPushButton" row="0" column="1"> + </widget> + <widget class="FPGAPushButton" row="1" column="3" rowspan="2"> <property name="name"> - <cstring>group4BitInputLED0</cstring> + <cstring>group4BitInputLED1</cstring> </property> </widget> - <spacer row="0" column="2"> + <widget class="TQLayoutWidget" row="3" column="1" colspan="2"> <property name="name"> - <cstring>unnamed_spacer</cstring> + <cstring>unnamed_layout</cstring> </property> - <property name="orientation"> - <enum>Horizontal</enum> + <grid> + <property name="name"> + <cstring>unnamed_grid</cstring> + </property> + <spacer row="0" column="0"> + <property name="name"> + <cstring>unnamed_spacer</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="FPGAPushButton" row="0" column="1"> + <property name="name"> + <cstring>group4BitInputLED2</cstring> + </property> + </widget> + <spacer row="0" column="2"> + <property name="name"> + <cstring>unnamed_spacer</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </grid> + </widget> + <widget class="TQLabel" row="1" column="1"> + <property name="name"> + <cstring>group4BitInputValueLabel</cstring> </property> - <property name="sizeType"> - <enum>Expanding</enum> + <property name="text"> + <cstring>In:</cstring> </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> + <property name="alignment"> + <set>AlignBottom|AlignLeft</set> </property> - </spacer> - </grid> - </widget> - <widget class="FPGAPushButton" row="1" column="0" rowspan="2"> - <property name="name"> - <cstring>group4BitInputLED3</cstring> - </property> - </widget> - <widget class="FPGAPushButton" row="1" column="3" rowspan="2"> - <property name="name"> - <cstring>group4BitInputLED1</cstring> - </property> - </widget> - <widget class="TQLayoutWidget" row="3" column="1" colspan="2"> - <property name="name"> - <cstring>unnamed_layout</cstring> - </property> - <grid> - <property name="name"> - <cstring>unnamed_grid</cstring> - </property> - <spacer row="0" column="0"> + </widget> + <widget class="TQLabel" row="2" column="1"> <property name="name"> - <cstring>unnamed_spacer</cstring> - </property> - <property name="orientation"> - <enum>Horizontal</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> + <cstring>group4BitOutputValueLabel</cstring> </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> + <property name="text"> + <cstring>Out:</cstring> </property> - </spacer> - <widget class="FPGAPushButton" row="0" column="1"> - <property name="name"> - <cstring>group4BitInputLED2</cstring> + <property name="alignment"> + <set>AlignTop|AlignLeft</set> </property> </widget> - <spacer row="0" column="2"> + <widget class="TQLabel" row="1" column="2"> <property name="name"> - <cstring>unnamed_spacer</cstring> + <cstring>group4BitInputValueText</cstring> </property> - <property name="orientation"> - <enum>Horizontal</enum> + <property name="alignment"> + <set>AlignBottom|AlignRight</set> </property> - <property name="sizeType"> - <enum>Expanding</enum> + </widget> + <widget class="TQLabel" row="2" column="2"> + <property name="name"> + <cstring>group4BitOutputValueText</cstring> </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> + <property name="alignment"> + <set>AlignTop|AlignRight</set> </property> - </spacer> + </widget> </grid> </widget> - <widget class="TQLabel" row="1" column="1"> - <property name="name"> - <cstring>group4BitInputValueLabel</cstring> - </property> - <property name="text"> - <cstring>In:</cstring> - </property> - <property name="alignment"> - <set>AlignBottom|AlignLeft</set> - </property> - </widget> - <widget class="TQLabel" row="2" column="1"> - <property name="name"> - <cstring>group4BitOutputValueLabel</cstring> - </property> - <property name="text"> - <cstring>Out:</cstring> - </property> - <property name="alignment"> - <set>AlignTop|AlignLeft</set> - </property> - </widget> - <widget class="TQLabel" row="1" column="2"> - <property name="name"> - <cstring>group4BitInputValueText</cstring> - </property> - <property name="alignment"> - <set>AlignBottom|AlignRight</set> - </property> - </widget> - <widget class="TQLabel" row="2" column="2"> - <property name="name"> - <cstring>group4BitOutputValueText</cstring> - </property> - <property name="alignment"> - <set>AlignTop|AlignRight</set> - </property> - </widget> </grid> </widget> - <widget class="TQLayoutWidget" row="0" column="2" rowspan="3"> + <widget class="TQLayoutWidget" row="0" column="2" rowspan="2" colspan="2"> <property name="name"> <cstring>unnamed_layout</cstring> </property> @@ -393,50 +403,48 @@ <property name="name"> <cstring>unnamed_grid</cstring> </property> - <widget class="TQLabel" row="0" column="0"> + <widget class="TQFrame" row="0" column="0"> <property name="name"> - <cstring>LCDOutputLabel</cstring> - </property> - <property name="alignment"> - <set>AlignTop|AlignLeft</set> + <cstring>frameLCDDisplay</cstring> </property> - <property name="font"> - <font> - <pointsize>14</pointsize> - <family>monospace</family> - </font> + <property name="margin"> + <number>0</number> </property> - <property name="text"> - <cstring> \n </cstring> + <property name="minimumSize"> + <size> + <width>10</width> + <height>44</height> + </size> </property> + <grid> + <property name="name"> + <cstring>unnamed_grid</cstring> + </property> + <property name="margin"> + <number>2</number> + </property> + <widget class="TQLabel" row="0" column="0"> + <property name="name"> + <cstring>LCDOutputLabel</cstring> + </property> + <property name="alignment"> + <set>AlignTop|AlignLeft</set> + </property> + <property name="font"> + <font> + <pointsize>14</pointsize> + <family>monospace</family> + </font> + </property> + <property name="text"> + <cstring> \n </cstring> + </property> + </widget> + </grid> </widget> </grid> </widget> - <spacer row="2" column="0"> - <property name="name"> - <cstring>unnamed_spacer</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </grid> - </widget> - <widget class="TQLayoutWidget" row="0" column="3" rowspan="3"> - <property name="name"> - <cstring>unnamed_layout</cstring> - </property> - <grid> - <widget class="TQGroupBox" row="0" column="0"> + <widget class="TQGroupBox" row="0" column="1"> <property name="name"> <cstring>groupLEDDisplay</cstring> </property> @@ -528,7 +536,7 @@ </spacer> </grid> </widget> - <widget class="TQGroupBox" row="4" column="0" colspan="4"> + <widget class="TQGroupBox" row="4" column="0" colspan="3"> <property name="name"> <cstring>groupBatchTest</cstring> </property> @@ -608,6 +616,164 @@ </widget> </grid> </widget> + <widget class="TQGroupBox" row="5" column="0" colspan="3"> + <property name="name"> + <cstring>groupDataProcessing</cstring> + </property> + <property name="title"> + <string>Data Processing:</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed_grid</cstring> + </property> + <widget class="TQLabel" row="0" column="0"> + <property name="name"> + <cstring>unnamed_label</cstring> + </property> + <property name="text"> + <cstring>Input File Name:</cstring> + </property> + </widget> + <widget class="KURLRequester" row="1" column="0"> + <property name="name"> + <cstring>dataProcessingInputFile</cstring> + </property> + <property name="mode"> + <number>25</number> + </property> + <property name="filter"> + <cstring>*|All Files (*)</cstring> + </property> + </widget> + <widget class="TQLabel" row="0" column="1"> + <property name="name"> + <cstring>unnamed_label</cstring> + </property> + <property name="text"> + <cstring>Output File Name:</cstring> + </property> + </widget> + <widget class="KURLRequester" row="1" column="1"> + <property name="name"> + <cstring>dataProcessingOutputFile</cstring> + </property> + <property name="mode"> + <number>17</number> + </property> + <property name="filter"> + <cstring>*|All Files (*)</cstring> + </property> + </widget> + <widget class="TQPushButton" row="1" column="2"> + <property name="name"> + <cstring>dataProcessingRunButton</cstring> + </property> + <property name="text"> + <cstring>Upload Data</cstring> + </property> + </widget> + <widget class="TQProgressBar" row="2" column="0" colspan="3"> + <property name="name"> + <cstring>dataProcessingProgressBar</cstring> + </property> + </widget> + <widget class="TQCheckBox" row="3" column="0"> + <property name="name"> + <cstring>dataProcessingGenerateValidationString</cstring> + </property> + <property name="text"> + <cstring>Generate Validation String</cstring> + </property> + </widget> + <widget class="TQLabel" row="3" column="1" colspan="2"> + <property name="name"> + <cstring>dataProcessingStatusLabel</cstring> + </property> + <property name="alignment"> + <set>AlignVCenter|AlignRight</set> + </property> + </widget> + </grid> + </widget> + <widget class="TQLayoutWidget" row="2" column="3" rowspan="4"> + <property name="name"> + <cstring>unnamed_layout</cstring> + </property> + <grid> + <widget class="TQGroupBox" row="1" column="0"> + <property name="name"> + <cstring>groupInputImage</cstring> + </property> + <property name="title"> + <string>Input Image (128x128):</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed_grid</cstring> + </property> + <widget class="TQLabel" row="0" column="0"> + <property name="name"> + <cstring>ImageInputLabel</cstring> + </property> + <property name="alignment"> + <set>AlignVCenter|AlignHCenter</set> + </property> + <property name="fixedSize"> + <size> + <width>128</width> + <height>128</height> + </size> + </property> + </widget> + </grid> + </widget> + <widget class="TQGroupBox" row="2" column="0"> + <property name="name"> + <cstring>groupOutputImage</cstring> + </property> + <property name="title"> + <string>Output Image (128x128):</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed_grid</cstring> + </property> + <widget class="TQLabel" row="0" column="0"> + <property name="name"> + <cstring>ImageOutputLabel</cstring> + </property> + <property name="alignment"> + <set>AlignVCenter|AlignHCenter</set> + </property> + <property name="fixedSize"> + <size> + <width>128</width> + <height>128</height> + </size> + </property> + </widget> + </grid> + </widget> + <spacer row="0" column="0"> + <property name="name"> + <cstring>unnamed_spacer</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </grid> + </widget> </grid> </widget> </grid> diff --git a/clients/tde/src/part/fpgaview/part.cpp b/clients/tde/src/part/fpgaview/part.cpp index 769a7f9..2e73c43 100644 --- a/clients/tde/src/part/fpgaview/part.cpp +++ b/clients/tde/src/part/fpgaview/part.cpp @@ -564,7 +564,7 @@ FPGAViewPart::FPGAViewPart(TQWidget *parentWidget, const char *widgetName, TQObj : RemoteInstrumentPart( parent, name ), m_socket(0), m_base(0), connToServerConnecting(false), connToServerState(-1), connToServerTimeoutTimer(NULL), m_interfaceMode(BasicInterfaceMode), m_commHandlerState(0), m_connectionActiveAndValid(false), m_tickerState(0), m_remoteInputModeEnabled(false), m_4bitInputValue(0), m_4bitOutputValue(0), m_8bitInputValue(0), m_8bitOutputValue(0), m_16bitInputValue(0), m_16bitOutputValue(0), m_7segDigit3OutputValue(0xffffffff), m_7segDigit2OutputValue(0xffffffff), m_7segDigit1OutputValue(0xffffffff), m_7segDigit0OutputValue(0xffffffff), - m_batchOutputFile(NULL) + m_batchOutputFile(NULL), m_dataOutputFile(NULL) { // Initialize mutex m_connectionMutex = new TQMutex(false); @@ -691,7 +691,13 @@ FPGAViewPart::FPGAViewPart(TQWidget *parentWidget, const char *widgetName, TQObj m_base->frameLEDDisplay->setFrameStyle(TQFrame::Box | TQFrame::Raised); #endif + m_base->frameLCDDisplay->setBackgroundColor(TQColor(192, 192, 192)); + m_base->LCDOutputLabel->setBackgroundColor(TQColor(192, 192, 192)); + m_base->LCDOutputLabel->setPaletteForegroundColor(TQColor(0, 0, 0)); + m_base->frameLCDDisplay->setFrameStyle(TQFrame::Box | TQFrame::Raised); + connect(m_base->batchTestRunButton, SIGNAL(clicked()), this, SLOT(batchTestRunButtonClicked())); + connect(m_base->dataProcessingRunButton, SIGNAL(clicked()), this, SLOT(dataProcessingRunButtonClicked())); processAllGraphicsUpdates(); @@ -862,22 +868,48 @@ void FPGAViewPart::processLockouts() { m_modeAdvancedEnabled->setChecked(true); } - if ((m_base->batchTestInputFile->url() != "") && (m_base->batchTestOutputFile->url() != "") && (m_commHandlerMode != 1) && (m_connectionActiveAndValid == true)) { + if ((m_base->batchTestInputFile->url() != "") && (m_base->batchTestOutputFile->url() != "") && (m_commHandlerMode == 0) && (m_connectionActiveAndValid == true)) { m_base->batchTestRunButton->setEnabled(true); - m_base->batchTest16BitCheckBox->setEnabled(true); } else { m_base->batchTestRunButton->setEnabled(false); - m_base->batchTest16BitCheckBox->setEnabled(false); } if (m_commHandlerMode == 1) { m_base->batchTestInputFile->setEnabled(false); m_base->batchTestOutputFile->setEnabled(false); + m_base->batchTest16BitCheckBox->setEnabled(false); } else { m_base->batchTestInputFile->setEnabled(true); m_base->batchTestOutputFile->setEnabled(true); + m_base->batchTest16BitCheckBox->setEnabled(true); + } + + if ((m_connectionActiveAndValid == true) && (m_commHandlerMode == 0)) { + m_base->batchTestStatusLabel->setText(i18n("Ready")); + } + + if ((m_base->dataProcessingInputFile->url() != "") && (m_base->dataProcessingOutputFile->url() != "") && (m_commHandlerMode == 0) && (m_connectionActiveAndValid == true)) { + m_base->dataProcessingRunButton->setEnabled(true); + } + else { + m_base->dataProcessingRunButton->setEnabled(false); + } + + if (m_commHandlerMode == 2) { + m_base->dataProcessingInputFile->setEnabled(false); + m_base->dataProcessingOutputFile->setEnabled(false); + m_base->dataProcessingGenerateValidationString->setEnabled(false); + } + else { + m_base->dataProcessingInputFile->setEnabled(true); + m_base->dataProcessingOutputFile->setEnabled(true); + m_base->dataProcessingGenerateValidationString->setEnabled(true); + } + + if ((m_connectionActiveAndValid == true) && (m_commHandlerMode == 0)) { + m_base->dataProcessingStatusLabel->setText(i18n("Ready")); } } @@ -1076,6 +1108,13 @@ void FPGAViewPart::batchTestRunButtonClicked() { processLockouts(); } +void FPGAViewPart::dataProcessingRunButtonClicked() { + m_commHandlerState = 0; + m_commHandlerMode = 2; + m_dataGenerateValidationString = m_base->dataProcessingGenerateValidationString->isChecked(); + processLockouts(); +} + void FPGAViewPart::sendInputStatesToRemoteFPGA() { if (m_socket) { char data[64]; @@ -1231,6 +1270,7 @@ void FPGAViewPart::updateDisplay() { // Batch test mode // This expects to see a newline-delimited text file containing input values to test if (m_commHandlerState == 0) { + m_base->batchTestStatusLabel->setText(i18n("Reading input data") + "..."); m_batchInputValueList.clear(); TQFile file(m_base->batchTestInputFile->url()); if (file.open(IO_ReadOnly)) { @@ -1274,6 +1314,7 @@ void FPGAViewPart::updateDisplay() { processLockouts(); } else { + m_base->batchTestStatusLabel->setText(i18n("Processing element") + " " + TQString("%1/%2").arg(m_batchCurrentValueIndex).arg(m_batchInputValueList.count()) + "..."); if (m_batchUsing16Bit) { m_16bitInputValue = m_batchInputValueList[m_batchCurrentValueIndex]; } diff --git a/clients/tde/src/part/fpgaview/part.h b/clients/tde/src/part/fpgaview/part.h index e5bd8f8..3c88b75 100644 --- a/clients/tde/src/part/fpgaview/part.h +++ b/clients/tde/src/part/fpgaview/part.h @@ -175,6 +175,7 @@ namespace RemoteLab void process7SegmentLEDOutputChanges(); void batchTestRunButtonClicked(); + void dataProcessingRunButtonClicked(); private: void sendInputStatesToRemoteFPGA(); @@ -220,6 +221,8 @@ namespace RemoteLab unsigned int m_batchCurrentValueIndex; bool m_batchUsing16Bit; TQFile* m_batchOutputFile; + bool m_dataGenerateValidationString; + TQFile* m_dataOutputFile; }; } |