Commit b517c38c authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Solver: Mage: Add mage fake 7.

No related merge requests found
Pipeline #54430 passed with stages
in 3 minutes and 58 seconds
Showing with 54 additions and 18 deletions
+54 -18
......@@ -59,6 +59,7 @@ dl-mage8-linux:
artifacts:
paths:
- mage8-linux/mage
- mage8-linux/mage_as7
- mage8-linux/mage_extraire
- mage8-linux/mailleurTT
- mage8-linux/libbief.so
......@@ -77,6 +78,7 @@ dl-mage8-windows:
artifacts:
paths:
- mage8-windows/mage.exe
- mage8-windows/mage_as7.exe
- mage8-windows/mage_extraire.exe
- mage8-windows/mailleurTT.exe
- mage8-windows/libbief.dll
......
......@@ -41,6 +41,7 @@ copy /y ..\src\motd.txt pamhyr\_internal
rem MAGE
mkdir pamhyr\mage8
copy /y ..\mage8-windows\mage.exe pamhyr\mage8\
copy /y ..\mage8-windows\mage_as7.exe pamhyr\mage8\
copy /y ..\mage8-windows\mage_extraire.exe pamhyr\mage8\
copy /y ..\mage8-windows\mailleurTT.exe pamhyr\mage8\
copy /y ..\mage8-windows\libbief.dll pamhyr\mage8\
......
......@@ -876,6 +876,16 @@ class Mage8(Mage):
return files
def export_func_dict(self):
return [
self._export_ST, self._export_PAR,
self._export_NET, self._export_bound_cond,
self._export_RUG, self._export_INI,
self._export_SIN, self._export_VAR,
self._export_CAS, self._export_DEV,
self.export_additional_files,
]
@timer
def export(self, study, repertory, qlog=None, name="0"):
self._study = study
......@@ -888,20 +898,8 @@ class Mage8(Mage):
# Generate files
files = []
files = self._export_ST(study, repertory, qlog, name=name)
files = files + self._export_PAR(study, repertory, qlog, name=name)
files = files + self._export_NET(study, repertory, qlog, name=name)
files = files + \
self._export_bound_cond(study, repertory, qlog, name=name)
files = files + self._export_RUG(study, repertory, qlog, name=name)
files = files + self._export_INI(study, repertory, qlog, name=name)
files = files + self._export_SIN(study, repertory, qlog, name=name)
files = files + self._export_VAR(study, repertory, qlog, name=name)
files = files + self._export_CAS(study, repertory, qlog, name=name)
files = files + self._export_DEV(study, repertory, qlog, name=name)
files = files + self.export_additional_files(
study, repertory, qlog, name=name
)
for func in self.export_func_dict():
files = files + func(study, repertory, qlog, name=name)
self.export_study_description(study, repertory, qlog, name=name)
self._export_REP(study, repertory, files, qlog, name=name)
......@@ -1219,12 +1217,35 @@ class Mage8(Mage):
logger.info(f"read_gra: ... end with {len(ts)} timestamp read")
@timer
def results(self, study, repertory, qlog=None, name=None):
def results(self, study, repertory,
qlog=None, name=None,
with_gra=True):
self._study = study
if name is None:
name = study.name.replace(" ", "_")
results = super(Mage8, self).results(study, repertory, qlog, name=name)
self.read_gra(study, repertory, results, qlog, name=name)
if with_gra:
self.read_gra(study, repertory, results, qlog, name=name)
return results
class MageFake7(Mage8):
_type = "mage_fake7"
def __init__(self, name):
super(MageFake7, self).__init__(name)
self._type = "mage_fake7"
@timer
def results(self, study, repertory,
qlog=None, name=None,
with_gra=False):
results = super(MageFake7, self).results(
study, repertory,
qlog, name=name, with_gra=with_gra
)
return results
......@@ -19,7 +19,9 @@
from PyQt5.QtCore import QCoreApplication
from Solver.GenericSolver import GenericSolver
from Solver.Mage import Mage7, Mage8
from Solver.Mage import (
Mage7, Mage8, MageFake7,
)
_translate = QCoreApplication.translate
......@@ -27,10 +29,12 @@ solver_long_name = {
# "generic": "Generic",
# "mage7": "Mage v7",
"mage8": "Mage v8",
"mage_fake7": "Mage fake v7",
}
solver_type_list = {
# "generic": GenericSolver,
# "mage7": Mage7,
"mage8": Mage8,
"mage_fake7": MageFake7,
}
......@@ -285,16 +285,24 @@ class Config(SQL):
posix = os.name == 'posix'
ext = "" if posix else ".exe"
# Mage8
ctor = solver_type_list["mage8"]
new = ctor("default-mage")
new._description = "Default Pamhyr2 mage 8 version"
new._cmd_solver = f""""@install_dir/mage8/mage{ext}" @args @input"""
self._solvers.append(new)
# Mage fake 7
ctor = solver_type_list["mage_fake7"]
new = ctor("default-mage-fake-7")
new._description = "Default Pamhyr2 mage fake version 7"
new._cmd_solver = f""""@install_dir/mage8/mage_as7{ext}" @args @input"""
self._solvers.append(new)
# Backup
self.backup_enable = True
# self.backup_path = ""
self.backup_frequence = "00:05:00"
self.backup_frequence = "00:15:00"
# self.backup_max = 10
# Editor
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment