summaryrefslogtreecommitdiffstats
path: root/src/core/pvsConnectionManager.cpp
diff options
context:
space:
mode:
authorSebastien Braun2010-11-10 01:47:26 +0100
committerSebastien Braun2010-11-10 01:47:26 +0100
commitb2c87269579df6cdd10e4419e0817d6d829a302e (patch)
tree70d93ceb460dc34b851fe928eedd71a8fffe1f6a /src/core/pvsConnectionManager.cpp
parentAdd Makefile to generate PDF from DIA figures and call pdflatex and (diff)
parentMerge branch 'master' of openslx.org:pvs (diff)
downloadpvs-b2c87269579df6cdd10e4419e0817d6d829a302e.tar.gz
pvs-b2c87269579df6cdd10e4419e0817d6d829a302e.tar.xz
pvs-b2c87269579df6cdd10e4419e0817d6d829a302e.zip
Merge branch 'master' of ssh://git.openslx.org/pvs
Diffstat (limited to 'src/core/pvsConnectionManager.cpp')
-rw-r--r--src/core/pvsConnectionManager.cpp76
1 files changed, 56 insertions, 20 deletions
diff --git a/src/core/pvsConnectionManager.cpp b/src/core/pvsConnectionManager.cpp
index db302c4..d1442dd 100644
--- a/src/core/pvsConnectionManager.cpp
+++ b/src/core/pvsConnectionManager.cpp
@@ -226,33 +226,69 @@ void PVSConnectionManager::onCommand(PVSMsg command)
QString id = int2String(command.getSndID());
if (message.startsWith("START"))
{
- QString msgcontent = message.remove(0,6);
- if (msgcontent.startsWith("ERROR"))
- {
- ConsoleLog writeError("[Client: " + id + ", PROCESS] could not start: " +msgcontent.remove(0,6));
- }
- else
+ message.remove(0,6);
+ if (message.startsWith("ERROR"))
{
- //ConsoleLog writeLine(QString("[Client: " + id + ", PROCESS] started: " +msgcontent));
+ int e = string2Int(message.remove(0,6));
+ message.remove(0,2);
+ switch (e)
+ {
+ case 0:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] could not start: "+message+" is missing or insufficient permissions");
+ break;
+ case 1:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" crashed");
+ break;
+ case 2:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" timed out");
+ break;
+ case 3:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" read error");
+ break;
+ case 4:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" write error");
+ break;
+ default:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+": unknown error");
+ break;
+ }
}
}
- if (message.startsWith("STOP"))
- {
- QString msgcontent = message.remove(0,5);
- if (msgcontent.startsWith("ERROR"))
- {
- ConsoleLog writeError("[Client: " + id + ", PROCESS] could not stop: " +msgcontent.remove(0,6));
- }
- else
- {
- //ConsoleLog writeLine(QString("[Client: " + id + ", PROCESS] stopped: " +msgcontent));
- }
+ else if (message.startsWith("STOP"))
+ {
+ message.remove(0,5);
+ if (message.startsWith("ERROR"))
+ {
+ int e = string2Int(message.remove(0,6));
+ message.remove(0,2);
+ switch (e)
+ {
+ case 0:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] could not stop: "+message+" is missing or insufficient permissions");
+ break;
+ case 1:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" crashed");
+ break;
+ case 2:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" timed out");
+ break;
+ case 3:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" read error");
+ break;
+ case 4:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" write error");
+ break;
+ default:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+": unknown error");
+ break;
+ }
+ }
}
- if (message.startsWith("SHOW"))
+ else if (message.startsWith("SHOW"))
{
QString msgcontent = message.remove(0,5);
if (msgcontent.startsWith("ERROR"))
- ConsoleLog writeError("[Client: " + id + ", PROCESS] could not show processes: " +msgcontent.remove(0,6));
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] could not show processes.");
else if (msgcontent.startsWith("clear"))
tmp->clearProcessesVector();
else if (msgcontent.startsWith("finished"))