рефактор машины состояний контроля
This commit is contained in:
@@ -13,12 +13,13 @@ const constants_k: Dictionary = {
|
||||
'ADDR_UG_LITERA_3': 0x10A,
|
||||
'TEMP_THRESHOLD': 40,
|
||||
'POWER_THRESHOLD': 40,
|
||||
'TIMER_DELAY': 5.0,
|
||||
'RAY_DOU_NUM': 0x3,
|
||||
'ATT_UM_1': 0x0,
|
||||
'ATT_UM_6': 0x7,
|
||||
'ATT_UM_7': 0x7,
|
||||
'POWER_UM': 75,
|
||||
'POWER_UM': 85,
|
||||
'TIMER_DELAY': 5.0,
|
||||
'STATE_MASHINE_TIMER': 0.3,
|
||||
}
|
||||
# Конфигурация параметров для каждого прибора
|
||||
const PRIBOR_CONFIG := {
|
||||
@@ -70,9 +71,9 @@ var control_results_k: Dictionary = {
|
||||
'dkm_7': false,
|
||||
'dou_6': false,
|
||||
'dou_7': false,
|
||||
'fs_1': false,
|
||||
'fs_6': false,
|
||||
'fs_7': false,
|
||||
'fs_1': 2,
|
||||
'fs_6': 2,
|
||||
'fs_7': 2,
|
||||
}
|
||||
|
||||
var test_control_k = preload('res://scripts/pribor-prd.gd')
|
||||
@@ -119,7 +120,7 @@ func initialize_connections() -> void:
|
||||
func setup_timer() -> void:
|
||||
add_child(mashine_timer)
|
||||
mashine_timer.connect('timeout', Callable(self, 'on_state_mashine'))
|
||||
mashine_timer.wait_time = 0.5
|
||||
mashine_timer.wait_time = constants_k.STATE_MASHINE_TIMER
|
||||
mashine_timer.start()
|
||||
|
||||
|
||||
@@ -212,14 +213,20 @@ func on_control_result(result_dic: Dictionary, power_dic: Dictionary) -> void:
|
||||
f.state = new_state
|
||||
result_dic[fs_meta] = new_state
|
||||
|
||||
if result_dic.fs_1:
|
||||
if result_dic.fs_1 == 1:
|
||||
$kasseta_fs_kd/ref_A2.state = STATE_VAL.GOOD if result_dic.dkm_1 else STATE_VAL.ERROR
|
||||
if result_dic.fs_6:
|
||||
else:
|
||||
result_dic.fs_1 = false
|
||||
if result_dic.fs_6 == 1:
|
||||
$kasseta_fs_kd/ref_A4.state = STATE_VAL.GOOD if result_dic.dkm_6 else STATE_VAL.ERROR
|
||||
$dou6_A7.state = STATE_VAL.GOOD if result_dic.dou_6 else STATE_VAL.ERROR
|
||||
if result_dic.fs_7:
|
||||
else:
|
||||
result_dic.fs_6 = false
|
||||
if result_dic.fs_7 == 1:
|
||||
$kasseta_fs_kd/ref_A7.state = STATE_VAL.GOOD if result_dic.dkm_7 else STATE_VAL.ERROR
|
||||
$dou7_A8.state = STATE_VAL.GOOD if result_dic.dou_7 else STATE_VAL.ERROR
|
||||
else:
|
||||
result_dic.fs_7 = false
|
||||
|
||||
power_fill(power_dic)
|
||||
|
||||
|
||||
@@ -94,7 +94,6 @@ offset_left = 485.0
|
||||
offset_top = 242.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 337.0
|
||||
animation_duration = null
|
||||
value0 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
|
||||
fname = "УМ1535Б"
|
||||
rname = "A10"
|
||||
@@ -108,7 +107,6 @@ offset_left = 485.0
|
||||
offset_top = 337.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 432.0
|
||||
animation_duration = null
|
||||
fname = "УМ1535Б"
|
||||
rname = "A11"
|
||||
value0_info = "Мощность, Вт"
|
||||
@@ -121,7 +119,6 @@ offset_left = 485.0
|
||||
offset_top = 432.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 527.0
|
||||
animation_duration = null
|
||||
fname = "УМ1535Б"
|
||||
rname = "A12"
|
||||
value0_info = "Мощность, Вт"
|
||||
@@ -134,7 +131,6 @@ offset_left = 485.0
|
||||
offset_top = 527.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 622.0
|
||||
animation_duration = null
|
||||
fname = "УМ1535Б"
|
||||
rname = "A13"
|
||||
value0_info = "Мощность, Вт"
|
||||
@@ -147,7 +143,6 @@ offset_left = 485.0
|
||||
offset_top = 622.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 717.0
|
||||
animation_duration = null
|
||||
fname = "УМ1535Б"
|
||||
rname = "A14"
|
||||
value0_info = "Мощность, Вт"
|
||||
@@ -160,7 +155,6 @@ offset_left = 485.0
|
||||
offset_top = 717.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 812.0
|
||||
animation_duration = null
|
||||
fname = "УМ1535Б"
|
||||
rname = "A15"
|
||||
value0_info = "Мощность, Вт"
|
||||
@@ -173,7 +167,6 @@ offset_left = 485.0
|
||||
offset_top = 812.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 907.0
|
||||
animation_duration = null
|
||||
fname = "УТМ80"
|
||||
rname = "A9"
|
||||
value0_info = "Мощность, Вт"
|
||||
@@ -186,7 +179,6 @@ offset_left = 8.0
|
||||
offset_top = 242.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 337.0
|
||||
animation_duration = null
|
||||
fname = "УМ1535Б"
|
||||
rname = "A16"
|
||||
value0_info = "Мощность, Вт"
|
||||
@@ -199,7 +191,6 @@ offset_left = 8.0
|
||||
offset_top = 337.0
|
||||
offset_right = 173.0
|
||||
offset_bottom = 432.0
|
||||
animation_duration = null
|
||||
fname = "УМ1535Б"
|
||||
rname = "A17"
|
||||
value0_info = "Мощность, Вт"
|
||||
@@ -212,7 +203,6 @@ offset_left = 8.0
|
||||
offset_top = 432.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 527.0
|
||||
animation_duration = null
|
||||
fname = "УМ1535Б"
|
||||
rname = "A18"
|
||||
value0_info = "Мощность, Вт"
|
||||
@@ -225,7 +215,6 @@ offset_left = 8.0
|
||||
offset_top = 527.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 622.0
|
||||
animation_duration = null
|
||||
fname = "УМ1535Б"
|
||||
rname = "A19"
|
||||
value0_info = "Мощность, Вт"
|
||||
@@ -238,7 +227,6 @@ offset_left = 8.0
|
||||
offset_top = 622.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 717.0
|
||||
animation_duration = null
|
||||
fname = "УМ1535Б"
|
||||
rname = "A20"
|
||||
value0_info = "Мощность, Вт"
|
||||
@@ -251,7 +239,6 @@ offset_left = 8.0
|
||||
offset_top = 717.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 812.0
|
||||
animation_duration = null
|
||||
fname = "УМ1535Б"
|
||||
rname = "A21"
|
||||
value0_info = "Мощность, Вт"
|
||||
|
||||
Reference in New Issue
Block a user