a/trunk/cforge/cforge/Helper.cs | b/trunk/cforge/cforge/Helper.cs | ||
---|---|---|---|
... |
... |
||
97 | } |
97 | } |
98 | 98 | ||
99 | #endregion |
99 | #endregion |
100 | 100 | ||
101 | 101 | ||
102 | public static bool EasyAttachEnabled() |
||
103 | { |
||
104 | try |
||
105 | { |
||
106 | String path = GetCFORGEAssemblyPath(); |
||
107 | String Debugfile = Path.Combine(Path.GetDirectoryName(path), "debug"); |
||
108 | if (File.Exists(Debugfile)) |
||
109 | return true; |
||
110 | } |
||
111 | catch |
||
112 | { |
||
113 | |||
114 | } |
||
115 | return false; |
||
116 | } |
||
117 | |||
102 | /// <summary> |
118 | /// <summary> |
103 | /// Function to retrieve the location of the currenty assembly (cforge.exe). |
119 | /// Function to retrieve the location of the currenty assembly (cforge.exe). |
104 | /// This should be located in the CODESYS installation subfolder "CFORGE" |
120 | /// This should be located in the CODESYS installation subfolder "CFORGE" |
105 | /// </summary> |
121 | /// </summary> |
106 | /// <returns>full path to cforge.exe</returns> |
122 | /// <returns>full path to cforge.exe</returns> |
... |
... |
||
251 | } |
267 | } |
252 | catch (Exception ex) |
268 | catch (Exception ex) |
253 | { |
269 | { |
254 | Console.WriteLine(); |
270 | Console.WriteLine(); |
255 | 271 | ||
256 | Console.WriteLine("[Exception] command " + command + ".py caused an exception: " + ex.Message); |
272 | Console.WriteLine("[Exception] command " + command + ".py caused an exception: " ); |
257 | 273 | ||
258 | ExceptionOperations eo = engine.GetService<ExceptionOperations>(); |
274 | ExceptionOperations eo = engine.GetService<ExceptionOperations>(); |
259 | string error = eo.FormatException(ex); |
275 | string error = eo.FormatException(ex); |
260 | Console.WriteLine(error); |
276 | Console.WriteLine(error); |
261 | 277 |