Доработка проверки яу 07б
и корректировка температур ум в контроле
This commit is contained in:
@@ -69,7 +69,7 @@ static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dicti
|
||||
for i_node_temperature in temperature_arr_node:
|
||||
var temperature_meta: String = i_node_temperature.get_meta('um')
|
||||
if not temperature_dic.has(temperature_meta): return
|
||||
i_node_temperature.value1 = temperature_dic[temperature_meta]
|
||||
i_node_temperature.value1 = temperature_dic[temperature_meta] if temperature_dic[temperature_meta] < 361 else -40
|
||||
|
||||
|
||||
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void:
|
||||
@@ -114,8 +114,6 @@ func on_press_device() -> void:
|
||||
'fs_nodes': fs_nodes,
|
||||
'power_amplifier': power_amplifier,
|
||||
'default_reset_array_node': default_reset_array_node,
|
||||
'POWER_THRESHOLD': unit_prd_k.constants.POWER_THRESHOLD,
|
||||
'name_prd': unit_prd_k.self_name,
|
||||
'module_fs_1': module_fs_1,
|
||||
'module_fs_6': module_fs_6,
|
||||
'dou_6': dou_6,
|
||||
@@ -136,14 +134,16 @@ static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
if block_kasseta_y5_prd_config_k.has(meta_y5):
|
||||
if not block_kasseta_y5_prd_config_k['yau07']:
|
||||
node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE
|
||||
break
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_k[meta_y5] else STATE_VAL.ERROR
|
||||
else:
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_k[meta_y5] else STATE_VAL.ERROR
|
||||
|
||||
var block_ip_config_k: Dictionary = for_result_dic.block_ip_config
|
||||
for power_supply in for_result_dic.node_ip_power_arr:
|
||||
var meta_ip = power_supply.get_meta('ip')
|
||||
if block_ip_config_k.has(meta_ip) and block_kasseta_y5_prd_config_k.ug:
|
||||
if block_ip_config_k.has(meta_ip) and block_kasseta_y5_prd_config_k.ug and block_kasseta_y5_prd_config_k.yau07:
|
||||
power_supply.state = STATE_VAL.GOOD if block_ip_config_k[meta_ip][1] else STATE_VAL.ERROR
|
||||
else:
|
||||
power_supply.state = STATE_VAL.NONE
|
||||
|
||||
if not for_result_dic.control_is_over:
|
||||
set_default_state(for_result_dic.default_reset_array_node, for_result_dic.power_amplifier)
|
||||
@@ -200,3 +200,5 @@ func _update_status_text(text: String) -> void:
|
||||
elif "исправен" in text or "завершён" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.GREEN)
|
||||
log.message(Logger.INFO, 'Прибор ПРД-%s исправен' % [unit_prd_k.self_name])
|
||||
else:
|
||||
$control_result.add_theme_color_override('font_color', Color.WHITE)
|
||||
|
||||
@@ -68,7 +68,7 @@ static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dicti
|
||||
for i_node_temperature in temperature_arr_node:
|
||||
var temperature_meta: String = i_node_temperature.get_meta('um')
|
||||
if not temperature_dic.has(temperature_meta): return
|
||||
i_node_temperature.value1 = temperature_dic[temperature_meta]
|
||||
i_node_temperature.value1 = temperature_dic[temperature_meta] if temperature_dic[temperature_meta] < 361 else -40
|
||||
|
||||
|
||||
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void:
|
||||
@@ -105,8 +105,6 @@ func on_press_device() -> void:
|
||||
'fs_nodes': fs_nodes,
|
||||
'power_amplifier': power_amplifier_arr_node,
|
||||
'default_reset_array_node': default_reset_array_node,
|
||||
'POWER_THRESHOLD': unit_prd_n.constants.POWER_THRESHOLD,
|
||||
'name_prd': unit_prd_n.self_name,
|
||||
'module_fs_2': module_fs_2,
|
||||
'dou_2': dou_2,
|
||||
'module_fs_3': module_fs_3,
|
||||
@@ -124,16 +122,18 @@ static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
for node_y5 in nodes_y5:
|
||||
var meta_y5 = node_y5.get_meta('y5')
|
||||
if block_kasseta_y5_prd_config_n.has(meta_y5):
|
||||
if not block_kasseta_y5_prd_config_n['yau07']:
|
||||
if not block_kasseta_y5_prd_config_n.yau07:
|
||||
node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE
|
||||
break
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_n[meta_y5] else STATE_VAL.ERROR
|
||||
else:
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_n[meta_y5] else STATE_VAL.ERROR
|
||||
|
||||
var block_ip_config_n: Dictionary = for_result_dic.block_ip_config
|
||||
for power_supply in for_result_dic.node_ip_power_arr:
|
||||
var meta_ip = power_supply.get_meta('ip')
|
||||
if block_ip_config_n.has(meta_ip) and block_kasseta_y5_prd_config_n.ug:
|
||||
if block_ip_config_n.has(meta_ip) and block_kasseta_y5_prd_config_n.ug and block_kasseta_y5_prd_config_n.yau07:
|
||||
power_supply.state = STATE_VAL.GOOD if block_ip_config_n[meta_ip][1] else STATE_VAL.ERROR
|
||||
else:
|
||||
power_supply.state = STATE_VAL.NONE
|
||||
|
||||
if not for_result_dic.control_is_over:
|
||||
set_default_state(for_result_dic.default_reset_array_node, for_result_dic.power_amplifier)
|
||||
@@ -187,3 +187,5 @@ func _update_status_text(text: String) -> void:
|
||||
elif "исправен" in text or "завершён" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.GREEN)
|
||||
log.message(Logger.INFO, 'Прибор ПРД-%s исправен' % [unit_prd_n.self_name])
|
||||
else:
|
||||
$control_result.add_theme_color_override('font_color', Color.WHITE)
|
||||
|
||||
@@ -67,7 +67,7 @@ static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dicti
|
||||
for i_node_temperature in temperature_arr_node:
|
||||
var temperature_meta: String = i_node_temperature.get_meta('um')
|
||||
if not temperature_dic.has(temperature_meta): return
|
||||
i_node_temperature.value1 = temperature_dic[temperature_meta]
|
||||
i_node_temperature.value1 = temperature_dic[temperature_meta] if temperature_dic[temperature_meta] < 361 else -40
|
||||
|
||||
|
||||
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void:
|
||||
@@ -121,16 +121,18 @@ static func on_control_result(for_result_dic: Dictionary) -> void:
|
||||
for node_y5 in nodes_y5:
|
||||
var meta_y5 = node_y5.get_meta('y5')
|
||||
if block_kasseta_y5_prd_config_v.has(meta_y5):
|
||||
if block_kasseta_y5_prd_config_v['yau07'] == false:
|
||||
if not block_kasseta_y5_prd_config_v.yau07:
|
||||
node_y5.state = STATE_VAL.ERROR if meta_y5 == 'yau07' else STATE_VAL.NONE
|
||||
break
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_v[meta_y5] else STATE_VAL.ERROR
|
||||
|
||||
else:
|
||||
node_y5.state = STATE_VAL.GOOD if block_kasseta_y5_prd_config_v[meta_y5] else STATE_VAL.ERROR
|
||||
|
||||
var block_ip_config_v: Dictionary = for_result_dic.block_ip_config
|
||||
for power_supply in for_result_dic.node_ip_power_arr:
|
||||
var meta_ip = power_supply.get_meta('ip')
|
||||
if block_ip_config_v.has(meta_ip) and block_kasseta_y5_prd_config_v.ug:
|
||||
if block_ip_config_v.has(meta_ip) and block_kasseta_y5_prd_config_v.ug and block_kasseta_y5_prd_config_v.yau07:
|
||||
power_supply.state = STATE_VAL.GOOD if block_ip_config_v[meta_ip][1] else STATE_VAL.ERROR
|
||||
else:
|
||||
power_supply.state = STATE_VAL.NONE
|
||||
|
||||
if not for_result_dic.control_is_over:
|
||||
set_default_state(for_result_dic.default_reset_array_node, for_result_dic.power_amplifier)
|
||||
@@ -184,3 +186,5 @@ func _update_status_text(text: String) -> void:
|
||||
elif "исправен" in text or "завершён" in text:
|
||||
$control_result.add_theme_color_override('font_color', Color.GREEN)
|
||||
log.message(Logger.INFO, 'Прибор ПРД-%s исправен' % [unit_prd_v.self_name])
|
||||
else:
|
||||
$control_result.add_theme_color_override('font_color', Color.WHITE)
|
||||
|
||||
@@ -68,6 +68,7 @@ func _stop_pulse():
|
||||
pulsing = false
|
||||
disabled = false
|
||||
text = original_text
|
||||
tooltip_text = ''
|
||||
|
||||
|
||||
func _on_status_change():
|
||||
|
||||
@@ -275,7 +275,7 @@ textures = [ExtResource("1_n1aqt"), ExtResource("2_rim3u"), ExtResource("3_3w8fg
|
||||
value0 = [20.0, 30.0, 40.0, 50.0, 60.0, 70.0]
|
||||
min_value1 = -40.0
|
||||
max_value0 = 1400.0
|
||||
max_value1 = 60.0
|
||||
max_value1 = 55.0
|
||||
step0 = 1.0
|
||||
step1 = 1.0
|
||||
value_name0 = "P,%"
|
||||
@@ -476,10 +476,10 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
tooltip_text = "
|
||||
Текущее: 0.00
|
||||
Диапазон: -40.00…70.00"
|
||||
Диапазон: -40.00…60.00"
|
||||
mouse_filter = 0
|
||||
min_value = -40.0
|
||||
max_value = 60.0
|
||||
max_value = 55.0
|
||||
fill_mode = 3
|
||||
nine_patch_stretch = true
|
||||
stretch_margin_left = 8
|
||||
|
||||
@@ -35,7 +35,7 @@ signal pressed(control: PanelContainer)
|
||||
if not is_inside_tree():
|
||||
return
|
||||
$margin/vbox/grid1/level7.value = v
|
||||
$margin/vbox/grid1/level7.tint_progress = Color.RED if v >= 70 else Color.GOLD if v >= 60 else Color.WHITE
|
||||
$margin/vbox/grid1/level7.tint_progress = Color.RED if v >= 50 else Color.GOLD if v >= 40 else Color.WHITE
|
||||
|
||||
|
||||
@export var min_value0: float:
|
||||
@@ -262,7 +262,7 @@ value0 = [20.0, 30.0, 40.0, 50.0, 60.0, 70.0]
|
||||
value1 = -40.0
|
||||
min_value1 = -40.0
|
||||
max_value0 = 1400.0
|
||||
max_value1 = 60.0
|
||||
max_value1 = 55.0
|
||||
step0 = 1.0
|
||||
step1 = 1.0
|
||||
value_name0 = "P,%"
|
||||
@@ -366,10 +366,10 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
tooltip_text = "
|
||||
Текущее: -40.00
|
||||
Диапазон: -40.00…70.00"
|
||||
Диапазон: -40.00…60.00"
|
||||
mouse_filter = 0
|
||||
min_value = -40.0
|
||||
max_value = 60.0
|
||||
max_value = 55.0
|
||||
value = -40.0
|
||||
fill_mode = 3
|
||||
nine_patch_stretch = true
|
||||
|
||||
@@ -50,6 +50,7 @@ const PRIBORS_RES = \\
|
||||
|
||||
func on_line_changed(u, conn_node, _pribor_meta): conn_node.set_val(u.online)
|
||||
func on_serv_changed(u, pribor_node, _pribor_meta): pribor_node.state = int(u.serviceability)
|
||||
var count_device_control_is_ready: int = 0
|
||||
|
||||
|
||||
func on_mode_changed():
|
||||
@@ -89,6 +90,7 @@ func _ready():
|
||||
prd_module.connect('update_serviceability', Callable(self, 'on_serviceability_changed').bind(prd_module, pribor_node))
|
||||
prd_module.unit_control.connect('update_progress', Callable(self, 'on_update_progress').bind(pribor_node))
|
||||
prd_module.unit_control.connect('update_max_value_progress', Callable(self, 'on_update_max_value_progress').bind(pribor_node))
|
||||
prd_module.unit_control.connect('control_is_over', Callable(self, 'on_control_is_over').bind(prd_module.unit_control))
|
||||
if item == 'уарэп-эмс':
|
||||
signaller.connect('update_uf_serviceability', Callable(self, 'on_update_uf_serviceability').bind(pribor_node))
|
||||
# Пиктограммы приборов, которые отображают состояние подключения только
|
||||
@@ -152,6 +154,7 @@ func on_update_uf_serviceability(uf_serviceaability: bool, uf_pribor: Node)-> vo
|
||||
|
||||
|
||||
func _on_control_prd_pressed() -> void:
|
||||
count_device_control_is_ready = 0
|
||||
signaller.emit_signal('start_contol_device')
|
||||
|
||||
|
||||
@@ -162,6 +165,20 @@ func on_update_progress(value_progress: float, pribor_node: Node) -> void:
|
||||
|
||||
func on_update_max_value_progress(max_value_progress: int, pribor_node: Node) -> void:
|
||||
pribor_node.progress_max_value = max_value_progress
|
||||
|
||||
|
||||
func on_control_is_over(pribor_node: Node) -> void:
|
||||
if pribor_node.self_name in ['1н', '2н', '3н', '4н', '1в', '2в', '3в', '4в', '1к', '2к', '3к', '4к',]:
|
||||
count_device_control_is_ready += 1
|
||||
if count_device_control_is_ready == 12:
|
||||
var time_dict = Time.get_datetime_dict_from_system()
|
||||
$control_prd.text = 'Контроль выполнен %02d:%02d/%02d.%02d' % [
|
||||
time_dict.hour,
|
||||
time_dict.minute,
|
||||
time_dict.day,
|
||||
time_dict.month]
|
||||
$control_prd.disabled = false
|
||||
$control_prd.tooltip_text = 'Нажать для повторного контроля '
|
||||
"
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_foasq"]
|
||||
@@ -1683,9 +1700,9 @@ default_color = Color(1, 1, 1, 0.352941)
|
||||
|
||||
[node name="control_prd" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 1101.0
|
||||
offset_left = 1043.0
|
||||
offset_top = 64.0
|
||||
offset_right = 1326.0
|
||||
offset_right = 1390.0
|
||||
offset_bottom = 104.0
|
||||
focus_mode = 0
|
||||
text = "Запуск контроля"
|
||||
|
||||
@@ -84,6 +84,8 @@ var flag_si_fs_input: bool = false
|
||||
var flag_si_fs_output: bool = false
|
||||
var flag_in_control: bool = false
|
||||
var flag_control_is_over: bool = false
|
||||
var flag_no_trust_yau07: bool = false
|
||||
var flag_only_fs: bool = false
|
||||
var unit_prd: Object
|
||||
var control_timer: Timer = Timer.new()
|
||||
var ems_6666_timer: Timer = Timer.new()
|
||||
@@ -222,8 +224,9 @@ func _process(_delta: float) -> void:
|
||||
func on_data_received(unit_pribor: Object) -> void:
|
||||
if not flag_in_control: return
|
||||
var status: PackedByteArray = unit_pribor.status
|
||||
block_kasseta_y5_config = check_block_kasseta_y5(status, block_kasseta_y5_config, flag_no_trust_yau07)
|
||||
if flag_no_trust_yau07: return
|
||||
socket_status_ems_g(status)
|
||||
block_kasseta_y5_config = check_block_kasseta_y5(status, block_kasseta_y5_config)
|
||||
block_ip_config = check_block_ip(status, block_ip_config)
|
||||
temperature_um = check_temperature_um(status)
|
||||
if machine_timer.is_stopped():
|
||||
@@ -284,6 +287,7 @@ func on_fs_update_state(packet_type_7: Dictionary, fs_mapping: Dictionary) -> vo
|
||||
control_results[fs_key] = fs_result[fs_key]
|
||||
flag_fs_status_ok = control_results[fs_key] == 1
|
||||
|
||||
|
||||
##
|
||||
func state_control_machine() -> void:
|
||||
match state:
|
||||
@@ -306,6 +310,8 @@ func state_control_machine() -> void:
|
||||
STATE_MACHINE.CHEK_KASSETA_Y5:
|
||||
if block_kasseta_y5_config['yau07']:
|
||||
state = STATE_MACHINE.WRITE_ISA
|
||||
elif flag_only_fs:
|
||||
state = STATE_MACHINE.IN_EMS_STOP
|
||||
STATE_MACHINE.WRITE_ISA:
|
||||
if not flag_write_isa:
|
||||
_handle_ug_set_state(0x6)
|
||||
@@ -375,7 +381,7 @@ func state_control_machine() -> void:
|
||||
STATE_MACHINE.STOP_CONTROL:
|
||||
_handle_stop_control_state()
|
||||
## В машине состояний вызов изменения состояния прогресс бара контроля
|
||||
if block_kasseta_y5_config['yau07']:
|
||||
if block_kasseta_y5_config['yau07'] or flag_no_trust_yau07:
|
||||
progressbar_status()
|
||||
|
||||
|
||||
@@ -522,6 +528,9 @@ func _handle_stop_control_state() -> void:
|
||||
|
||||
_advance_to_next_fs()
|
||||
state = STATE_MACHINE.INIT
|
||||
if current_litera == 0: return
|
||||
if flag_no_trust_yau07:
|
||||
state = STATE_MACHINE.STOP_CONTROL
|
||||
|
||||
|
||||
## Переходит на следующую литеру, если 0 то считай закончил выполнения контроля
|
||||
@@ -565,6 +574,8 @@ func _on_start_contol_device()-> void:
|
||||
|
||||
|
||||
func _determine_self_name() -> void:
|
||||
flag_no_trust_yau07 = false
|
||||
flag_only_fs = false
|
||||
cc = 0
|
||||
state = STATE_MACHINE.get("INIT", 0)
|
||||
var current_unit = unit_prd.name
|
||||
@@ -652,6 +663,11 @@ func on_state_mashine():
|
||||
## При таймауте таймера ожидания выполнения команды и перехода на следующий шаг машины состояний
|
||||
func on_stop_control() -> void:
|
||||
_handle_fs_turn_off_state()
|
||||
|
||||
if state == STATE_MACHINE.UG_SET_RAY:
|
||||
flag_no_trust_yau07 = true
|
||||
elif state == STATE_MACHINE.CHEK_KASSETA_Y5:
|
||||
flag_only_fs = true
|
||||
state = STATE_MACHINE.FS_TURN_OFF
|
||||
|
||||
|
||||
@@ -661,6 +677,8 @@ func on_mode_changed(in_tree: bool) -> void:
|
||||
if not in_tree: ## TODO: Дополнительная проверка если контроль идет, если нет, то смысла вызывать нет
|
||||
_set_status("Ожидание запуска контроля")
|
||||
flag_control_is_over = false
|
||||
flag_no_trust_yau07 = false
|
||||
flag_only_fs = false
|
||||
progress_value = 0
|
||||
machine_timer.stop()
|
||||
state = STATE_MACHINE.INIT
|
||||
@@ -778,12 +796,13 @@ static func check_block_ip(status_prd: PackedByteArray, ip_config: Dictionary) -
|
||||
|
||||
|
||||
## Проверка кассеты у-5 (ЯУ-07Б, ЭМС-Г, УГ, УКП-1, УКП-2)
|
||||
static func check_block_kasseta_y5(status_prd: PackedByteArray, y5_config: Dictionary) -> Dictionary:
|
||||
y5_config.yau07 = true
|
||||
y5_config.ems = (status_prd[0] & 1) and ((status_prd[0] >> 4) & 1)
|
||||
y5_config.ug = (status_prd[0] >> 1) & 1
|
||||
y5_config.ukp1 = (status_prd[0] >> 2) & 1
|
||||
y5_config.ukp2 = (status_prd[0] >> 3) & 1
|
||||
static func check_block_kasseta_y5(status_prd: PackedByteArray, y5_config: Dictionary, flag_not_trust: bool) -> Dictionary:
|
||||
y5_config.yau07 = not flag_not_trust
|
||||
if y5_config.yau07:
|
||||
y5_config.ems = (status_prd[0] & 1) and ((status_prd[0] >> 4) & 1)
|
||||
y5_config.ug = (status_prd[0] >> 1) & 1
|
||||
y5_config.ukp1 = (status_prd[0] >> 2) & 1
|
||||
y5_config.ukp2 = (status_prd[0] >> 3) & 1
|
||||
return y5_config
|
||||
|
||||
|
||||
@@ -860,7 +879,6 @@ static func _should_apply_rule(fs_num: int, rule: Dictionary, results: Dictionar
|
||||
return bool(fs_num >= rule.min and fs_num < rule.max) and results.has(rule.key)
|
||||
|
||||
|
||||
|
||||
## Получение мощности при выполнении контроля
|
||||
static func power_um_ukp(status: PackedByteArray, litera: int, pwr_result: Array) -> Array:
|
||||
const Constants: Dictionary = {'POWER_UKP_1' : 31, 'POWER_UKP_2': 63}
|
||||
|
||||
Reference in New Issue
Block a user