This commit is contained in:
neo-dl 2023-05-18 16:12:40 +02:00
parent 3e246014cc
commit a307bf76ea
6 changed files with 35 additions and 21 deletions

View File

@ -205,14 +205,15 @@ class TecnaMarpossProvasetT3(ModbusComponent):
# READ INFO
info = {r: self.read(r) for r in [
"Real time test pressure output",
"Real time differential pressure output",
#"Real time differential pressure output",
"Real time pressure line regulator",
"Active alarm flags",
"Active test program number",
#"Active test program number",
"Running test: active phase",
"Running test: test type",
"Running test: sequence index",
"Digital inputs status (mask)",
"Running test: measured leak"
#"Running test: sequence index",
#"Digital inputs status (mask)",
# "Digital outputs status (mask)",
]}
if self.model == "t3p":
@ -222,9 +223,11 @@ class TecnaMarpossProvasetT3(ModbusComponent):
"Active not severe alarm flags",
]})
else:
raise NotImplementedError(f"techna t3 model {self.model!r} not implemented.")
raise NotImplementedError(f"Tecna t3 model {self.model!r} not implemented.")
if info["Running test: active phase"] == "FINE TEST": # "END TEST, WAITING THE START OF A NEW TEST":
info.update(self.get_test_results())
for round_me in ["measured leak"]:
info.update({round_me:float(f"{info[round_me]:.2f}")})
self.log.debug(str(info))
super()._get([info])
@ -251,13 +254,13 @@ class TecnaMarpossProvasetT3(ModbusComponent):
def get_test_results(self):
self.log.info("getting test results")
return {r: self.read(r) for r in [
"Running test: phase backwards time",
#"Running test: phase backwards time",
"Running test: filling pressure",
"Running test: pressure at the end of settling",
"Running test: burst pressure",
#"Running test: burst pressure",
"Running test: measured leak",
"Running test: calculated leak flow rate",
"Running test: calculate RVP%",
#"Running test: calculated leak flow rate",
#"Running test: calculate RVP%",
"Running test: result",
]}

View File

@ -80,7 +80,7 @@ registers = {
"Running test: calculated leak flow rate": [42 - 1, {"dt": "32bit_int", "f": 1507, }],
"Running test: calculate RVP%": [44 - 1, {"dt": "32bit_int", }],
"Running test: result": [46 - 1, {"dt": "16bit_uint", "decoding": {
1: "LEAK TEST PASSED (also used in Volume+Leak tests)",
1: "LEAK TEST PASSED",
2: "BURST TEST PASSED WITH BURST",
3: "BURST TEST PASSED WITHOUT BURST",
4: "APERTURE TEST PASSED",

View File

@ -59,7 +59,7 @@ registers = {
"Running test: calculated leak flow rate": [42 - 1, {"dt": "32bit_int", "f": 24, }],
"Running test: calculate RVP%": [44 - 1, {"dt": "32bit_int", }],
"Running test: result": [46 - 1, {"dt": "16bit_uint", "decoding": {
1: "LEAK TEST PASSED (also used in Volume+Leak tests)",
1: "LEAK TEST PASSED",
2: "BURST TEST PASSED WITH BURST",
3: "BURST TEST PASSED WITHOUT BURST",
4: "APERTURE TEST PASSED",

View File

@ -455,7 +455,14 @@ class Test(Widget):
self.data[step_name] = {}
if data is not None:
data["step"] = model_to_dict(self.step)
self.data[step_name][str(len(self.data[step_name]))] = data
data["step"].pop("name",None)
# MAKE ARRAY ONLY IF MORE THAN ONE TEST OF SAME TYPE
if len(self.data[step_name])>1:
self.data[step_name][str(len(self.data[step_name]))] = data
else:
self.data[step_name] = data
self.data["overridden"] = self.data["overridden"] or data.get("overridden", False)
self.data["ok"] = self.data["ok"] and data.get("ok", False)
self.next()

View File

@ -132,16 +132,20 @@ class Test_Leak(Test_Test):
ret = self.components["digital_io"].set_bit_verify(0, 1, 0)
else:
result = None
#result = None
ok = None
super().get([{
results={"ok":ok}
results.update(data)
super().get({
"time": data.get("time", None),
"results": {
"ok": ok,
"result": result,
"data": data["tecna_t3"],
},
}], override=override, fail=ok is False)
"results": results
#"results": {
#"ok": ok,
#"result": result,
#"data": data["tecna_t3"],
#},
}, override=override, fail=ok is False)
def visualize(self, data=None):
if data is None:

View File

@ -144,7 +144,7 @@ class Test_Test(Widget):
self.last = {
**data,
"overridden": override,
"duration": f"{duration:.2f}",
"duration": float(f"{duration:.2f}"),
"ok": result_ok,
}
if fail: