|
|
|
@ -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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|