Skip to content

Commit a49eff5

Browse files
authored
Merge pull request #1271 from CCSI-Toolset/database_programdata-2025.09.03
Database programdata 2025.09.03
2 parents b5e4d18 + 1216596 commit a49eff5

5 files changed

Lines changed: 30 additions & 18 deletions

File tree

docs/source/chapt_sinter/tutorial/gproms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ configuration can be done.
283283
Save Location** at the top of the window. This is where the Sinter
284284
configuration file is saved. The system suggests a file location and
285285
name. The user should confirm this is the intended location of the
286-
files to not accidently overwrite other files. Enter the remaining
286+
files to not accidentally overwrite other files. Enter the remaining
287287
fields to provide the meta-data to describe the simulation that was
288288
just opened and then click **Next**.
289289

foqus_lib/core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,12 @@ class TurbineLiteDependencyTracker(WindowsPackageDependencyTracker):
204204

205205
package_name = "TurbineLite"
206206
install_path = "C:/Program Files/Turbine/Lite"
207+
database_path = "C:/ProgramData/Turbine/Data/TurbineCompactDatabase.sdf"
207208

208209
@property
209210
def path(self):
210211
return self.install_path
212+
213+
@property
214+
def database(self):
215+
return self.database_path

foqus_lib/foqus.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ def main(args_to_parse=None):
406406
fs = generalSettings() # foqus settings
407407
fs.load(logging=False)
408408
db = turbineLiteDB()
409-
db.dbFile = os.path.join(fs.turbLiteHome, "Data/TurbineCompactDatabase.sdf")
410409
print("terminating consumer {0}".format(args.terminateConsumer))
411410
db.consumer_status(args.terminateConsumer, "terminate")
412411
sys.exit(0)
@@ -423,7 +422,6 @@ def main(args_to_parse=None):
423422
fs = generalSettings() # foqus settings
424423
fs.load(logging=False)
425424
db = turbineLiteDB()
426-
db.dbFile = os.path.join(fs.turbLiteHome, "Data/TurbineCompactDatabase.sdf")
427425
print(
428426
"Adding application '{0}' to TurbineLite database".format(
429427
args.addTurbineApp
@@ -626,10 +624,7 @@ def main(args_to_parse=None):
626624
signal.signal(signal.SIGINT, signal_handler)
627625
# Register consumer TurbineLite DB
628626
db = turbineLiteDB()
629-
db.dbFile = os.path.join(
630-
dat.foqusSettings.turbLiteHome, "Data/TurbineCompactDatabase.sdf"
631-
)
632-
_logger.info("TurbineLite Database:\n {0}".format(db.dbFile))
627+
_logger.info("TurbineLite Database:\n {0}".format(db.database))
633628
# add 'foqus' app to TurbineLite DB if not already there
634629
db.add_new_application("foqus")
635630
# register the consumer in the database

foqus_lib/framework/sim/turbineConfiguration.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@
6666
_log.exception("Problem importing turbineLiteDB")
6767

6868

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+
6983
class TurbineInterfaceEx(foqusException):
7084
"""
7185
This is an exception class for FOQUS interaction with Turbine, it also tries
@@ -262,11 +276,7 @@ def notification(self, url):
262276

263277
def getTurbineLiteDB(self):
264278
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()
270280
return self.tldb
271281

272282
def closeTurbineLiteDB(self):
@@ -1072,11 +1082,13 @@ def monitorJob(
10721082
if (
10731083
not allowWarnings
10741084
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
10761087
):
10771088
state = "error"
10781089
failure = state in failedStates
10791090
success = state in successStates
1091+
10801092
# Check for the run start time instead of the state just
10811093
# in case job started and completed between checks
10821094
if not setupStart and state == "setup":

foqus_lib/framework/sim/turbineLiteDB.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ class turbineLiteDB:
5959
def __init__(self, close_after=True):
6060
self.conn = None
6161
self.close_after = close_after
62-
self.dbFile = os.path.join(
63-
core.TurbineLiteDependencyTracker.load().path,
64-
"/Data/TurbineCompactDatabase.sdf",
65-
)
6662

6763
def __del__(self):
6864
self.closeConnection()
6965

66+
@property
67+
def database(self):
68+
return core.TurbineLiteDependencyTracker.load().database
69+
7070
def connectionString(self):
7171
prov = "Provider=Microsoft.SQLSERVER.CE.OLEDB.4.0;"
72-
data = "Data Source={0};".format(self.dbFile)
72+
data = "Data Source={0};".format(self.database)
7373
return " ".join([prov, data])
7474

7575
def getConnection(self, rc=0):

0 commit comments

Comments
 (0)