From c21c4b0e014abc87a7c985e74cf422328d1b7f11 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 4 Jul 2012 16:55:18 -0500 Subject: Fix UI layout of FPGA part --- clients/tde/src/part/fpgaview/layout.ui | 476 +++++++++++++++++++++----------- clients/tde/src/part/fpgaview/part.cpp | 49 +++- clients/tde/src/part/fpgaview/part.h | 3 + 3 files changed, 369 insertions(+), 159 deletions(-) (limited to 'clients') 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 @@ unnamed_grid - + unnamed_layout @@ -237,147 +237,157 @@ unnamed_grid - + - unnamed_spacer + unnamed_layout - - Horizontal - - - Expanding - - - - 20 - 20 - + + + unnamed_grid + + + + unnamed_spacer + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + group4BitInputLED0 + + + + + unnamed_spacer + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + + + group4BitInputLED3 - - + + - group4BitInputLED0 + group4BitInputLED1 - + - unnamed_spacer + unnamed_layout - - Horizontal + + + unnamed_grid + + + + unnamed_spacer + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + group4BitInputLED2 + + + + + unnamed_spacer + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + + + group4BitInputValueLabel - - Expanding + + In: - - - 20 - 20 - + + AlignBottom|AlignLeft - - - - - - group4BitInputLED3 - - - - - group4BitInputLED1 - - - - - unnamed_layout - - - - unnamed_grid - - + + - unnamed_spacer - - - Horizontal - - - Expanding + group4BitOutputValueLabel - - - 20 - 20 - + + Out: - - - - group4BitInputLED2 + + AlignTop|AlignLeft - + - unnamed_spacer + group4BitInputValueText - - Horizontal + + AlignBottom|AlignRight - - Expanding + + + + group4BitOutputValueText - - - 20 - 20 - + + AlignTop|AlignRight - + - - - group4BitInputValueLabel - - - In: - - - AlignBottom|AlignLeft - - - - - group4BitOutputValueLabel - - - Out: - - - AlignTop|AlignLeft - - - - - group4BitInputValueText - - - AlignBottom|AlignRight - - - - - group4BitOutputValueText - - - AlignTop|AlignRight - - - + unnamed_layout @@ -393,50 +403,48 @@ unnamed_grid - + - LCDOutputLabel - - - AlignTop|AlignLeft + frameLCDDisplay - - - 14 - monospace - + + 0 - - \n + + + 10 + 44 + + + + unnamed_grid + + + 2 + + + + LCDOutputLabel + + + AlignTop|AlignLeft + + + + 14 + monospace + + + + \n + + + - - - unnamed_spacer - - - Vertical - - - Expanding - - - - 20 - 20 - - - - - - - - unnamed_layout - - - + groupLEDDisplay @@ -528,7 +536,7 @@ - + groupBatchTest @@ -608,6 +616,164 @@ + + + groupDataProcessing + + + Data Processing: + + + + unnamed_grid + + + + unnamed_label + + + Input File Name: + + + + + dataProcessingInputFile + + + 25 + + + *|All Files (*) + + + + + unnamed_label + + + Output File Name: + + + + + dataProcessingOutputFile + + + 17 + + + *|All Files (*) + + + + + dataProcessingRunButton + + + Upload Data + + + + + dataProcessingProgressBar + + + + + dataProcessingGenerateValidationString + + + Generate Validation String + + + + + dataProcessingStatusLabel + + + AlignVCenter|AlignRight + + + + + + + unnamed_layout + + + + + groupInputImage + + + Input Image (128x128): + + + + unnamed_grid + + + + ImageInputLabel + + + AlignVCenter|AlignHCenter + + + + 128 + 128 + + + + + + + + groupOutputImage + + + Output Image (128x128): + + + + unnamed_grid + + + + ImageOutputLabel + + + AlignVCenter|AlignHCenter + + + + 128 + 128 + + + + + + + + unnamed_spacer + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + 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; }; } -- cgit v1.2.1