diff --git a/scenes/pribor-prd-v/pribor_prd_v.gd b/scenes/pribor-prd-v/pribor_prd_v.gd index 01f9134..76a70d2 100644 --- a/scenes/pribor-prd-v/pribor_prd_v.gd +++ b/scenes/pribor-prd-v/pribor_prd_v.gd @@ -49,7 +49,7 @@ func set_default_state() -> void: $kasseta_P_1/ref_A21.state = STATE_VAL.NONE $maa2000_A23.state = STATE_VAL.NONE $maa2000_A22.state = STATE_VAL.NONE - + for group in get_tree().get_nodes_in_group('power_amplifier'): group.state = STATE_VAL.NONE @@ -246,7 +246,7 @@ func on_fs_update_state(packet_type_7: Dictionary): $kasseta_FS_VD/ref_A3.state = STATE_VAL.GOOD if packet_type_7[fs].isg == 1 else STATE_VAL.ERROR if packet_type_7[fs].isg == 0 else STATE_VAL.NONE if fs == 15 and last_part == '2в': $kasseta_FS_VD/ref_A3.state = STATE_VAL.GOOD if packet_type_7[fs].isg == 1 else STATE_VAL.ERROR if packet_type_7[fs].isg == 0 else STATE_VAL.NONE - + if fs == 16 and last_part == '1в': $kasseta_FS_VD/ref_A4.state = STATE_VAL.GOOD if packet_type_7[fs].isg == 1 else STATE_VAL.ERROR if packet_type_7[fs].isg == 0 else STATE_VAL.NONE if fs == 17 and last_part == '4в': @@ -255,4 +255,3 @@ func on_fs_update_state(packet_type_7: Dictionary): $kasseta_FS_VD/ref_A4.state = STATE_VAL.GOOD if packet_type_7[fs].isg == 1 else STATE_VAL.ERROR if packet_type_7[fs].isg == 0 else STATE_VAL.NONE if fs == 19 and last_part == '2в': $kasseta_FS_VD/ref_A4.state = STATE_VAL.GOOD if packet_type_7[fs].isg == 1 else STATE_VAL.ERROR if packet_type_7[fs].isg == 0 else STATE_VAL.NONE - diff --git a/scenes/pribor-uyep/sch3-view.gd b/scenes/pribor-uyep/sch3-view.gd index 1f5a4d9..665e6a6 100644 --- a/scenes/pribor-uyep/sch3-view.gd +++ b/scenes/pribor-uyep/sch3-view.gd @@ -64,6 +64,7 @@ func on_toggled_switch(val: bool, meta: Array, unit_sch3): regs_holding[on_addr] = tools.set_bit(regs_holding[on_addr], on_bit, val) regs_holding[off_addr] = tools.set_bit(regs_holding[off_addr], off_bit, not val) unit_sch3.push_write_holding(regs_holding) + print_debug(regs_holding) func _enter_tree() -> void: @@ -137,7 +138,7 @@ func on_input(base_addr: int, data: Array, unit_sch3): var byte1: int = bits[2] # Адрес регистра var bit1: int = bits[3] # Индекс бита var val0: bool = regs_holding[byte0] & (1 << bit0) > 0 - item.button_pressed = val0 + item.set_pressed_no_signal(val0) item.disabled = false regs_holding[byte1] = tools.set_bit(regs_holding[byte1], bit1, not val0) unit_sch3.push_write_holding(regs_holding) diff --git a/scenes/pribor-uyep/sch3.tscn b/scenes/pribor-uyep/sch3.tscn index 2905b58..a175a03 100644 --- a/scenes/pribor-uyep/sch3.tscn +++ b/scenes/pribor-uyep/sch3.tscn @@ -136,6 +136,17 @@ theme_override_font_sizes/font_size = 17 text = "УФ" vertical_alignment = 1 +[node name="switch0" type="CheckButton" parent="margin/vbox/table" groups=["bits_items_switch", "c111"]] +editor_description = "Питание УФ" +material = SubResource("ShaderMaterial_c1mqk") +layout_mode = 2 +size_flags_horizontal = 2 +tooltip_text = "Выключатель питания УФ" +button_pressed = true +action_mode = 0 +script = ExtResource("7_l6esm") +metadata/bits = [0, 0, 2, 0] + [node name="state1" type="TextureRect" parent="margin/vbox/table" groups=["bits_items_good"]] custom_minimum_size = Vector2(24, 24) layout_mode = 2 diff --git a/scripts/prd.gd b/scripts/prd.gd index 2141471..8d4e326 100644 --- a/scripts/prd.gd +++ b/scripts/prd.gd @@ -347,7 +347,7 @@ func on_data_capsrpb_received(unit0: capsrpb.CapsRpb): if not unit0.json_dic.has('ts'): return if unit0.json_dic['ts'] != 7: return if not unit0.json_dic.has('msfs'): return - + var msfs = unit0.json_dic['msfs'] for fs in msfs: if fs is Dictionary: