summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clients/tde/src/part/fpgaview/layout.ui24
-rw-r--r--clients/tde/src/part/fpgaview/part.cpp33
-rw-r--r--clients/tde/src/part/fpgaview/part.h1
-rw-r--r--lib/libtqtrla/src/tqtrla.cpp2
-rw-r--r--servers/auth_server_lin/src/auth_conn.cpp40
-rw-r--r--servers/auth_server_lin/src/auth_conn.h2
-rw-r--r--servers/fpga_server_lin/src/fpga_conn.cpp11
7 files changed, 94 insertions, 19 deletions
diff --git a/clients/tde/src/part/fpgaview/layout.ui b/clients/tde/src/part/fpgaview/layout.ui
index 32cfc90..b2b62a4 100644
--- a/clients/tde/src/part/fpgaview/layout.ui
+++ b/clients/tde/src/part/fpgaview/layout.ui
@@ -257,8 +257,8 @@
</property>
<property name="sizeHint">
<size>
- <width>20</width>
- <height>20</height>
+ <width>0</width>
+ <height>0</height>
</size>
</property>
</spacer>
@@ -279,8 +279,8 @@
</property>
<property name="sizeHint">
<size>
- <width>20</width>
- <height>20</height>
+ <width>0</width>
+ <height>0</height>
</size>
</property>
</spacer>
@@ -316,8 +316,8 @@
</property>
<property name="sizeHint">
<size>
- <width>20</width>
- <height>20</height>
+ <width>0</width>
+ <height>0</height>
</size>
</property>
</spacer>
@@ -338,8 +338,8 @@
</property>
<property name="sizeHint">
<size>
- <width>20</width>
- <height>20</height>
+ <width>0</width>
+ <height>0</height>
</size>
</property>
</spacer>
@@ -529,8 +529,8 @@
</property>
<property name="sizeHint">
<size>
- <width>20</width>
- <height>20</height>
+ <width>0</width>
+ <height>0</height>
</size>
</property>
</spacer>
@@ -767,8 +767,8 @@
</property>
<property name="sizeHint">
<size>
- <width>20</width>
- <height>20</height>
+ <width>0</width>
+ <height>0</height>
</size>
</property>
</spacer>
diff --git a/clients/tde/src/part/fpgaview/part.cpp b/clients/tde/src/part/fpgaview/part.cpp
index 1103f1b..87ac05a 100644
--- a/clients/tde/src/part/fpgaview/part.cpp
+++ b/clients/tde/src/part/fpgaview/part.cpp
@@ -854,20 +854,42 @@ void FPGAViewPart::processLockouts() {
}
}
+ // Interface mode switching handlers
if (m_interfaceMode == BasicInterfaceMode) {
m_modeBasicEnabled->setChecked(true);
m_modeIntermediateEnabled->setChecked(false);
m_modeAdvancedEnabled->setChecked(false);
+
+ m_base->groupLCDDisplay->show();
+ m_base->groupLEDDisplay->hide();
+ m_base->groupBatchTest->hide();
+ m_base->groupDataProcessing->hide();
+ m_base->groupInputImage->hide();
+ m_base->groupOutputImage->hide();
}
if (m_interfaceMode == IntermediateInterfaceMode) {
m_modeBasicEnabled->setChecked(false);
m_modeIntermediateEnabled->setChecked(true);
m_modeAdvancedEnabled->setChecked(false);
+
+ m_base->groupLCDDisplay->show();
+ m_base->groupLEDDisplay->show();
+ m_base->groupBatchTest->show();
+ m_base->groupDataProcessing->hide();
+ m_base->groupInputImage->hide();
+ m_base->groupOutputImage->hide();
}
if (m_interfaceMode == AdvancedInterfaceMode) {
m_modeBasicEnabled->setChecked(false);
m_modeIntermediateEnabled->setChecked(false);
m_modeAdvancedEnabled->setChecked(true);
+
+ m_base->groupLCDDisplay->show();
+ m_base->groupLEDDisplay->show();
+ m_base->groupBatchTest->show();
+ m_base->groupDataProcessing->show();
+ m_base->groupInputImage->show();
+ m_base->groupOutputImage->show();
}
if ((m_base->batchTestInputFile->url() != "") && (m_base->batchTestOutputFile->url() != "") && (m_commHandlerMode == 0) && (m_connectionActiveAndValid == true)) {
@@ -918,19 +940,26 @@ void FPGAViewPart::processLockouts() {
}
}
+void FPGAViewPart::resizeToHint() {
+ resize(widget()->sizeHint());
+}
+
void FPGAViewPart::switchToBasicMode() {
m_interfaceMode = BasicInterfaceMode;
processLockouts();
+ TQTimer::singleShot(0, this, SLOT(resizeToHint()));
}
void FPGAViewPart::switchToIntermediateMode() {
m_interfaceMode = IntermediateInterfaceMode;
processLockouts();
+ TQTimer::singleShot(0, this, SLOT(resizeToHint()));
}
void FPGAViewPart::switchToAdvancedMode() {
m_interfaceMode = AdvancedInterfaceMode;
processLockouts();
+ TQTimer::singleShot(0, this, SLOT(resizeToHint()));
}
void FPGAViewPart::connectionClosed() {
@@ -1039,8 +1068,12 @@ printf("[RAJA DEBUG 400.0] Got '%s' from the server\n\r", response.ascii()); ffl
connToServerConnecting = false;
connect(m_socket, SIGNAL(readyRead()), m_socket, SLOT(processPendingData()));
connect(m_socket, SIGNAL(newDataReceived()), this, SLOT(updateDisplay()));
+ m_tickerState = 0;
+ m_commHandlerState = 0;
+ m_commHandlerMode = 0;
m_updateTimer->start(FPGA_COMM_TIMEOUT_MS, FALSE);
processLockouts();
+ updateDisplay();
return;
}
else if (response == "ERRNOCONN") {
diff --git a/clients/tde/src/part/fpgaview/part.h b/clients/tde/src/part/fpgaview/part.h
index 8ed087f..b443aba 100644
--- a/clients/tde/src/part/fpgaview/part.h
+++ b/clients/tde/src/part/fpgaview/part.h
@@ -156,6 +156,7 @@ namespace RemoteLab
private slots:
void postInit();
+ void resizeToHint();
void updateDisplay();
void processLockouts();
void connectionClosed();
diff --git a/lib/libtqtrla/src/tqtrla.cpp b/lib/libtqtrla/src/tqtrla.cpp
index a9bfddf..6320f3e 100644
--- a/lib/libtqtrla/src/tqtrla.cpp
+++ b/lib/libtqtrla/src/tqtrla.cpp
@@ -63,7 +63,7 @@ namespace KParts
void RemoteInstrumentPart::resize(TQSize size) {
TQWidget* parentWidget = dynamic_cast<TQWidget*>(parent());
if (parentWidget) {
- parentWidget->resize(size);
+ parentWidget->setFixedSize(size);
}
}
diff --git a/servers/auth_server_lin/src/auth_conn.cpp b/servers/auth_server_lin/src/auth_conn.cpp
index 29b8501..23d0336 100644
--- a/servers/auth_server_lin/src/auth_conn.cpp
+++ b/servers/auth_server_lin/src/auth_conn.cpp
@@ -131,7 +131,10 @@ int AuthSocket::initiateKerberosHandshake() {
}
}
-void AuthSocket::servLoop() {
+int AuthSocket::servLoop() {
+ bool transferred_data;
+
+ transferred_data = false;
if (m_servActive) {
TQString command;
TQDataStream ds(this);
@@ -159,6 +162,7 @@ void AuthSocket::servLoop() {
delete m_servClientTimeout;
m_servClientTimeout = NULL;
}
+ transferred_data = true;
m_servState = 1;
}
break;
@@ -180,6 +184,7 @@ void AuthSocket::servLoop() {
krbstat = m_servClientSocket->kerberosStatus();
if ((krbstat == TDEKerberosClientSocket::KerberosInitializing) || (krbstat == TDEKerberosClientSocket::KerberosInUse)) {
if (krbstat == TDEKerberosClientSocket::KerberosInUse) {
+ transferred_data = true;
m_servState = 3;
}
}
@@ -205,6 +210,7 @@ void AuthSocket::servLoop() {
clientDS >> server_reply;
if (server_reply == "OK") {
ds << TQString("OK");
+ transferred_data = true;
m_servState = 4;
}
else {
@@ -245,10 +251,12 @@ void AuthSocket::servLoop() {
if (canReadData()) {
reclen = readBlock(ba.data(), 8192);
m_servClientSocket->writeBlock(ba.data(), reclen);
+ transferred_data = true;
}
if (m_servClientSocket->canReadData()) {
reclen = m_servClientSocket->readBlock(ba.data(), 8192);
writeBlock(ba.data(), reclen);
+ transferred_data = true;
}
}
else {
@@ -260,21 +268,40 @@ void AuthSocket::servLoop() {
break;
}
}
+
+ if (transferred_data) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
}
void AuthSocket::commandLoop() {
+ bool transferred_data;
+
if (m_servActive) {
- servLoop();
- if (m_loopTimer) m_loopTimer->start(0, TRUE);
+ transferred_data = false;
+ if (servLoop() == 1) {
+ transferred_data = true;
+ }
+ if (transferred_data) {
+ if (m_loopTimer) m_loopTimer->start(0, TRUE);
+ }
+ else {
+ if (m_loopTimer) m_loopTimer->start(100, TRUE);
+ }
return;
}
m_criticalSection++;
try {
+ transferred_data = false;
if (state() == TQSocket::Connected) {
if (canReadData()) {
TQString command;
TQDataStream ds(this);
+ transferred_data = true;
ds >> command;
if (command != "") {
@@ -432,7 +459,12 @@ void AuthSocket::commandLoop() {
}
m_criticalSection--;
- if (m_loopTimer) m_loopTimer->start(0, TRUE);
+ if (transferred_data) {
+ if (m_loopTimer) m_loopTimer->start(0, TRUE);
+ }
+ else {
+ if (m_loopTimer) m_loopTimer->start(100, TRUE);
+ }
return;
}
}
diff --git a/servers/auth_server_lin/src/auth_conn.h b/servers/auth_server_lin/src/auth_conn.h
index 08f8072..ca938f6 100644
--- a/servers/auth_server_lin/src/auth_conn.h
+++ b/servers/auth_server_lin/src/auth_conn.h
@@ -58,7 +58,7 @@ class AuthSocket : public TDEKerberosServerSocket
int connectToDatabase();
void connectionClosedHandler();
void commandLoop();
- void servLoop();
+ int servLoop();
private:
int line;
diff --git a/servers/fpga_server_lin/src/fpga_conn.cpp b/servers/fpga_server_lin/src/fpga_conn.cpp
index 6f4cecf..3acd499 100644
--- a/servers/fpga_server_lin/src/fpga_conn.cpp
+++ b/servers/fpga_server_lin/src/fpga_conn.cpp
@@ -161,13 +161,16 @@ int FPGASocket::setupSerial() {
void FPGASocket::commandLoop() {
int cc;
char buffer[10000];
+ bool transferred_data;
m_criticalSection++;
try {
+ transferred_data = false;
if (state() == TQSocket::Connected) {
cc = read(m_fd_tty, buffer, 10000);
if (cc > 0) {
writeBlock(buffer, cc);
+ transferred_data = true;
printf("[DEBUG] Got %d bytes from the serial port\n\r", cc); fflush(stdout);
}
if (canReadData()) {
@@ -176,12 +179,18 @@ void FPGASocket::commandLoop() {
if (write(m_fd_tty, buffer, cc) < 0) {
// ERROR
}
+ transferred_data = true;
printf("[DEBUG] Got %d bytes from the network interface\n\r", cc); fflush(stdout);
}
}
}
m_criticalSection--;
- if (m_loopTimer) m_loopTimer->start(0, TRUE);
+ if (transferred_data) {
+ if (m_loopTimer) m_loopTimer->start(0, TRUE);
+ }
+ else {
+ if (m_loopTimer) m_loopTimer->start(100, TRUE);
+ }
return;
}
catch (...) {