diff options
| author | Fabian Schillinger | 2010-11-05 02:03:45 +0100 |
|---|---|---|
| committer | Fabian Schillinger | 2010-11-05 02:03:45 +0100 |
| commit | 98d31dde1d8c220bd3602d4751c24508a54e3fab (patch) | |
| tree | 3921ed97778912a00263728dab105f35f6d1f8e6 /src/core/pvsConnectionManager.cpp | |
| parent | [PVSMGRTOUCH] resetall bug fixed (diff) | |
| download | pvs-98d31dde1d8c220bd3602d4751c24508a54e3fab.tar.gz pvs-98d31dde1d8c220bd3602d4751c24508a54e3fab.tar.xz pvs-98d31dde1d8c220bd3602d4751c24508a54e3fab.zip | |
Process start/stop/view functionality
Cleanup
write to logfiles if start/stop/view of processes failed
added some prompts
stop more then one process at the same time
Diffstat (limited to 'src/core/pvsConnectionManager.cpp')
| -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")) |
