diff options
Diffstat (limited to 'clients/tde/src/part/fpgaprogram/part.cpp')
-rw-r--r-- | clients/tde/src/part/fpgaprogram/part.cpp | 37 |
1 files changed, 7 insertions, 30 deletions
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); |