Модификация провекри и результата контроля ум, если 3 луча проходят по мощности, то ум считается исправным
This commit is contained in:
@@ -69,31 +69,28 @@ static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dicti
|
||||
i_node_temperature.value1 = temperature_dic[temperature_meta]
|
||||
|
||||
|
||||
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier: Array, POWER_THRESHOLD: int) -> void:
|
||||
for i_powapm in power_amplifier:
|
||||
var powamp_meta: String = i_powapm.get_meta('um')
|
||||
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void:
|
||||
for i_node_temperature in power_amplifier_arr_node:
|
||||
var powamp_meta: String = i_node_temperature.get_meta('um')
|
||||
var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE
|
||||
if not pow_dic.has(powamp_meta): return
|
||||
if pow_dic:
|
||||
if not pow_dic.has(powamp_meta):
|
||||
break
|
||||
if pow_dic[powamp_meta].size() < 6:
|
||||
status = STATE_VAL.ERROR
|
||||
else:
|
||||
if powamp_meta == 'um_8' and not fs_result.fs_1: return
|
||||
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_6: return
|
||||
if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_7: return
|
||||
# Проверки fs_result
|
||||
if powamp_meta == 'um_8' and not fs_result.fs_1: return
|
||||
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_6: return
|
||||
if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_7: return
|
||||
|
||||
if powamp_meta == 'um_8':
|
||||
i_powapm.value0 = [pow_dic[powamp_meta][5]]
|
||||
if pow_dic[powamp_meta][5] < POWER_THRESHOLD:
|
||||
status = STATE_VAL.ERROR
|
||||
else:
|
||||
i_powapm.value0 = pow_dic[powamp_meta]
|
||||
for i_p in pow_dic[powamp_meta]:
|
||||
if i_p < POWER_THRESHOLD:
|
||||
status = STATE_VAL.ERROR
|
||||
i_powapm.state = status
|
||||
if powamp_meta == 'um_8':
|
||||
i_node_temperature.value0 = [pow_dic[powamp_meta][5]]
|
||||
status = STATE_VAL.ERROR if pow_dic[powamp_meta][5] < POWER_THRESHOLD else STATE_VAL.GOOD
|
||||
else:
|
||||
i_node_temperature.value0 = pow_dic[powamp_meta]
|
||||
# Проверки 3 значения = исправен
|
||||
var count_above_threshold = 0
|
||||
for i_p in pow_dic[powamp_meta]:
|
||||
if i_p >= POWER_THRESHOLD:
|
||||
count_above_threshold += 1
|
||||
status = STATE_VAL.GOOD if count_above_threshold >= 3 else STATE_VAL.ERROR
|
||||
i_node_temperature.state = status
|
||||
|
||||
|
||||
func on_press_device() -> void:
|
||||
|
||||
@@ -75,9 +75,12 @@ static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifi
|
||||
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_2: return
|
||||
if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_3: return
|
||||
i_node_powapm.value0 = pow_dic[powamp_meta]
|
||||
var count_above_threshold = 0
|
||||
for i_p in pow_dic[powamp_meta]:
|
||||
if i_p < POWER_THRESHOLD:
|
||||
status = STATE_VAL.ERROR
|
||||
if i_p >= POWER_THRESHOLD:
|
||||
count_above_threshold += 1
|
||||
|
||||
status = STATE_VAL.GOOD if count_above_threshold >= 3 else STATE_VAL.ERROR
|
||||
i_node_powapm.state = status
|
||||
|
||||
|
||||
|
||||
@@ -66,21 +66,21 @@ static func temperature_fill(temperature_arr_node: Array, temperature_dic: Dicti
|
||||
i_node_temperature.value1 = temperature_dic[temperature_meta]
|
||||
|
||||
|
||||
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier: Array, POWER_THRESHOLD: int) -> void:
|
||||
for i_powapm in power_amplifier:
|
||||
var powamp_meta: String = i_powapm.get_meta('um')
|
||||
static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifier_arr_node: Array, POWER_THRESHOLD: int) -> void:
|
||||
for i_node_powapm in power_amplifier_arr_node:
|
||||
var powamp_meta: String = i_node_powapm.get_meta('um')
|
||||
var status = STATE_VAL.GOOD if pow_dic else STATE_VAL.NONE
|
||||
if not pow_dic.has(powamp_meta): return
|
||||
if pow_dic[powamp_meta].size() < 6:
|
||||
status = STATE_VAL.ERROR
|
||||
else:
|
||||
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_4: return
|
||||
if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_5: return
|
||||
i_powapm.value0 = pow_dic[powamp_meta]
|
||||
for i_p in pow_dic[powamp_meta]:
|
||||
if i_p < POWER_THRESHOLD:
|
||||
status = STATE_VAL.ERROR
|
||||
i_powapm.state = status
|
||||
if powamp_meta in ['um_1', 'um_2', 'um_3', 'um_4', 'um_5', 'um_6'] and not fs_result.fs_4: return
|
||||
if powamp_meta in ['um_9', 'um_10', 'um_11', 'um_12', 'um_13', 'um_14'] and not fs_result.fs_5: return
|
||||
i_node_powapm.value0 = pow_dic[powamp_meta]
|
||||
var count_above_threshold = 0
|
||||
for i_p in pow_dic[powamp_meta]:
|
||||
if i_p >= POWER_THRESHOLD:
|
||||
count_above_threshold += 1
|
||||
|
||||
status = STATE_VAL.GOOD if count_above_threshold >= 3 else STATE_VAL.ERROR
|
||||
i_node_powapm.state = status
|
||||
|
||||
|
||||
func on_press_device() -> void:
|
||||
|
||||
Reference in New Issue
Block a user