diff options
| author | Sebastien Braun | 2010-11-10 01:47:26 +0100 |
|---|---|---|
| committer | Sebastien Braun | 2010-11-10 01:47:26 +0100 |
| commit | b2c87269579df6cdd10e4419e0817d6d829a302e (patch) | |
| tree | 70d93ceb460dc34b851fe928eedd71a8fffe1f6a /src/core | |
| parent | Add Makefile to generate PDF from DIA figures and call pdflatex and (diff) | |
| parent | Merge branch 'master' of openslx.org:pvs (diff) | |
| download | pvs-b2c87269579df6cdd10e4419e0817d6d829a302e.tar.gz pvs-b2c87269579df6cdd10e4419e0817d6d829a302e.tar.xz pvs-b2c87269579df6cdd10e4419e0817d6d829a302e.zip | |
Merge branch 'master' of ssh://git.openslx.org/pvs
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/pvsConnectionManager.cpp | 76 |
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")) |
