wip
This commit is contained in:
parent
bfe03b07bd
commit
15b0f5d3c8
@ -85,13 +85,8 @@ class Test_Resistance(Test_Test):
|
|||||||
]):
|
]):
|
||||||
if abs(result - expected) <= expected * (tolerance / 100):
|
if abs(result - expected) <= expected * (tolerance / 100):
|
||||||
ok = True
|
ok = True
|
||||||
img = True
|
|
||||||
else:
|
else:
|
||||||
ok = None
|
ok = None
|
||||||
if result == 1e9:
|
|
||||||
img = None
|
|
||||||
else:
|
|
||||||
img = False
|
|
||||||
else:
|
else:
|
||||||
ok = None
|
ok = None
|
||||||
super().get([{
|
super().get([{
|
||||||
@ -116,13 +111,16 @@ class Test_Resistance(Test_Test):
|
|||||||
v = round(v, 2)
|
v = round(v, 2)
|
||||||
l.setText(str(v))
|
l.setText(str(v))
|
||||||
ok = data.get("results", {}).get("ok", None) is True
|
ok = data.get("results", {}).get("ok", None) is True
|
||||||
|
i = ok
|
||||||
p = ok
|
p = ok
|
||||||
if p is None:
|
if i is None and data.get("results", {}).get("data", None) != 1e9:
|
||||||
|
i = False
|
||||||
|
if p is None and data.get("results", {}).get("data", None) == 1e9:
|
||||||
p = "warning"
|
p = "warning"
|
||||||
bg = self.status_palettes[p].color(QPalette.Base)
|
bg = self.status_palettes[p].color(QPalette.Base)
|
||||||
color = f"rgb({bg.red()}, {bg.green()}, {bg.blue()})"
|
color = f"rgb({bg.red()}, {bg.green()}, {bg.blue()})"
|
||||||
self.resistance_l.setStyleSheet(f"background-color: {color};\nborder: 1px solid black;\n")
|
self.resistance_l.setStyleSheet(f"background-color: {color};\nborder: 1px solid black;\n")
|
||||||
super().visualize(data, img=self.status_imgs_full[ok])
|
super().visualize(data, img=self.status_imgs_full[i])
|
||||||
|
|
||||||
def save_last(self):
|
def save_last(self):
|
||||||
if self.last is None:
|
if self.last is None:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user