Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e85eb9963a
|
|
@ -337,5 +337,5 @@ registers = {
|
|||
"T1 Steps - T1 Step %": [753 - 1, {"dt": "16bit_uint", }],
|
||||
# | 15 14 13 12 11 10 9 8 | 7 6 5 4 3 2 1 0 |
|
||||
# | Step % T1 | T1 Steps |
|
||||
"Sequence": [754 - 1, {"dt": "16bit_uint", }],
|
||||
"PSQ - Next sequence program PSOUT mode": [754 - 1, {"dt": "16bit_uint", }],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -225,6 +225,7 @@ try:
|
|||
self.main_window.admin_m.menuAction().setVisible(False)
|
||||
# open test
|
||||
self.main_window.open_tab(Test(self.config, self.components,self))
|
||||
self.main_window.centralWidget().request_autotest("login")
|
||||
else:
|
||||
self.main_window.admin_m.menuAction().setVisible(False)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import logging
|
|||
import os
|
||||
import sys
|
||||
import weakref
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from lib.db import Archive, Steps, Users
|
||||
from lib.helpers import get_shift
|
||||
|
|
@ -112,10 +112,10 @@ class Test(Widget):
|
|||
self.autotesting_reason = None
|
||||
self.autotest_cycle_steps = None
|
||||
if "--no-autotest" not in sys.argv:
|
||||
self.autotest_period = 8.5 * 60 * 60 * 1000 # 8.5 HOURS
|
||||
self.autotest_period = 8.5 * 60 * 60 * 1000 # 8.5 HOURS
|
||||
# self.autotest_period = 12 * 60 * 60 * 1000 # 12 HOURS
|
||||
if not self.config["autotest_done"]:
|
||||
self.request_autotest("init")
|
||||
#if not self.config["autotest_done"]:
|
||||
# self.request_autotest("init")
|
||||
else:
|
||||
self.autotest_period = None
|
||||
# INIT TEST DATA
|
||||
|
|
@ -195,7 +195,7 @@ class Test(Widget):
|
|||
|
||||
def request_autotest(self, reason): # you can cancel the request calling request_autotest(False)
|
||||
self.log.info(f"cycle request autotest: reason: {reason!r} autotest_request: {self.autotest_request!r}")
|
||||
if reason == "init":
|
||||
if reason in ("init","login"):
|
||||
self.autotest_timer = QTimer()
|
||||
self.autotest_timer.setSingleShot(False)
|
||||
self.autotest_timer.timeout.connect(self.request_periodic_autotest)
|
||||
|
|
@ -263,7 +263,11 @@ class Test(Widget):
|
|||
if self.autotesting_reason == "logout":
|
||||
Users.logout()
|
||||
self.main_window.open_login()
|
||||
|
||||
else:
|
||||
t = datetime.now()
|
||||
self.last_at_l.setText("{d}/{mo}/{y} {h}:{m}".format(y=t.year, mo=t.month, d=t.day, h=t.hour, m=t.minute))
|
||||
t+=timedelta(seconds=int(self.autotest_period/1000))
|
||||
self.next_at_l.setText("{d}/{mo}/{y} {h}:{m}".format(y=t.year, mo=t.month, d=t.day, h=t.hour, m=t.minute))
|
||||
self.autotesting_reason = None
|
||||
self.cycle_index = -1
|
||||
self.config["autotest_done"] = True
|
||||
|
|
|
|||
|
|
@ -52,8 +52,28 @@
|
|||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="1" column="5" rowspan="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<item row="1" column="9">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>N. DISEGNO:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4" rowspan="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
|
|
@ -65,6 +85,56 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="11" rowspan="2">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="autotests_l">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PROSSIMO AUTOTEST:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PEZZI FATTI</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" rowspan="2">
|
||||
<widget class="QPushButton" name="cancel_b">
|
||||
<property name="sizePolicy">
|
||||
|
|
@ -91,20 +161,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="7" rowspan="2">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="11">
|
||||
<item row="0" column="0" colspan="12">
|
||||
<widget class="QLabel" name="machine_description_l">
|
||||
<property name="font">
|
||||
<font>
|
||||
|
|
@ -121,8 +178,8 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="6">
|
||||
<widget class="QLabel" name="pieces_count_l">
|
||||
<item row="1" column="5" rowspan="2">
|
||||
<widget class="QLabel" name="time_l">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
|
|
@ -131,14 +188,15 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>12345</string>
|
||||
<string>12345
|
||||
567</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="9">
|
||||
<item row="1" column="10">
|
||||
<widget class="QLabel" name="recipe_l">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
|
|
@ -170,93 +228,8 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="8">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OPERATORE:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4" rowspan="2">
|
||||
<widget class="QLabel" name="time_l">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>12345
|
||||
567</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="8">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>N. DISEGNO:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PEZZI FATTI</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="10" rowspan="2">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="3" rowspan="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<item row="1" column="8" rowspan="2">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
|
|
@ -268,8 +241,8 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="9">
|
||||
<widget class="QLabel" name="user_l">
|
||||
<item row="2" column="7">
|
||||
<widget class="QLabel" name="pieces_count_l">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
|
|
@ -278,7 +251,24 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
<string>12345</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="9">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OPERATORE:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -331,8 +321,21 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="autotests_l">
|
||||
<item row="1" column="6" rowspan="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="10">
|
||||
<widget class="QLabel" name="user_l">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
|
|
@ -341,7 +344,38 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>DD/MM/YY HH:MM</string>
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="last_at_l">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QLabel" name="next_at_l">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
|
|
|
|||
|
|
@ -22,14 +22,17 @@ class Test_Assembly(Widget):
|
|||
self.img = None
|
||||
self.img_l.setVisible(False)
|
||||
|
||||
def set_text(self, text=None,color=None):
|
||||
def set_text(self, text=None,bg_color=None,text_color=None):
|
||||
if text is not None:
|
||||
self.text = text
|
||||
self.text_l.setText(str(self.text))
|
||||
self.text_l.setVisible(True)
|
||||
if color is None:
|
||||
color = "lime"
|
||||
self.text_l.setStyleSheet(f"background-color: {color};")
|
||||
if bg_color is None:
|
||||
bg_color = "lime"
|
||||
if text_color is None:
|
||||
text_color = "black"
|
||||
|
||||
self.text_l.setStyleSheet(f"background-color: {bg_color};color: {text_color}")
|
||||
|
||||
else:
|
||||
self.text = None
|
||||
|
|
|
|||
|
|
@ -172,10 +172,10 @@ class Test_Leak(Test_Test):
|
|||
}:
|
||||
if self.step.spec.get("autotest", False) == "ok_check":
|
||||
if self.parent_assembly_widget is not None:
|
||||
self.parent_assembly_widget().set_text(text="AUTOTEST: RIMUOVERE FUGA CALIBRATA E PREMERE START PER INIZIARE LA PROVA TENUTA",color="blue")
|
||||
self.parent_assembly_widget().set_text(text="AUTOTEST: RIMUOVERE FUGA CALIBRATA E PREMERE START PER INIZIARE LA PROVA TENUTA",bg_color="blue",text_color="white")
|
||||
elif self.step.spec.get("autotest", False) == "ko_check":
|
||||
if self.parent_assembly_widget is not None :
|
||||
self.parent_assembly_widget().set_text(text="AUTOTEST: COLLEGARE TUBO-TUBO + FUGA CALIBRATA E PREMERE START PER INIZIARE LA PROVA TENUTA DI PROVA",color="blue")
|
||||
self.parent_assembly_widget().set_text(text="AUTOTEST: COLLEGARE TUBO-TUBO + FUGA CALIBRATA E PREMERE START PER INIZIARE LA PROVA TENUTA DI PROVA",bg_color="blue",text_color="white")
|
||||
else:
|
||||
if self.parent_assembly_widget is not None:
|
||||
self.parent_assembly_widget().set_text(text="COLLEGARE GLI ATTACCHI PNEUMATICI E PREMERE START PER INIZIARE LA PROVA TENUTA")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user