Изменения границ температур на усилителях в контроле

This commit is contained in:
TotMaxim
2025-11-17 15:07:29 +03:00
parent 208406971f
commit dc362ad26f
6 changed files with 8 additions and 57 deletions

View File

@@ -65,7 +65,7 @@ layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
strips_rotation = 15.0
text = "СПРС"
text = "JTIDS"
metadata/rfi_name = "sprs"
[node name="btn_kupd" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]

View File

@@ -147,6 +147,6 @@ layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
strips_rotation = 30.0
text = "ЕПРЛС"
text = "ЕРЛС"
disabled = true
metadata/rfi_name = "eprls"

View File

@@ -17,10 +17,8 @@ func _ready() -> void:
var power_amplifier: Array = get_tree().get_nodes_in_group('power_amplifier')
for temp in power_amplifier:
temp.value1 = -70
temp.max_value1 = 70
temp.min_value1 = -40
unit_prd_n.connect('control_is_over', Callable(self, 'on_press_device'))
#unit_prd_n.power_amplify = power_amplifier
start_control()
on_press_device()

View File

@@ -83,53 +83,6 @@ static func power_fill(pow_dic: Dictionary, fs_result: Dictionary, power_amplifi
i_powapm.state = status
## Проверка температур УМ от УКП
static func check_temperature_um(status_prd: PackedByteArray, power_amplifier: Array) -> bool:
if power_amplifier.size() < 1: return false
const Constants: Dictionary = {
'CONST_MIN_TEMP': -25,
'MAXIMUM_CODE_ADC': 3796,
'MINIMUM_CODE_AD': 2660,
'TEMPERATURE_UKP_1': 47,
'TEMPERATURE_UKP_2': 79,
}
const TEMP: float = 115.0 / (Constants.MAXIMUM_CODE_ADC - Constants.MINIMUM_CODE_AD)
var ukp1_online: int = (status_prd[0] >> 2) & 1
var ukp2_online = (status_prd[0] >> 3) & 1
var all_temp_is_ok: bool = true
if ukp1_online:
var tmp_1: int
var temperature_ukp_1: int
for i_temp in 6:
temperature_ukp_1 = status_prd.decode_u16(Constants.TEMPERATURE_UKP_1 + 2 * i_temp)
tmp_1 = round(Constants.CONST_MIN_TEMP + (Constants.MAXIMUM_CODE_ADC - temperature_ukp_1) * TEMP + 3)
power_amplifier[i_temp].value1 = tmp_1
if tmp_1>70:
all_temp_is_ok = false
if power_amplifier.size() > 12: # Темпуратура от УМ литеры 1
temperature_ukp_1 = status_prd.decode_u16(Constants.TEMPERATURE_UKP_1 + 2 * 7)
tmp_1 = round(Constants.CONST_MIN_TEMP + (Constants.MAXIMUM_CODE_ADC - temperature_ukp_1) * TEMP + 3)
power_amplifier[6].value1 = tmp_1
if tmp_1>70:
all_temp_is_ok = false
if ukp2_online:
for i_temp in 6:
var temperature_ukp_2: int = status_prd.decode_u16(Constants.TEMPERATURE_UKP_2 + 2 * i_temp)
var tmp_2: int = round(Constants.CONST_MIN_TEMP + (Constants.MAXIMUM_CODE_ADC - temperature_ukp_2) * TEMP + 3)
if power_amplifier.size() > 12:
power_amplifier[i_temp+7].value1 = tmp_2
if tmp_2>70:
all_temp_is_ok = false
else:
power_amplifier[i_temp+6].value1 = tmp_2
if tmp_2>70:
all_temp_is_ok = false
return all_temp_is_ok
func on_press_device() -> void:
var nodes_y5: Array = get_tree().get_nodes_in_group('y-5')
var node_ip_power_arr: Array = get_tree().get_nodes_in_group('power_supply')

View File

@@ -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:
@@ -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 = 70.0
max_value1 = 60.0
step0 = 1.0
step1 = 1.0
value_name0 = "P,%"
@@ -479,7 +479,7 @@ tooltip_text = "
Диапазон: -40.00…70.00"
mouse_filter = 0
min_value = -40.0
max_value = 70.0
max_value = 60.0
fill_mode = 3
nine_patch_stretch = true
stretch_margin_left = 8

View File

@@ -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 = 70.0
max_value1 = 60.0
step0 = 1.0
step1 = 1.0
value_name0 = "P,%"
@@ -369,7 +369,7 @@ tooltip_text = "
Диапазон: -40.00…70.00"
mouse_filter = 0
min_value = -40.0
max_value = 70.0
max_value = 60.0
value = -40.0
fill_mode = 3
nine_patch_stretch = true