отладка контроля

This commit is contained in:
2025-03-12 09:23:13 +03:00
parent a3116584bb
commit ee7cd7a3c8
17 changed files with 162 additions and 58 deletions

View File

@@ -441,6 +441,7 @@ stretch_mode = 0
[node name="texture_save_config" type="TextureButton" parent="Background/switch_panel" groups=["burger_gr"]]
self_modulate = Color(1, 1, 0.941, 0.85)
layout_mode = 0
offset_left = -155.0
offset_top = 824.0
offset_right = -115.0
@@ -454,6 +455,7 @@ stretch_mode = 0
[node name="texture_load_config" type="TextureButton" parent="Background/switch_panel" groups=["burger_gr"]]
self_modulate = Color(1, 1, 0.941, 0.85)
layout_mode = 0
offset_left = -155.0
offset_top = 880.0
offset_right = -115.0
@@ -467,11 +469,11 @@ stretch_mode = 0
[node name="notice" type="GridContainer" parent="Background"]
layout_mode = 0
offset_left = 280.0
offset_top = 944.0
offset_right = 864.0
offset_bottom = 984.0
columns = 4
offset_left = 1098.0
offset_top = 937.0
offset_right = 1832.0
offset_bottom = 1000.0
columns = 3
[node name="lbl_commit" type="Label" parent="Background/notice"]
layout_mode = 2

26
README.md Normal file
View File

@@ -0,0 +1,26 @@
# ТПО для сдачи по ТУ приборов ПРД
## Описание
Программа для управления блоками ФС и УМ в приборах ПРД.
Производит контроль и отладку прибора.
Сохраняет и загружает настройки для ячейки ЭМС-Г.
## Структура
- **Окно управления ФС и УМ**
<img src="screen_1.png" width="50%" height="50%"/>
- **Окно "Контроля"**
<img src="screen_2.png" width="50%" height="50%"/>
### Установление
1. Необходимо задать адрес на вашем устройстве для подсети 10.1.1.0 и 10.1.2.0
2. Клонируйте репозиторий:
```bash
git clone http://gitea.srez.local:3000/Maxim/PRD-TU-MP550
cd PRD-TU-MP550
```
3. Аргументы при запуске (Windows):
```bash
.\testPRD_2.0.exe --addr 3
```
* *где "3" - это адрес вашего устройства (10.1.1.3:50003)
* по умолчанию программа запускается на адресе 10.1.1.100:50100

View File

@@ -23,14 +23,14 @@ float mask(vec2 uv, float value)
float r = atan(uv.x, uv.y);
r = remap(-PI, PI, 0.0, 1.0, r);
r = step(r, value * 0.5);
uv.x = uv.x + 1.0;
uv.x = uv.x * -1.0;
uv.x += 1.0;
float l = atan(uv.x, uv.y);
l = remap(-PI, PI, 0.0, 1.0, l);
l = step(l, value * 0.5);
return r + l ;
}
@@ -41,13 +41,13 @@ vec2 rotate_uv(vec2 uv, vec2 pivot, float rotation) {
uv -= pivot;
return vec2(
cosa * uv.x - sina * uv.y,
cosa * uv.y + sina * uv.x
cosa * uv.y + sina * uv.x
) + pivot;
}
float circle(vec2 uv, float value)
{
{
float d = length(uv);
float t = smoothstep(
inner_radius + blur,
@@ -57,7 +57,7 @@ float circle(vec2 uv, float value)
outer_radius + blur,
outer_radius - blur,
d
);
);
return t;
}
@@ -79,6 +79,6 @@ void fragment(){
//d = abs(d);
d = size/d;
color *= d*t;
COLOR = vec4(color * mask * c);
}

View File

@@ -23,14 +23,14 @@ float mask(vec2 uv, float value)
float r = atan(uv.x, uv.y);
r = remap(-PI, PI, 0.0, 1.0, r);
r = step(r, value * 0.5);
uv.x = uv.x + 1.0;
uv.x = uv.x * -1.0;
uv.x += 1.0;
float l = atan(uv.x, uv.y);
l = remap(-PI, PI, 0.0, 1.0, l);
l = step(l, value * 0.5);
return r + l ;
}
@@ -41,13 +41,13 @@ vec2 rotate_uv(vec2 uv, vec2 pivot, float rotation) {
uv -= pivot;
return vec2(
cosa * uv.x - sina * uv.y,
cosa * uv.y + sina * uv.x
cosa * uv.y + sina * uv.x
) + pivot;
}
float circle(vec2 uv, float value)
{
{
float d = length(uv);
float t = smoothstep(
inner_radius + blur,
@@ -57,7 +57,7 @@ float circle(vec2 uv, float value)
outer_radius + blur,
outer_radius - blur,
d
);
);
return t;
}
@@ -79,6 +79,6 @@ void fragment(){
//d = abs(d);
d = size/d;
color *= d*t;
COLOR = vec4(color * mask * c);
}

