diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-06 01:49:44 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-06 01:49:44 -0500 |
commit | 9a3bfffc76e52b18a952016a1793af57b7d92cd4 (patch) | |
tree | 1cfef56e86ea6b85daa0480d94ad160fbc751b96 /clients/tde/src/part | |
parent | 7bd40e9b56445d509cddebfff79062770708b0e6 (diff) | |
download | ulab-9a3bfffc76e52b18a952016a1793af57b7d92cd4.tar.gz ulab-9a3bfffc76e52b18a952016a1793af57b7d92cd4.zip |
Fix a number of problems and add skeleton FPGA prog server
Diffstat (limited to 'clients/tde/src/part')
-rw-r--r-- | clients/tde/src/part/fpgaprogram/Makefile.am | 8 | ||||
-rw-r--r-- | clients/tde/src/part/fpgaprogram/layout.ui | 19 | ||||
-rw-r--r-- | clients/tde/src/part/fpgaprogram/part.cpp | 37 | ||||
-rw-r--r-- | clients/tde/src/part/fpgaprogram/part.h | 2 | ||||
-rw-r--r-- | clients/tde/src/part/fpgaview/part.cpp | 27 |
5 files changed, 31 insertions, 62 deletions
diff --git a/clients/tde/src/part/fpgaprogram/Makefile.am b/clients/tde/src/part/fpgaprogram/Makefile.am index 63fdf0f..e333ce1 100644 --- a/clients/tde/src/part/fpgaprogram/Makefile.am +++ b/clients/tde/src/part/fpgaprogram/Makefile.am @@ -3,7 +3,7 @@ KDE_CXXFLAGS = $(USE_EXCEPTIONS) METASOURCES = AUTO # Part -kde_module_LTLIBRARIES = libremotelab_fpgaviewer.la -libremotelab_fpgaviewer_la_LIBADD = ../../widgets/libtracewidget.la ../../widgets/libfloatspinbox.la $(LIB_KFILE) $(LIB_KPARTS) $(LIB_TDEUI) $(LIB_QT) -ltdekrbsocket -ltqtrla -libremotelab_fpgaviewer_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) $(LIB_TDECORE) $(LIB_TDEUI) -lkio -ltdefx -libremotelab_fpgaviewer_la_SOURCES = part.cpp layout.ui +kde_module_LTLIBRARIES = libremotelab_fpgaprogrammer.la +libremotelab_fpgaprogrammer_la_LIBADD = ../../widgets/libtracewidget.la ../../widgets/libfloatspinbox.la $(LIB_KFILE) $(LIB_KPARTS) $(LIB_TDEUI) $(LIB_QT) -ltdekrbsocket -ltqtrla +libremotelab_fpgaprogrammer_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) $(LIB_TDECORE) $(LIB_TDEUI) -lkio -ltdefx +libremotelab_fpgaprogrammer_la_SOURCES = part.cpp layout.ui diff --git a/clients/tde/src/part/fpgaprogram/layout.ui b/clients/tde/src/part/fpgaprogram/layout.ui index 985acfe..3f528bb 100644 --- a/clients/tde/src/part/fpgaprogram/layout.ui +++ b/clients/tde/src/part/fpgaprogram/layout.ui @@ -21,7 +21,7 @@ <cstring>groupFPGAProgram</cstring> </property> <property name="title"> - <string>FPGA Viewer</string> + <string>Setup</string> </property> <grid> <property name="name"> @@ -51,7 +51,7 @@ <cstring>programRunButton</cstring> </property> <property name="text"> - <cstring>Download Program</cstring> + <cstring>Upload File</cstring> </property> </widget> <widget class="TQProgressBar" row="2" column="0" colspan="3"> @@ -69,6 +69,21 @@ </widget> </grid> </widget> + <widget class="TQGroupBox" row="1" column="0"> + <property name="name"> + <cstring>groupProgrammingLog</cstring> + </property> + <property name="title"> + <string>Log</string> + </property> + <grid> + <widget class="KTextEdit" row="0" column="0" colspan="0"> + <property name="name"> + <cstring>programmingLogBox</cstring> + </property> + </widget> + </grid> + </widget> </grid> </widget> <includes> diff --git a/clients/tde/src/part/fpgaprogram/part.cpp b/clients/tde/src/part/fpgaprogram/part.cpp index bf7e46a..b51c39a 100644 --- a/clients/tde/src/part/fpgaprogram/part.cpp +++ b/clients/tde/src/part/fpgaprogram/part.cpp @@ -137,7 +137,7 @@ void FPGAProgramPart::connectionClosed() { } void FPGAProgramPart::postInit() { - connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateDisplay())); + connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(mainEventLoop())); } bool FPGAProgramPart::openURL(const KURL &url) { @@ -237,44 +237,21 @@ printf("[RAJA DEBUG 400.0] Got '%s' from the server\n\r", response.ascii()); ffl connToServerState = 3; connToServerConnecting = false; connect(m_socket, SIGNAL(readyRead()), m_socket, SLOT(processPendingData())); - connect(m_socket, SIGNAL(newDataReceived()), this, SLOT(updateDisplay())); + connect(m_socket, SIGNAL(newDataReceived()), this, SLOT(mainEventLoop())); m_tickerState = 0; m_commHandlerState = 0; m_commHandlerMode = 0; m_updateTimer->start(FPGA_COMM_TIMEOUT_MS, FALSE); processLockouts(); - updateDisplay(); - return; - } - else if (response == "ERRNOCONN") { - connToServerState = -1; - connToServerConnecting = false; - disconnectFromServer(); - KMessageBox::error(0, i18n("<qt>Unable to establish connection with backend server<p>Please verify that you are currently connected to a workspace</qt>"), i18n("Connection Failed")); - close(); - return; - } - else if (response == "ERRNOTAVL") { - connToServerState = -1; - connToServerConnecting = false; - disconnectFromServer(); - KMessageBox::error(0, i18n("<qt>The backend server is not available at this time<p>Please try a different workspace, or try again later</qt>"), i18n("Connection Failed")); - close(); - return; - } - else if (response == "ERRNOSERV") { - connToServerState = -1; - connToServerConnecting = false; - disconnectFromServer(); - KMessageBox::error(0, i18n("<qt>The active laboratory workspace does not support the requested service</qt>"), i18n("Service Unavailable")); - close(); + mainEventLoop(); return; } else { + TQStringList errorStrings = textForServerError(response); connToServerState = -1; connToServerConnecting = false; disconnectFromServer(); - KMessageBox::error(0, i18n("<qt>Unable to establish connection with remote server</qt>"), i18n("Connection Failed")); + KMessageBox::error(0, errorStrings[0], errorStrings[1]); close(); return; } @@ -318,11 +295,11 @@ void FPGAProgramPart::programRunButtonClicked() { while (m_socket->bytesAvailable() > 0) { \ m_socket->readBlock(data, 64); \ } \ - setStatusMessage(i18n("Debug interface timeout, still waiting for data. Please verify that the FPGA is properly configured.")); \ + setStatusMessage(i18n("Server ping timeout. Please verify the status of your network connection.")); \ m_updateTimer->start(FPGA_COMM_TIMEOUT_MS, FALSE); \ return; -void FPGAProgramPart::updateDisplay() { +void FPGAProgramPart::mainEventLoop() { m_updateTimer->stop(); TQDataStream ds(m_socket); diff --git a/clients/tde/src/part/fpgaprogram/part.h b/clients/tde/src/part/fpgaprogram/part.h index a663b11..f254cbc 100644 --- a/clients/tde/src/part/fpgaprogram/part.h +++ b/clients/tde/src/part/fpgaprogram/part.h @@ -67,7 +67,7 @@ namespace RemoteLab private slots: void postInit(); void resizeToHint(); - void updateDisplay(); + void mainEventLoop(); void processLockouts(); void connectionClosed(); void disconnectFromServer(); diff --git a/clients/tde/src/part/fpgaview/part.cpp b/clients/tde/src/part/fpgaview/part.cpp index 87ac05a..755f25c 100644 --- a/clients/tde/src/part/fpgaview/part.cpp +++ b/clients/tde/src/part/fpgaview/part.cpp @@ -1076,35 +1076,12 @@ printf("[RAJA DEBUG 400.0] Got '%s' from the server\n\r", response.ascii()); ffl updateDisplay(); return; } - else if (response == "ERRNOCONN") { - connToServerState = -1; - connToServerConnecting = false; - disconnectFromServer(); - KMessageBox::error(0, i18n("<qt>Unable to establish connection with backend server<p>Please verify that you are currently connected to a workspace</qt>"), i18n("Connection Failed")); - close(); - return; - } - else if (response == "ERRNOTAVL") { - connToServerState = -1; - connToServerConnecting = false; - disconnectFromServer(); - KMessageBox::error(0, i18n("<qt>The backend server is not available at this time<p>Please try a different workspace, or try again later</qt>"), i18n("Connection Failed")); - close(); - return; - } - else if (response == "ERRNOSERV") { - connToServerState = -1; - connToServerConnecting = false; - disconnectFromServer(); - KMessageBox::error(0, i18n("<qt>The active laboratory workspace does not support the requested service</qt>"), i18n("Service Unavailable")); - close(); - return; - } else { + TQStringList errorStrings = textForServerError(response); connToServerState = -1; connToServerConnecting = false; disconnectFromServer(); - KMessageBox::error(0, i18n("<qt>Unable to establish connection with remote server</qt>"), i18n("Connection Failed")); + KMessageBox::error(0, errorStrings[0], errorStrings[1]); close(); return; } |