|
66 | 66 | _log.exception("Problem importing turbineLiteDB") |
67 | 67 |
|
68 | 68 |
|
| 69 | +class sinter_AppError: |
| 70 | + si_OKAY = 0 |
| 71 | + si_SIMULATION_ERROR = 1 |
| 72 | + si_SIMULATION_WARNING = 2 |
| 73 | + si_COULD_NOT_CONTACT = 3 |
| 74 | + si_UNKNOWN_FIELD = 4 |
| 75 | + si_INPUT_ERROR = 5 |
| 76 | + si_SIMULATION_NOT_RUN = 6 |
| 77 | + si_SIMULATION_STOPPED = 7 # //The user stopped the simulation |
| 78 | + si_STOP_FAILED = 8 # //The user tried to stop the sim, but the stop timed out. Terminate should probably be called. |
| 79 | + si_NONCONVERGENCE_ERROR = 9 # //The user tried to stop the sim, but the stop timed out. Terminate should probably be called. |
| 80 | + si_COM_EXCEPTION = 100 |
| 81 | + |
| 82 | + |
69 | 83 | class TurbineInterfaceEx(foqusException): |
70 | 84 | """ |
71 | 85 | This is an exception class for FOQUS interaction with Turbine, it also tries |
@@ -262,11 +276,7 @@ def notification(self, url): |
262 | 276 |
|
263 | 277 | def getTurbineLiteDB(self): |
264 | 278 | if self.tldb is None: |
265 | | - db = turbineLiteDB.turbineLiteDB() |
266 | | - db.dbFile = os.path.join( |
267 | | - self.dat.foqusSettings.turbLiteHome, "Data/TurbineCompactDatabase.sdf" |
268 | | - ) |
269 | | - self.tldb = db |
| 279 | + self.tldb = turbineLiteDB.turbineLiteDB() |
270 | 280 | return self.tldb |
271 | 281 |
|
272 | 282 | def closeTurbineLiteDB(self): |
@@ -1072,11 +1082,13 @@ def monitorJob( |
1072 | 1082 | if ( |
1073 | 1083 | not allowWarnings |
1074 | 1084 | and state == "success" |
1075 | | - and res.get("Status", 1) == 2 |
| 1085 | + and res.get("Status", sinter_AppError.si_OKAY) |
| 1086 | + == sinter_AppError.si_SIMULATION_WARNING |
1076 | 1087 | ): |
1077 | 1088 | state = "error" |
1078 | 1089 | failure = state in failedStates |
1079 | 1090 | success = state in successStates |
| 1091 | + |
1080 | 1092 | # Check for the run start time instead of the state just |
1081 | 1093 | # in case job started and completed between checks |
1082 | 1094 | if not setupStart and state == "setup": |
|
0 commit comments