diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-07 16:23:30 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-07 16:23:30 -0500 |
commit | fc455268a511d91113f59c04b50fa08b7c37b554 (patch) | |
tree | d61462c8a4496fa788875918dc4113162382962b /clients/tde/src/part/fpgaview | |
parent | 1b8ef84fb9f47b82d0da6fa6e1b9fe439bc6b05c (diff) | |
download | ulab-fc455268a511d91113f59c04b50fa08b7c37b554.tar.gz ulab-fc455268a511d91113f59c04b50fa08b7c37b554.zip |
Convert to frame based protocol
Finish FPGA programming server/client
Diffstat (limited to 'clients/tde/src/part/fpgaview')
-rw-r--r-- | clients/tde/src/part/fpgaview/part.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/clients/tde/src/part/fpgaview/part.cpp b/clients/tde/src/part/fpgaview/part.cpp index e4a56d4..7ac5dbf 100644 --- a/clients/tde/src/part/fpgaview/part.cpp +++ b/clients/tde/src/part/fpgaview/part.cpp @@ -1061,17 +1061,21 @@ void FPGAViewPart::finishConnectingToServer() { // Connection established! // Read magic number and proto version from server m_socket->processPendingData(); - if (m_socket->bytesAvailable() > 0) { + if (m_socket->canReadFrame()) { TQDataStream ds(m_socket); + ds.setPrintableData(true); TQ_UINT32 magicnum; TQ_UINT32 protover; ds >> magicnum; ds >> protover; + m_socket->clearFrameTail(); printf("[DEBUG] Got magic number %d and protocol version %d\n\r", magicnum, protover); fflush(stdout); // Request connection to backend server ds << TQString("SERV"); + m_socket->writeEndOfFrame(); ds << TQString(CLIENT_LIBRARY); + m_socket->writeEndOfFrame(); connToServerState = 3; } break; @@ -1080,8 +1084,10 @@ void FPGAViewPart::finishConnectingToServer() { m_socket->processPendingData(); if (m_socket->bytesAvailable() > 0) { TQDataStream ds(m_socket); + ds.setPrintableData(true); TQString response; ds >> response; + m_socket->clearFrameTail(); printf("[RAJA DEBUG 400.0] Got '%s' from the server\n\r", response.ascii()); fflush(stdout); if (response == "OK") { connToServerState = 4; @@ -1332,7 +1338,7 @@ void FPGAViewPart::updateDisplay() { KMessageBox::error(0, i18n("<qt>Unable to open selected batch output file</qt>"), i18n("Batch Failed")); m_commHandlerMode = 0; m_commHandlerState = 0; - m_base->batchTestProgressBar->setProgress(0); + m_base->batchTestProgressBar->reset(); processLockouts(); } } @@ -1340,7 +1346,7 @@ void FPGAViewPart::updateDisplay() { KMessageBox::error(0, i18n("<qt>Unable to open selected batch input file</qt>"), i18n("Batch Failed")); m_commHandlerMode = 0; m_commHandlerState = 0; - m_base->batchTestProgressBar->setProgress(0); + m_base->batchTestProgressBar->reset(); processLockouts(); } } @@ -1353,7 +1359,7 @@ void FPGAViewPart::updateDisplay() { m_batchOutputFile = NULL; m_commHandlerMode = 0; m_commHandlerState = 0; - m_base->batchTestProgressBar->setProgress(0); + m_base->batchTestProgressBar->reset(); processLockouts(); } else { @@ -1403,7 +1409,7 @@ void FPGAViewPart::updateDisplay() { m_batchOutputFile->close(); delete m_batchOutputFile; m_batchOutputFile = NULL; - m_base->batchTestProgressBar->setProgress(0); + m_base->batchTestProgressBar->reset(); m_commHandlerMode = 0; m_commHandlerState = 0; processLockouts(); @@ -1476,8 +1482,7 @@ void FPGAViewPart::updateDisplay() { KMessageBox::error(0, i18n("<qt>Unable to open selected data output file</qt>"), i18n("Data Processing Failed")); m_commHandlerMode = 0; m_commHandlerState = 0; - m_base->dataProcessingProgressBar->setTotalSteps(1); - m_base->dataProcessingProgressBar->setProgress(0); + m_base->dataProcessingProgressBar->reset(); processLockouts(); } } @@ -1485,8 +1490,7 @@ void FPGAViewPart::updateDisplay() { KMessageBox::error(0, i18n("<qt>Selected data input file exceeds the maximum allowed size of 16,384 bytes</qt>"), i18n("Data Processing Failed")); m_commHandlerMode = 0; m_commHandlerState = 0; - m_base->dataProcessingProgressBar->setTotalSteps(1); - m_base->dataProcessingProgressBar->setProgress(0); + m_base->dataProcessingProgressBar->reset(); processLockouts(); } } @@ -1494,8 +1498,7 @@ void FPGAViewPart::updateDisplay() { KMessageBox::error(0, i18n("<qt>Unable to open selected data input file</qt>"), i18n("Data Processing Failed")); m_commHandlerMode = 0; m_commHandlerState = 0; - m_base->dataProcessingProgressBar->setTotalSteps(1); - m_base->dataProcessingProgressBar->setProgress(0); + m_base->dataProcessingProgressBar->reset(); processLockouts(); } } @@ -1546,8 +1549,7 @@ void FPGAViewPart::updateDisplay() { m_dataOutputFile->close(); delete m_dataOutputFile; m_dataOutputFile = NULL; - m_base->dataProcessingProgressBar->setTotalSteps(1); - m_base->dataProcessingProgressBar->setProgress(0); + m_base->dataProcessingProgressBar->reset(); m_commHandlerMode = 0; m_commHandlerState = 0; processLockouts(); @@ -1558,8 +1560,7 @@ void FPGAViewPart::updateDisplay() { m_dataOutputFile->close(); delete m_dataOutputFile; m_dataOutputFile = NULL; - m_base->dataProcessingProgressBar->setTotalSteps(1); - m_base->dataProcessingProgressBar->setProgress(0); + m_base->dataProcessingProgressBar->reset(); m_commHandlerMode = 0; m_commHandlerState = 0; processLockouts(); |