[chronojump] Better debug for camera processes
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Better debug for camera processes
- Date: Fri, 16 Nov 2018 16:08:59 +0000 (UTC)
commit c3aed1e87aeae1bf140d1777d78396689f12c929
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Nov 16 17:07:46 2018 +0100
Better debug for camera processes
src/executeProcess.cs | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
---
diff --git a/src/executeProcess.cs b/src/executeProcess.cs
index c954d4ec..a65786b6 100644
--- a/src/executeProcess.cs
+++ b/src/executeProcess.cs
@@ -179,6 +179,27 @@ class ExecuteProcess
return true;
}
+ /*
+ * xungo pq sembla que crea un nou process i l'associa amb el que estem avaluant
+ *
+ public static bool IsRunning4 (int processID)
+ {
+ try {
+ Process p = Process.GetProcessById(processID);
+ if(p == null)
+ {
+ LogB.Information("process does not exist (null)");
+ return false;
+ }
+ } catch {
+ LogB.Information("process does not exist (catch)");
+ return false;
+ }
+
+ LogB.Information("process is running!");
+ return true;
+ }
+ */
/*
* This is the best method because it does not need the process,
* note that process maybe is null
@@ -186,6 +207,15 @@ class ExecuteProcess
*/
public static bool IsRunning3 (int processID, string executable)
{
+ //Debug
+ Process[] allThisMachine = Process.GetProcesses();
+ LogB.Information("All processes in this machine:");
+ foreach(Process p in allThisMachine)
+ LogB.Information(p.ToString());
+
+ //Debug
+ LogB.Information("LastPartOfPath of executable: " + Util.GetLastPartOfPath(executable));
+
Process[] pNameArray = Process.GetProcessesByName(Util.GetLastPartOfPath(executable));
if (pNameArray.Length == 0)
return false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]