View File

@@ -9,7 +9,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="bin/testPRD_2.0.exe"
export_path="./testPRD_2.0.exe"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false

View File

@@ -1 +1 @@
{"1":{"290":1,"292":16384,"296":0,"298":0},"2":{"290":2,"292":16384,"296":0,"298":0},"3":{"290":3,"292":16384,"296":0,"298":0},"4":{"290":4,"292":16384,"296":0,"298":32768},"5":{"290":5,"292":16384,"296":0,"298":0},"6":{"290":6,"292":16384,"296":0,"298":0},"7":{"290":7,"292":16384,"296":0,"298":0},"8":{"290":8,"292":16384,"296":0,"298":32768},"9":{"290":9,"292":16384,"296":0,"298":32768},"10":{"290":10,"292":16384,"296":0,"298":0},"11":{"290":11,"292":16384,"296":0,"298":0},"12":{"290":12,"292":16384,"296":0,"298":32768},"13":{"290":13,"292":16384,"296":0,"298":32768},"14":{"290":14,"292":16384,"296":0,"298":32768},"15":{"290":15,"292":16384,"296":0,"298":32768},"16":{"290":16,"292":16384,"296":0,"298":32768},"47":{"290":47,"292":256,"296":0,"298":32768},"48":{"290":48,"292":8192,"296":0,"298":32768},"49":{"290":49,"292":16384,"296":0,"298":32768},"50":{"290":50,"292":0,"296":16384,"298":32768},"51":{"290":51,"292":0,"296":16384,"298":32768},"52":{"290":52,"292":0,"296":16384,"298":32768},"53":{"290":53,"292":0,"296":0,"298":32768},"54":{"290":54,"292":0,"296":0,"298":32768},"55":{"290":55,"292":0,"296":0,"298":32768},"56":{"290":56,"292":0,"296":0,"298":32768},"57":{"290":57,"292":0,"296":16384,"298":32768},"58":{"290":58,"292":0,"296":0,"298":32768},"59":{"290":59,"292":0,"296":0,"298":32768},"60":{"290":60,"292":0,"296":0,"298":32768},"61":{"290":61,"292":0,"296":0,"298":32768},"62":{"290":62,"292":0,"296":0,"298":32768}}
{"1":{"290":1,"292":0,"296":8192,"298":32768},"2":{"290":2,"292":0,"296":8192,"298":0},"3":{"290":3,"292":0,"296":8192,"298":32768},"4":{"290":4,"292":0,"296":8192,"298":32768},"5":{"290":5,"292":0,"296":8192,"298":32768},"6":{"290":6,"292":0,"296":8192,"298":32768},"7":{"290":7,"292":0,"296":8192,"298":32768},"8":{"290":8,"292":0,"296":8192,"298":32768},"9":{"290":9,"292":0,"296":8192,"298":32768},"10":{"290":10,"292":0,"296":8192,"298":32768},"11":{"290":11,"292":0,"296":8192,"298":0},"12":{"290":12,"292":0,"296":8192,"298":32768},"13":{"290":13,"292":0,"296":8192,"298":0},"14":{"290":14,"292":0,"296":8192,"298":0},"15":{"290":15,"292":0,"296":8192,"298":0},"16":{"290":16,"292":0,"296":8192,"298":32768},"47":{"290":47,"292":256,"296":0,"298":32768},"48":{"290":48,"292":8192,"296":0,"298":32768},"49":{"290":49,"292":16384,"296":0,"298":32768},"50":{"290":50,"292":0,"296":8192,"298":32768},"51":{"290":51,"292":0,"296":16384,"298":32768},"52":{"290":52,"292":0,"296":16384,"298":32768},"53":{"290":53,"292":0,"296":0,"298":32768},"54":{"290":54,"292":0,"296":0,"298":32768},"55":{"290":55,"292":0,"296":0,"298":32768},"56":{"290":56,"292":0,"296":0,"298":32768},"57":{"290":57,"292":0,"296":8192,"298":32768},"58":{"290":58,"292":0,"296":0,"298":32768},"59":{"290":59,"292":0,"296":0,"298":32768},"60":{"290":60,"292":0,"296":0,"298":32768},"61":{"290":61,"292":0,"296":0,"298":32768},"62":{"290":62,"292":0,"296":0,"298":32768}}

