summaryrefslogtreecommitdiffstats
path: root/clients/tde/src
diff options
context:
space:
mode:
Diffstat (limited to 'clients/tde/src')
-rw-r--r--clients/tde/src/part/fpgaview/layout.ui301
-rw-r--r--clients/tde/src/part/fpgaview/part.cpp61
-rw-r--r--clients/tde/src/part/fpgaview/part.h2
3 files changed, 194 insertions, 170 deletions
diff --git a/clients/tde/src/part/fpgaview/layout.ui b/clients/tde/src/part/fpgaview/layout.ui
index e1803e1..95328ab 100644
--- a/clients/tde/src/part/fpgaview/layout.ui
+++ b/clients/tde/src/part/fpgaview/layout.ui
@@ -50,7 +50,7 @@
<cstring>group8BitInput</cstring>
</property>
<property name="title">
- <string></string>
+ <string>8-Bit Input (Switches)</string>
</property>
<grid>
<property name="name">
@@ -96,10 +96,33 @@
<cstring>group8BitInputLED0</cstring>
</property>
</widget>
- <widget class="TQLabel" row="0" column="8">
+ <spacer row="0" column="8">
+ <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>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="0" column="9">
<property name="name">
<cstring>group8BitInputValueText</cstring>
</property>
+ <property name="text">
+ <cstring></cstring>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
</widget>
</grid>
</widget>
@@ -154,10 +177,115 @@
<cstring>group8BitOutputLED0</cstring>
</property>
</widget>
- <widget class="TQLabel" row="0" column="8">
+ <spacer row="0" column="8">
+ <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>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="0" column="9">
<property name="name">
<cstring>group8BitOutputValueText</cstring>
</property>
+ <property name="text">
+ <cstring></cstring>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQGroupBox" row="0" column="1">
+ <property name="name">
+ <cstring>group4BitOutput</cstring>
+ </property>
+ <property name="title">
+ <string>4-Bit Input (Buttons)</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed_grid</cstring>
+ </property>
+ <widget class="FPGAPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>group4BitInputLED3</cstring>
+ </property>
+ </widget>
+ <widget class="FPGAPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>group4BitInputLED2</cstring>
+ </property>
+ </widget>
+ <widget class="FPGAPushButton" row="0" column="2">
+ <property name="name">
+ <cstring>group4BitInputLED1</cstring>
+ </property>
+ </widget>
+ <widget class="FPGAPushButton" row="0" column="3">
+ <property name="name">
+ <cstring>group4BitInputLED0</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="4">
+ <property name="name">
+ <cstring>group4BitInputValueText</cstring>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQGroupBox" row="1" column="1">
+ <property name="name">
+ <cstring>group4BitOutput</cstring>
+ </property>
+ <property name="title">
+ <string>4-Bit Output Values</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed_grid</cstring>
+ </property>
+ <widget class="FPGALed" row="0" column="0">
+ <property name="name">
+ <cstring>group4BitOutputLED3</cstring>
+ </property>
+ </widget>
+ <widget class="FPGALed" row="0" column="1">
+ <property name="name">
+ <cstring>group4BitOutputLED2</cstring>
+ </property>
+ </widget>
+ <widget class="FPGALed" row="0" column="2">
+ <property name="name">
+ <cstring>group4BitOutputLED1</cstring>
+ </property>
+ </widget>
+ <widget class="FPGALed" row="0" column="3">
+ <property name="name">
+ <cstring>group4BitOutputLED0</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="4">
+ <property name="name">
+ <cstring>group4BitOutputValueText</cstring>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
</widget>
</grid>
</widget>
@@ -215,175 +343,30 @@
<property name="text">
<cstring></cstring>
</property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
</widget>
</grid>
</widget>
- <widget class="TQGroupBox" row="0" column="1" rowspan="3">
+ <widget class="TQGroupBox" row="2" column="1">
<property name="name">
- <cstring>group4BitInput</cstring>
+ <cstring>groupGlobalControl</cstring>
</property>
<property name="title">
- <string>Buttons:</string>
+ <string>Global Controls</string>
</property>
<grid>
<property name="name">
<cstring>unnamed_grid</cstring>
</property>
- <widget class="TQLayoutWidget" row="0" column="1">
+ <widget class="TQPushButton" row="1" column="2">
<property name="name">
- <cstring>unnamed_layout</cstring>
+ <cstring>groupGlobalControlResetButton</cstring>
+ </property>
+ <property name="text">
+ <cstring>Strobe User Logic Reset</cstring>
</property>
- <grid>
- <property name="name">
- <cstring>unnamed_grid</cstring>
- </property>
- <widget class="TQLayoutWidget" row="0" 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">
- <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>0</width>
- <height>0</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>0</width>
- <height>0</height>
- </size>
- </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">
- <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>0</width>
- <height>0</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>0</width>
- <height>0</height>
- </size>
- </property>
- </spacer>
- </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>
</grid>
</widget>
diff --git a/clients/tde/src/part/fpgaview/part.cpp b/clients/tde/src/part/fpgaview/part.cpp
index 36809c2..d90eca4 100644
--- a/clients/tde/src/part/fpgaview/part.cpp
+++ b/clients/tde/src/part/fpgaview/part.cpp
@@ -589,7 +589,7 @@ FPGAViewPart::FPGAViewPart(TQWidget *parentWidget, const char *widgetName, TQObj
: RemoteInstrumentPart( parent, name ), m_base(NULL), m_interfaceMode(BasicInterfaceMode),
m_commHandlerState(0), m_commHandlerMode(0), m_commHandlerNextState(0), m_commHandlerNextMode(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(0xff),
- m_7segDigit2OutputValue(0xff), m_7segDigit1OutputValue(0xff), m_7segDigit0OutputValue(0xff),
+ m_7segDigit2OutputValue(0xff), m_7segDigit1OutputValue(0xff), m_7segDigit0OutputValue(0xff), m_sendingUserLogicReset(false),
m_batchOutputFile(NULL), m_dataOutputFile(NULL), m_dataMemorySize(16384), m_dataMemorySizePrev(0),
m_dataMemoryImageWidth(128), m_dataMemoryImageHeight(128),
m_inputImageViewer(NULL), m_outputImageViewer(NULL)
@@ -637,15 +637,14 @@ FPGAViewPart::FPGAViewPart(TQWidget *parentWidget, const char *widgetName, TQObj
m_modeSubMenu->insert(m_modeAdvancedEnabled);
// Initialize widgets
- m_base->group4BitInputValueLabel->setFixedSize(LED_BASE_SIZE*2, LED_BASE_SIZE*2);
- m_base->group4BitOutputValueLabel->setFixedSize(LED_BASE_SIZE*2, LED_BASE_SIZE*2);
- m_base->group4BitInputValueText->setFixedSize(LED_BASE_SIZE*2, LED_BASE_SIZE*2);
- m_base->group4BitOutputValueText->setFixedSize(LED_BASE_SIZE*2, LED_BASE_SIZE*2);
-
m_base->group4BitInputLED3->setFixedSize(LED_SIZE);
m_base->group4BitInputLED2->setFixedSize(LED_SIZE);
m_base->group4BitInputLED1->setFixedSize(LED_SIZE);
m_base->group4BitInputLED0->setFixedSize(LED_SIZE);
+ m_base->group4BitOutputLED3->setFixedSize(LED_SIZE);
+ m_base->group4BitOutputLED2->setFixedSize(LED_SIZE);
+ m_base->group4BitOutputLED1->setFixedSize(LED_SIZE);
+ m_base->group4BitOutputLED0->setFixedSize(LED_SIZE);
m_base->group8BitInputLED7->setFixedSize(LED_SIZE);
m_base->group8BitInputLED6->setFixedSize(LED_SIZE);
m_base->group8BitInputLED5->setFixedSize(LED_SIZE);
@@ -667,6 +666,10 @@ FPGAViewPart::FPGAViewPart(TQWidget *parentWidget, const char *widgetName, TQObj
m_base->group4BitInputLED2->setState(KLed::Off);
m_base->group4BitInputLED1->setState(KLed::Off);
m_base->group4BitInputLED0->setState(KLed::Off);
+ m_base->group4BitOutputLED3->setState(KLed::Off);
+ m_base->group4BitOutputLED2->setState(KLed::Off);
+ m_base->group4BitOutputLED1->setState(KLed::Off);
+ m_base->group4BitOutputLED0->setState(KLed::Off);
m_base->group8BitInputLED7->setState(KLed::Off);
m_base->group8BitInputLED6->setState(KLed::Off);
m_base->group8BitInputLED5->setState(KLed::Off);
@@ -684,6 +687,10 @@ FPGAViewPart::FPGAViewPart(TQWidget *parentWidget, const char *widgetName, TQObj
m_base->group8BitOutputLED1->setState(KLed::Off);
m_base->group8BitOutputLED0->setState(KLed::Off);
+ m_base->group4BitOutputLED3->setClickable(false);
+ m_base->group4BitOutputLED2->setClickable(false);
+ m_base->group4BitOutputLED1->setClickable(false);
+ m_base->group4BitOutputLED0->setClickable(false);
m_base->group8BitOutputLED7->setClickable(false);
m_base->group8BitOutputLED6->setClickable(false);
m_base->group8BitOutputLED5->setClickable(false);
@@ -693,6 +700,12 @@ FPGAViewPart::FPGAViewPart(TQWidget *parentWidget, const char *widgetName, TQObj
m_base->group8BitOutputLED1->setClickable(false);
m_base->group8BitOutputLED0->setClickable(false);
+#if 0
+ TQFontMetrics group8BitTextMetrics(m_base->group8BitOutputValueText->font());
+ m_base->group8BitInputValueText->setFixedSize(group8BitTextMetrics.width("0000"), group8BitTextMetrics.height());
+ m_base->group8BitOutputValueText->setFixedSize(group8BitTextMetrics.width("0000"), group8BitTextMetrics.height());
+#endif
+
connect(m_base->group4BitInputLED3, SIGNAL(changed()), this, SLOT(process4BitInputChanges()));
connect(m_base->group4BitInputLED2, SIGNAL(changed()), this, SLOT(process4BitInputChanges()));
connect(m_base->group4BitInputLED1, SIGNAL(changed()), this, SLOT(process4BitInputChanges()));
@@ -744,6 +757,7 @@ FPGAViewPart::FPGAViewPart(TQWidget *parentWidget, const char *widgetName, TQObj
m_base->LCDOutputLabel->setFixedSize(lcdwidth, lcdheight);
m_base->frameLCDDisplay->setFrameStyle(TQFrame::Box | TQFrame::Raised);
+ connect(m_base->groupGlobalControlResetButton, SIGNAL(clicked()), this, SLOT(groupGlobalControlResetButtonClicked()));
connect(m_base->batchTestRunButton, SIGNAL(clicked()), this, SLOT(batchTestRunButtonClicked()));
connect(m_base->dataProcessingRunButton, SIGNAL(clicked()), this, SLOT(dataProcessingRunButtonClicked()));
@@ -815,6 +829,12 @@ void FPGAViewPart::process4BitInputChanges() {
}
void FPGAViewPart::process4BitOutputChanges() {
+ // Write m_4bitOutputValue to LEDs
+ m_base->group4BitOutputLED3->setState((m_4bitOutputValue & 0x08)?KLed::On:KLed::Off);
+ m_base->group4BitOutputLED2->setState((m_4bitOutputValue & 0x04)?KLed::On:KLed::Off);
+ m_base->group4BitOutputLED1->setState((m_4bitOutputValue & 0x02)?KLed::On:KLed::Off);
+ m_base->group4BitOutputLED0->setState((m_4bitOutputValue & 0x01)?KLed::On:KLed::Off);
+
// Write m_4bitOutputValue to label
m_base->group4BitOutputValueText->setText(TQString("0x%1").arg(m_4bitOutputValue, 0, 16));
}
@@ -862,13 +882,13 @@ void FPGAViewPart::process8BitInputChanges() {
m_base->group8BitInputLED0->setClickable(false);
}
- m_base->group8BitInputValueText->setText(TQString("0x%1").arg(m_8bitInputValue, 0, 16));
+ m_base->group8BitInputValueText->setText(TQString("").sprintf("0x%02x", m_8bitInputValue));
if (m_remoteInputModeEnabled) {
- m_base->group8BitInput->setTitle(i18n("8-Bit Input Values") + " [" + i18n("Remote Input Mode") + "]");
+ m_base->group8BitInput->setTitle(i18n("8-Bit Input (Switches)") + " [" + i18n("Remote Input Mode") + "]");
}
else {
- m_base->group8BitInput->setTitle(i18n("8-Bit Input Values") + " [" + i18n("Local Input Mode") + "]");
+ m_base->group8BitInput->setTitle(i18n("8-Bit Input (Switches)") + " [" + i18n("Local Input Mode") + "]");
}
}
@@ -895,7 +915,7 @@ void FPGAViewPart::process8BitOutputChanges() {
m_base->group8BitOutputLED1->setState((m_8bitOutputValue & 0x02)?KLed::On:KLed::Off);
m_base->group8BitOutputLED0->setState((m_8bitOutputValue & 0x01)?KLed::On:KLed::Off);
- m_base->group8BitOutputValueText->setText(TQString("0x%1").arg(m_8bitOutputValue, 0, 16));
+ m_base->group8BitOutputValueText->setText(TQString("").sprintf("0x%02x", m_8bitOutputValue));
}
void FPGAViewPart::process16BitInputChanges() {
@@ -905,7 +925,7 @@ void FPGAViewPart::process16BitInputChanges() {
void FPGAViewPart::process16BitOutputChanges() {
// Write m_16bitOutputValue to label
- m_base->group16BitOutputValue->setText(TQString("0x%1").arg(m_16bitOutputValue, 0, 16));
+ m_base->group16BitOutputValue->setText(TQString("").sprintf("0x%04x", m_16bitOutputValue));
}
void FPGAViewPart::processLCDOutputChanges() {
@@ -1012,6 +1032,7 @@ void FPGAViewPart::processLockouts() {
m_base->batchTestOutputFile->setEnabled(false);
m_base->batchTest16BitCheckBox->setEnabled(false);
m_base->batchTestRunButton->setEnabled(false);
+ m_base->groupGlobalControlResetButton->setEnabled(false);
}
else {
m_base->batchTestInputFile->setEnabled(true);
@@ -1035,6 +1056,7 @@ void FPGAViewPart::processLockouts() {
m_base->dataProcessingOutputFile->setEnabled(false);
m_base->dataProcessingGenerateValidationString->setEnabled(false);
m_base->dataProcessingRunButton->setEnabled(false);
+ m_base->groupGlobalControlResetButton->setEnabled(false);
}
else {
m_base->dataProcessingInputFile->setEnabled(true);
@@ -1047,6 +1069,7 @@ void FPGAViewPart::processLockouts() {
if ((m_connectionActiveAndValid == true) && (m_commHandlerMode == 0)) {
m_base->dataProcessingStatusLabel->setText(i18n("Ready"));
+ m_base->groupGlobalControlResetButton->setEnabled(!m_sendingUserLogicReset);
}
}
@@ -1125,6 +1148,11 @@ TQPtrList<TDEAction> FPGAViewPart::menuActionList() {
return m_menuActionList;
}
+void FPGAViewPart::groupGlobalControlResetButtonClicked() {
+ m_sendingUserLogicReset = true;
+ processLockouts();
+}
+
void FPGAViewPart::batchTestRunButtonClicked() {
m_commHandlerNextState = 0;
m_commHandlerNextMode = 1;
@@ -1166,6 +1194,17 @@ void FPGAViewPart::sendInputStatesToRemoteFPGA() {
data[13] = '\r';
m_socket->writeBlock(data, 14);
m_socket->writeBufferedData();
+
+ if (m_sendingUserLogicReset) {
+ // Send user logic reset request
+ data[0] = 'R';
+ data[1] = '\r';
+ m_socket->writeBlock(data, 2);
+ m_socket->writeBufferedData();
+
+ m_sendingUserLogicReset = false;
+ processLockouts();
+ }
}
}
diff --git a/clients/tde/src/part/fpgaview/part.h b/clients/tde/src/part/fpgaview/part.h
index 8262689..3fb2732 100644
--- a/clients/tde/src/part/fpgaview/part.h
+++ b/clients/tde/src/part/fpgaview/part.h
@@ -199,6 +199,7 @@ namespace RemoteLab
void processLCDOutputChanges();
void process7SegmentLEDOutputChanges();
+ void groupGlobalControlResetButtonClicked();
void batchTestRunButtonClicked();
void dataProcessingRunButtonClicked();
@@ -239,6 +240,7 @@ namespace RemoteLab
unsigned char m_7segDigit2OutputValue;
unsigned char m_7segDigit1OutputValue;
unsigned char m_7segDigit0OutputValue;
+ bool m_sendingUserLogicReset;
UnsignedIntegerList m_batchInputValueList;
UnsignedIntegerList m_batchOutputValueList;