BIN
screen_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

34
screen_1.png.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://uku4lt0yiutm"
path="res://.godot/imported/screen_1.png-fed41d657f299dafb50407f0b4e36df6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://screen_1.png"
dest_files=["res://.godot/imported/screen_1.png-fed41d657f299dafb50407f0b4e36df6.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
screen_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

34
screen_2.png.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bam4e067s74on"
path="res://.godot/imported/screen_2.png-74671ef65bcb0507a0b9dcf13e41c770.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://screen_2.png"
dest_files=["res://.godot/imported/screen_2.png-74671ef65bcb0507a0b9dcf13e41c770.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -59,12 +59,16 @@ func _ready() -> void:
node_select_yau_07b = $TabContainer/PRD/body_grid/litera_2_4_6/yau07b_control
draw_tabl(node_select_yau_07b, Constants.ROWS_YAU_07B_2, Constants.ROWS_YAU_07B_2.size())
node_select_yau_07b.set_columns_min_size([160, 120])
node_select_yau_07b.get_node2(1, 1).get_child(1).tooltip_text = 'Переключение запрета си в уф'
node_select_yau_07b.get_node2(1, 5).get_child(1).tooltip_text = 'Переключение сигнала ФГОЗ'
# Таблица ЯУ-07б-2
node_select_yau_07b_2 = $TabContainer/PRD/body_grid/litera_3_5_7/yau07b_control
draw_tabl(node_select_yau_07b_2, Constants.ROWS_YAU_07B_2, Constants.ROWS_YAU_07B_2.size())
node_select_yau_07b_2.set_columns_min_size([160, 120])
node_select_yau_07b_2.get_node2(1, 1).get_child(1).tooltip_text = 'Переключение запрета си в уф'
node_select_yau_07b_2.get_node2(1, 5).get_child(1).tooltip_text = 'Переключение сигнала ФГОЗ'
# Таблица ЯУ-07б-3
var node_select_yau_07b_3: Node = $TabContainer/PRD/body_grid/litera_1/yau07b_control
draw_tabl(node_select_yau_07b_3, Constants.ROWS_YAU_07B_2, Constants.ROWS_YAU_07B_2.size())
@@ -83,7 +87,7 @@ func _ready() -> void:
node_select_fs_2.set_columns_min_size([150, 120, 150])
node_select_fs_2.get_node2(1, 4).add_item('Const')
node_select_fs_2.get_node2(1, 4).add_item('MSK')
#Таблица ФС-3
node_select_fs_3 = $TabContainer/PRD/body_grid/litera_1/fs_control
draw_tabl(node_select_fs_3, Constants.ROWS_FS, Constants.ROWS_FS.size())

View File

@@ -79,8 +79,8 @@ func _ready() -> void:
$soc_y5/yau_07b,
$soc_y5/ems_g,
$soc_y5/ug,
$soc_y5/ukp_2,
$soc_y5/ukp_1,
$soc_y5/ukp_2,
$soc_P1/MAA_1,
$soc_P1/MAA_2,
@@ -450,13 +450,13 @@ func _on_start_super_control():
if TMP_1 > 70:
um_cell_ind[i_temperature].value0 = TMP_1
um_cell_ind[i_temperature].state = Constants.STATE_VAL.ERROR
_on_contol_err()
logger.warning('❌ Температура УМ %s = %d' % [um_cell_ind[i_temperature].fname, TMP_1])
else:
um_cell_ind[i_temperature].value0 = TMP_1
if TMP_2 > 70:
um_cell_ind[i_temperature+6].value0 = TMP_2
um_cell_ind[i_temperature+6].state = Constants.STATE_VAL.ERROR
_on_contol_err()
logger.warning('❌ Температура %s: %d' % [um_cell_ind[i_temperature+6].fname, TMP_2])
else:
um_cell_ind[i_temperature+6].value0 = TMP_2
if Constants.CURRENT_MODE == Constants.MODE.PRD_K:
@@ -465,8 +465,7 @@ func _on_start_super_control():
var TEMPERATURE = Constants.CONST_MIN_TEMP + (Constants.MAXIMUM_CODE_ADC - temperature_litera_1) * Constants.TEMP + 3
if TEMPERATURE > 70:
um_cell_ind[12].value0 = TEMPERATURE
_on_contol_err()
return
logger.warning('❌ Температура %s = %d' % [um_cell_ind[12].fname, TEMPERATURE])
else:
um_cell_ind[12].value0 = TEMPERATURE
@@ -482,37 +481,39 @@ func _on_start_super_control():
$soc_y5/yau_07b.state = Constants.STATE_VAL.ERROR
logger.error("❌ ЯУ-07Б: Нет связи")
_on_contol_err()
return
if Network.unit_fs.online:
var fs_freq: Array
var fs_att_1: float
var fs_att_2: float
var fs_att_3: float
if Constants.CURRENT_MODE == Constants.MODE.PRD_H:
fs_freq.append(Constants.FS_FREQ.f2)
fs_att_1 = Constants.FS_ATT['ПРД-Н1'][0]
fs_freq.append(Constants.FS_FREQ.f3)
fs_att_2 = Constants.FS_ATT['ПРД-Н1'][1]
elif Constants.CURRENT_MODE == Constants.MODE.PRD_B:
fs_freq.append(Constants.FS_FREQ.f4)
fs_att_1 = Constants.FS_ATT['ПРД-В1'][0]
fs_freq.append(Constants.FS_FREQ.f5)
fs_att_2 = Constants.FS_ATT['ПРД-В1'][1]
elif Constants.CURRENT_MODE == Constants.MODE.PRD_K:
fs_freq.append(Constants.FS_FREQ.f6)
fs_att_1 = Constants.FS_ATT['ПРД-К1'][0]
fs_freq.append(Constants.FS_FREQ.f7)
fs_att_2 = Constants.FS_ATT['ПРД-К1'][1]
fs_freq.append(Constants.FS_FREQ.f1)
fs_att_3 = Constants.FS_ATT['ПРД-К1'][2]
fs_3_setup(fs_freq[2], fs_att_3)
logger.info('🛈 Настройка модулей ФС %s Гц, [%s / %s / %s] АТТ' % [str(fs_freq), str(fs_att_1), str(fs_att_2), str(fs_att_3)])
fs_1_setup(fs_freq[0], fs_att_1) # Гц
fs_2_setup(fs_freq[1], fs_att_2) # Гц
else:
logger.info('❌ Настройка модулей ФС')
_on_contol_err()
if flag_continue_control:
if Network.unit_fs.online:
var fs_freq: Array
var fs_att_1: float
var fs_att_2: float
var fs_att_3: float
if Constants.CURRENT_MODE == Constants.MODE.PRD_H:
fs_freq.append(Constants.FS_FREQ.f2)
fs_att_1 = Constants.FS_ATT['ПРД-Н1'][0]
fs_freq.append(Constants.FS_FREQ.f3)
fs_att_2 = Constants.FS_ATT['ПРД-Н1'][1]
elif Constants.CURRENT_MODE == Constants.MODE.PRD_B:
fs_freq.append(Constants.FS_FREQ.f4)
fs_att_1 = Constants.FS_ATT['ПРД-В1'][0]
fs_freq.append(Constants.FS_FREQ.f5)
fs_att_2 = Constants.FS_ATT['ПРД-В1'][1]
elif Constants.CURRENT_MODE == Constants.MODE.PRD_K:
fs_freq.append(Constants.FS_FREQ.f6)
fs_att_1 = Constants.FS_ATT['ПРД-К1'][0]
fs_freq.append(Constants.FS_FREQ.f7)
fs_att_2 = Constants.FS_ATT['ПРД-К1'][1]
fs_freq.append(Constants.FS_FREQ.f1)
fs_att_3 = Constants.FS_ATT['ПРД-К1'][2]
fs_3_setup(fs_freq[2], fs_att_3)
logger.info('🛈 Настройка модулей ФС %s Гц, [%s / %s / %s] АТТ' % [str(fs_freq), str(fs_att_1), str(fs_att_2), str(fs_att_3)])
fs_1_setup(fs_freq[0], fs_att_1) # Гц
fs_2_setup(fs_freq[1], fs_att_2) # Гц
else:
logger.info('❌ Настройка модулей ФС')
_on_contol_err()
func _status_cell(status):
@@ -528,6 +529,7 @@ func _status_cell(status):
node_cell_ind[i].state = Constants.STATE_VAL.ERROR
logger.error("%s : Нет связи" % node_cell_ind[i].get('fname'))
_on_contol_err()
return
#dry_contact
if (node_cell_ind[2].state == Constants.STATE_VAL.GOOD):
@@ -750,7 +752,9 @@ func _on_contol_err():
logger.warning('❌❌❌')
flag_continue_control = false
_status_prd()
#timer.start(5)
timer.wait_time = 5.0
timer.one_shot = true
timer.start()
func _status_prd():

BIN
testPRD_2.0.exe Normal file

Binary file not shown.