From 0ba81a514799f231b0dd619c23f096b35c7595da Mon Sep 17 00:00:00 2001 From: Razvalyaev Date: Tue, 8 Jul 2025 17:48:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BA=D1=83=D1=83=D1=83=D1=87=D1=83=20=D0=B2?= =?UTF-8?q?=D1=81=D0=B5=D0=B3=D0=BE=20=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit базово разделены gui файлы и обработки xml базово работает, надо дорабатывать и тестить --- VariableSelector.py | 168 ++ __pycache__/VariableSelector.cpython-313.pyc | Bin 0 -> 8873 bytes __pycache__/generateVars.cpython-313.pyc | Bin 16732 -> 18398 bytes __pycache__/parseMakefile.cpython-313.pyc | Bin 6430 -> 6430 bytes __pycache__/scanVars.cpython-313.pyc | Bin 37408 -> 40570 bytes __pycache__/setupVars.cpython-313.pyc | Bin 0 -> 8895 bytes debug_vars.c | 43 +- generateVars.py | 54 +- scanVars.py | 140 +- setupVars.py | 708 ++--- setupVars_GUI.py | 666 +++++ setupVars_out.py | 581 ++++ vars.xml | 2769 ++++++++++-------- 13 files changed, 3309 insertions(+), 1820 deletions(-) create mode 100644 VariableSelector.py create mode 100644 __pycache__/VariableSelector.cpython-313.pyc create mode 100644 __pycache__/setupVars.cpython-313.pyc create mode 100644 setupVars_GUI.py create mode 100644 setupVars_out.py diff --git a/VariableSelector.py b/VariableSelector.py new file mode 100644 index 0000000..6010e53 --- /dev/null +++ b/VariableSelector.py @@ -0,0 +1,168 @@ +import re +from PySide6.QtWidgets import ( + QDialog, QTreeWidget, QTreeWidgetItem, QVBoxLayout, QPushButton, + QLineEdit, QLabel, QHeaderView +) +from PySide6.QtCore import Qt +from setupVars import * +from scanVars import * + + +array_re = re.compile(r'^(\w+)\[(\d+)\]$') + +class VariableSelectorDialog(QDialog): + def __init__(self, all_vars, structs, typedefs, parent=None): + super().__init__(parent) + self.setWindowTitle("Выбор переменных") + self.resize(600, 500) + self.selected_names = [] + + self.all_vars = all_vars + self.structs = structs + self.typedefs = typedefs + self.expanded_vars = [] + self.var_map = {v['name']: v for v in all_vars} + + self.search_input = QLineEdit() + self.search_input.setPlaceholderText("Поиск по имени переменной...") + self.search_input.textChanged.connect(self.filter_tree) + + self.tree = QTreeWidget() + self.tree.setHeaderLabels(["Имя переменной", "Тип"]) + self.tree.setSelectionMode(QTreeWidget.ExtendedSelection) + self.tree.setRootIsDecorated(False) # без иконки "вложенность" + self.tree.setUniformRowHeights(True) + + # --- Автоматическая ширина колонок + self.tree.setStyleSheet(""" + QTreeWidget::item:selected { + background-color: #87CEFA; + color: black; + } + QTreeWidget::item:hover { + background-color: #D3D3D3; + } + """) + + self.btn_add = QPushButton("Добавить выбранные") + self.btn_add.clicked.connect(self.on_add_clicked) + + layout = QVBoxLayout() + layout.addWidget(QLabel("Поиск:")) + layout.addWidget(self.search_input) + layout.addWidget(self.tree) + layout.addWidget(self.btn_add) + self.setLayout(layout) + + self.populate_tree() + + def add_tree_item_recursively(self, parent, var): + """ + Рекурсивно добавляет переменную и её дочерние поля в дерево. + Если parent == None, добавляет на верхний уровень. + """ + name = var['name'] + type_str = var.get('type', '') + show_var = var.get('show_var', 'false') == 'true' + + item = QTreeWidgetItem([name, type_str]) + item.setData(0, Qt.UserRole, name) + + for i, attr in enumerate(['file', 'extern', 'static']): + item.setData(0, Qt.UserRole + 1 + i, var.get(attr)) + + if show_var: + item.setForeground(0, Qt.gray) + item.setForeground(1, Qt.gray) + item.setToolTip(0, "Уже добавлена") + item.setToolTip(1, "Уже добавлена") + + if parent is None: + self.tree.addTopLevelItem(item) + else: + parent.addChild(item) + + for child in var.get('children', []): + self.add_tree_item_recursively(item, child) + + + def populate_tree(self): + self.tree.clear() + + expanded_vars = expand_vars(self.all_vars, self.structs, self.typedefs) + + for var in expanded_vars: + self.add_tree_item_recursively(None, var) + + header = self.tree.header() + header.setSectionResizeMode(0, QHeaderView.Stretch) + header.setSectionResizeMode(1, QHeaderView.ResizeToContents) + + def filter_tree(self): + text = self.search_input.text().strip().lower() + + def match_recursive(item): + matched = False + for i in range(item.childCount()): + child = item.child(i) + if match_recursive(child): + matched = True + + # Проверяем текущий элемент + name = item.text(0).lower() + typ = item.text(1).lower() + if text in name or text in typ: + matched = True + + item.setHidden(not matched) + # Открываем только те элементы, у которых есть совпадение в потомках или в себе + item.setExpanded(matched) + return matched + + for i in range(self.tree.topLevelItemCount()): + match_recursive(self.tree.topLevelItem(i)) + + + def on_add_clicked(self): + self.selected_names = [] + + for item in self.tree.selectedItems(): + name = item.text(0) # имя переменной (в колонке 1) + type_str = item.text(1) # тип переменной (в колонке 2) + + if not name or not type_str: + continue + + self.selected_names.append((name, type_str)) + + if name in self.var_map: + # Если переменная уже есть, просто включаем её и показываем + var = self.var_map[name] + var['show_var'] = 'true' + var['enable'] = 'true' + else: + # Создаём новый элемент переменной + # Получаем родительские параметры + file_val = item.data(0, Qt.UserRole + 1) + extern_val = item.data(0, Qt.UserRole + 2) + static_val = item.data(0, Qt.UserRole + 3) + + new_var = { + 'name': name, + 'type': type_str, + 'show_var': 'true', + 'enable': 'true', + 'shortname': name, + 'pt_type': '', + 'iq_type': '', + 'return_type': 'iq_none', + 'file': file_val, + 'extern': str(extern_val).lower() if extern_val else 'false', + 'static': str(static_val).lower() if static_val else 'false', + } + + # Добавляем в список переменных + self.all_vars.append(new_var) + self.var_map[name] = new_var # Чтобы в будущем не добавлялось повторно + + self.accept() \ No newline at end of file diff --git a/__pycache__/VariableSelector.cpython-313.pyc b/__pycache__/VariableSelector.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a7a0ce9a09198a127c6cb3e5ed38c4371ae4444d GIT binary patch literal 8873 zcmbVSYj6`+mhRTGWwnrP8NVO$8`;=Sz{X&}Kx_gw*u;_rWb8pDq{dbvOU_jbaFX5f z&hG5m8+Ne6QrH`6t=Uc0z}8falilnvnSq)7+Wo0sDM;x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_*PEwcSwiY0aXq6tSQJ$Owp`0V`{JiWN{Ag+a>HNMS zCq>YCAQ<)m5bE#TWOy3w-h={0-(u*j7co&p%9Ds9PA`bi^%4(6n86)I1ZgW zthmMO_QQweA+@8Wh8GVh2XYY~6n}z|v)WQtyI{4atj&V8Ibm&0Svv%4N5a~bvi1np zo`e++?|;x0nyQ{PQN?9T{EfNgxm4LMp=?*8towdZ&%%)}*s7JmwV~CaRP`>Qde{2P ziRzyF>>dCP#e1IjrFf!|eCZA-ugl*kfF)nBtTW+F;b8r3p3_DhqmRQtV&KoaF|$4k z06~6<94F$|D4Wd-F2b!0nOf(qL3pKnQ%f`F>Um8>|?< zrxocGp6!bfh-`EvjHW?s!7z`W1rn|HSc=kORk0$v~!knr@j=~CVTGxZKO2k4PLkd)6x z1}=nOA0OeSd4#))^g4xAkB?qv;Zzc{4K~yUHEl8@$>0~_fMPv_W@XpRcmX^T6hPdKaPM72r zyw~EfPI7*jGY}14pO2g69VQt~VtA1|djcuMl_G;jUO=%yu|Pid%Cvm+m1rYoMlV7R z8{;;jPwA3wv*H-qAm%k`1m!d$Oz}BVM7J+TKrHi-rCfU6YthO8PF29?wHa;k= zyb)Xu#=3>l9ZTAD0~AZc%ht5L1&HIx2=h)y-Q5G zrhe`9)z@Qh{k-89?YGC@cVv$a*|)MZLky6RXE_AwVL05dJwJ6!v(eoVRqaA?TWj9Sdpp zw?m3u%9D67e-Jnyb{=HzZN;ab;!} zGeZpIP`q=1zN9YPrsVGIMr+Igc_jPEdvJ^I894&QV=Yb7|4o^`(P(MSHxv|4vG|&y q=-Mx-vM;GpSVio%t9^gl7cX@r%x&|`Gu?!SE?qhEHHEd*#Qy_(`&BUj literal 0 HcmV?d00001 diff --git a/__pycache__/generateVars.cpython-313.pyc b/__pycache__/generateVars.cpython-313.pyc index beac16b1e28a7b7738c8aafa1ae0d0620be7f33b..071dffd99d0862b9b3156da0fbcd9a898798c7f1 100644 GIT binary patch delta 3193 zcmb7GdrVu`89&$8FRp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AN$@DSThF|T=wcZb=&Q865;@l~W$^ zW>`u^4BtAWR9nUOZY9+zE_z66ooTU?>=m;&+g42YBD=D&8((6-ZG02Yv$0J-<0;k` zivzwEYXrOyTb4fNNAwAY=Q#{>IM3dVH#A-3<|TlfaV&FiES>J=wwM{6$eGfk;}av3 zhtpTtVtm|q7aXzd*6xpl%CImv7ADIItK<0o6kvU*CkQ*kNXeT$kH1QO<(Ml6>GG9fLh|K$F(n#jpX_Aly XBTd@Kf`=wuWFbnE9&!`YWCQsZV%2Vu diff --git a/__pycache__/parseMakefile.cpython-313.pyc b/__pycache__/parseMakefile.cpython-313.pyc index 0881c0ae764d759c42091319dbf011508171016d..5ecea53c1ea79368441d7ebb303bc62b61bed344 100644 GIT binary patch delta 20 acmbPdG|!0pGcPX}0}zPL$=S#)EC~QO&jiQ- delta 20 acmbPdG|!0pGcPX}0}xE}%ihQ>EC~QQeFXXd diff --git a/__pycache__/scanVars.cpython-313.pyc b/__pycache__/scanVars.cpython-313.pyc index 793ecb4c3fd488c448d34359edf0de55c7375cb3..2131601538a0c716a376ae8b019017f0d1e8894e 100644 GIT binary patch delta 7018 zcma)AdsNd`p8wsv-ysBy;UVFn5MC+|5g+)fimf2Sk5m*D0|^ifiQXj2IBkQiR;g`~ z-gb)J>6EkEowd`);-n8|J6hY$cDi$>J-=+6g~>AA{$YDg_w07iI@?w|+x>ojA%N1J zoqOPu`}@A`_rAX0d+*5elAFJh7{1W!H5`<(Ti%}aPYxLtl8Fn24U%vMM~nEhJ$62Q zkG)F9FUa5y$Y?Qd5h*1=StwFUc`Hbk@fm>Sd?w&helec~JVKZ8+3>xbUj$ge=Kxmn zHoz)ASES?tR_|HC=dWtzIH!{1_EhI_)#wbznK&EAFX0PBLp9yRUKp8@sE8u9BjoYA zBDbUx3E2|)U-_@|OeCQpq8v~fSzg*lba9O*;PC~5PG6^+y;8PiH@yJN&)`3>9iX4P zq2Y83&h|Vn9oH5_wFMJK%W2~c1(%XKc;t~IXAg|zjr7E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5dp!J{{sQ_8iY4~I{p z{vHY*4N(^KB3FRz53JSUj3UpJ)v(I$e3hQuy@y9+)$Xq`ZcOeM3cT1)LoEoXvy7!?j8kL<`~Qumh%spJ4aF!;keBCbTqZy#0X)*+=a~ zErJyG?v&l~9&c}7K(15rC)x;ehZ~{o@g+;6#*HM@BX>sJSZPsHlXsVlrJEdDHuOjO z`XlbmP3w{jZ6hHeQs<7U+(l7%=kY2w3cCIEcSO^R+`f<;b_YWdYKz|CDx&62B6}mU zJC#Av>26d(yHV7T64HBF7`pd&uzGlF|BeAA8I|fDqPtIM{9$iL82|bFgj8V^@oSSj zkMJ$R8wguapwt__{{+_)@&{=g{6zTx!L%dT6+CGPzK`0I3E7Hj-!+D}P^fy^0k4i| zGd!qMf^fYkZlgoEI5JmwjuM~IZ-nr@@$>^FYW)YC{;ZI7j?0E6P%iwL)5prsaT!;6 z=z%#Vk81sTPYr26gCjtmSx1knSDz^~JdBGgX><^#p2^~m;CK|$4(GC;K*iy$1Nb?Y zOkCx=%!|W|2#ViIXGN!o;+~RV=sdyvCAhlgY(&^xtep_B8We`OqbEkvXxWKYWViqa#JbmxZ27} pEW3gIst@k?QEuK{EbC*ZwyGG;7>kapGvDKMkF1(fGhCKp_CIN>V$=Wt diff --git a/__pycache__/setupVars.cpython-313.pyc b/__pycache__/setupVars.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ea3a5fd0f6efe5fb85a11160d727518dd368c29 GIT binary patch literal 8895 zcmd5?eQ+Dcb>G9+9dH0a5FkN9A_;y-Bt(jm^&*Q#x0?#TQf7645P*l{Tav3Ox^$Pg4DQN*qELAAOBU#a#K(G zPv7nVM~DI|rTM2z-C}R|?c3dV`+oc0TitayYzWfd*(a_9>k#^P{8C7UeBthQq3{X{ zq9An!3ED3uP~_bp7|5@&&m zRLdqJ@o?gLoC_x=!|{abxXdNO(LW21apO^*QyJ0(GyzJbPxFZ$erf`W)UMIOA~7Qi zJVto#zDeN)58*nJ28yW)b>@7b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now%*NL)g zcw`ff<2K@w5eQ;50OQ8A7$e>8c4$=8sDPgU?N6b9Z>R@I&2;VNw5*S zwEqN;_#cn~vM>muiM^jWt5Zg$qH?|^-LeqK3}h=>Q#1}A!bR!AqnUkK_s$fvs$&6*& zg*A^IL%x8&&i4^PM9p(%j!aCBO~tsQLJFENFo~xjgF7sW`Zcos8d>4rr>Idvjh~|9 zGCKaRsCpGuts>tS7AxiXqS{5Zec8H`s{G;twTJS5F-CbQ- 50: optional_printf(PRINT_ERROR, f"Possible typedef recursion limit reached on '{typename}'") @@ -458,6 +458,31 @@ def analyze_typedefs_and_structs_across_files(c_files, include_dirs): return resolved_typedefs, resolved_structs +def safe_parse_xml(xml_path): + """ + Безопасно парсит XML-файл. + + Возвращает кортеж (root, tree) или (None, None) при ошибках. + """ + if not xml_path or not os.path.isfile(xml_path): + print(f"Файл '{xml_path}' не найден или путь пустой") + return None, None + + try: + if os.path.getsize(xml_path) == 0: + return None, None + + tree = ET.parse(xml_path) + root = tree.getroot() + return root, tree + + except ET.ParseError as e: + print(f"Ошибка парсинга XML файла '{xml_path}': {e}") + return None, None + except Exception as e: + print(f"Неожиданная ошибка при чтении XML файла '{xml_path}': {e}") + return None, None + def read_vars_from_xml(xml_path): xml_full_path = os.path.normpath(xml_path) vars_data = {} @@ -465,9 +490,10 @@ def read_vars_from_xml(xml_path): if not os.path.exists(xml_full_path): return vars_data # пусто, если файла нет - tree = ET.parse(xml_full_path) - root = tree.getroot() - + root, tree = safe_parse_xml(xml_full_path) + if root is None: + return vars_data + vars_elem = root.find('variables') if vars_elem is None: return vars_data @@ -477,28 +503,20 @@ def read_vars_from_xml(xml_path): if not name: continue - enable_text = var_elem.findtext('enable', 'false').lower() - enable = (enable_text == 'true') - - shortname = var_elem.findtext('shortname', name) - pt_type = var_elem.findtext('pt_type', '') - iq_type = var_elem.findtext('iq_type', '') - return_type = var_elem.findtext('return_type', 'int') - - include_text = var_elem.findtext('include', 'false').lower() - include = (include_text == 'true') - - extern_text = var_elem.findtext('extern', 'false').lower() - extern = (extern_text == 'true') + def get_bool(tag, default='false'): + return var_elem.findtext(tag, default).lower() == 'true' vars_data[name] = { - 'enable': enable, - 'shortname': shortname, - 'pt_type': pt_type, - 'iq_type': iq_type, - 'return_type': return_type, - 'include': include, - 'extern': extern, + 'show_var': get_bool('show_var'), + 'enable': get_bool('enable'), + 'shortname': var_elem.findtext('shortname', name), + 'pt_type': var_elem.findtext('pt_type', ''), + 'iq_type': var_elem.findtext('iq_type', ''), + 'return_type': var_elem.findtext('return_type', 'int'), + 'type': var_elem.findtext('type', 'unknown'), + 'file': var_elem.findtext('file', ''), + 'extern': get_bool('extern'), + 'static': get_bool('static'), } return vars_data @@ -532,6 +550,7 @@ def generate_xml_output(proj_path, xml_path, unique_vars, h_files_needed, vars_n for name, info in unique_vars.items(): if name not in combined_vars: combined_vars[name] = { + 'show_var': info.get('enable', False), 'enable': info.get('enable', False), 'shortname': info.get('shortname', name), 'pt_type': info.get('pt_type', ''), @@ -550,6 +569,7 @@ def generate_xml_output(proj_path, xml_path, unique_vars, h_files_needed, vars_n # Записываем переменные с новыми полями for name, info in combined_vars.items(): var_elem = ET.SubElement(vars_elem, "var", name=name) + ET.SubElement(var_elem, "show_var").text = str(info.get('show_var', False)).lower() ET.SubElement(var_elem, "enable").text = str(info.get('enable', False)).lower() ET.SubElement(var_elem, "shortname").text = info.get('shortname', name) ET.SubElement(var_elem, "pt_type").text = info.get('pt_type', '') @@ -802,14 +822,12 @@ Usage example: externs = dict(sorted(externs.items())) typedefs = dict(sorted(typedefs.items())) structs = dict(sorted(structs.items())) - print('create structs') # Определяем путь к файлу с структурами рядом с output_xml structs_xml = os.path.join(os.path.dirname(output_xml), "structs.xml") # Записываем структуры в structs_xml write_typedefs_and_structs_to_xml(proj_path, structs_xml, typedefs, structs) - print('create vars') # Передаем путь к structs.xml относительно proj_path в vars.xml # Модифицируем generate_xml_output так, чтобы принимать и путь к structs.xml (относительный) generate_xml_output(proj_path, output_xml, vars, includes, externs, structs_xml, makefile_path) @@ -818,3 +836,39 @@ Usage example: if __name__ == "__main__": main() + +def run_scan(proj_path, makefile_path, output_xml, verbose=2): + global PRINT_LEVEL + PRINT_LEVEL = verbose + + proj_path = os.path.normpath(proj_path) + makefile_path = os.path.normpath(makefile_path) + output_xml = os.path.normpath(output_xml) + + # Проверка абсолютности путей + for path, name in [(proj_path, "Project path"), (makefile_path, "Makefile path"), (output_xml, "Output XML path")]: + if not os.path.isabs(path): + raise ValueError(f"{name} '{path}' is not an absolute path.") + + if not os.path.isdir(proj_path): + raise FileNotFoundError(f"Project path '{proj_path}' is not a directory or does not exist.") + if not os.path.isfile(makefile_path): + raise FileNotFoundError(f"Makefile path '{makefile_path}' does not exist.") + + c_files, h_files, include_dirs = parse_makefile(makefile_path) + + vars, includes, externs = analyze_variables_across_files(c_files, h_files, include_dirs) + typedefs, structs = analyze_typedefs_and_structs_across_files(c_files, include_dirs) + + vars = dict(sorted(vars.items())) + includes = get_sorted_headers(c_files, includes, include_dirs) + externs = dict(sorted(externs.items())) + typedefs = dict(sorted(typedefs.items())) + structs = dict(sorted(structs.items())) + + print("[XML] Creating structs.xml...") + structs_xml = os.path.join(os.path.dirname(output_xml), "structs.xml") + write_typedefs_and_structs_to_xml(proj_path, structs_xml, typedefs, structs) + + print("[XML] Creating vars.xml...") + generate_xml_output(proj_path, output_xml, vars, includes, externs, structs_xml, makefile_path) diff --git a/setupVars.py b/setupVars.py index 7a3fb04..9f52d92 100644 --- a/setupVars.py +++ b/setupVars.py @@ -1,50 +1,78 @@ import sys import os -import subprocess +import re import xml.etree.ElementTree as ET from generateVars import map_type_to_pt, get_iq_define, type_map from enum import IntEnum +from scanVars import * +from generateVars import * -from PySide6.QtWidgets import ( - QApplication, QWidget, QTableWidget, QTableWidgetItem, - QCheckBox, QComboBox, QLineEdit, QVBoxLayout, QHBoxLayout, QPushButton, - QCompleter, QAbstractItemView, QLabel, QMessageBox, QFileDialog, QTextEdit -) -from PySide6.QtGui import QTextCursor -from PySide6.QtCore import Qt, QProcess -class rows(IntEnum): - include = 0 - name = 1 - type = 2 - pt_type = 3 - iq_type = 4 - ret_type = 5 - short_name = 6 - -# 1. Парсим vars.xml def make_absolute_path(path, base_path): - if not os.path.isabs(path): - return os.path.abspath(os.path.join(base_path, path)) - return os.path.abspath(path) + if not os.path.isabs(path) and os.path.isdir(base_path): + try: + return os.path.abspath(os.path.join(base_path, path)) + except Exception: + pass # На случай сбоя в os.path.join или abspath + elif os.path.isabs(path): + return os.path.abspath(path) + else: + return path -def parse_vars(filename): - tree = ET.parse(filename) - root = tree.getroot() + +def make_relative_path(abs_path, base_path): + abs_path = os.path.abspath(abs_path) + base_path = os.path.abspath(base_path) + + # Разбиваем на списки директорий + abs_parts = abs_path.split(os.sep) + base_parts = base_path.split(os.sep) + + # Проверяем, является ли base_path настоящим префиксом пути (по папкам) + if abs_parts[:len(base_parts)] == base_parts: + rel_parts = abs_parts[len(base_parts):] + return "/".join(rel_parts) + + # Иначе пробуем relpath + try: + return os.path.relpath(abs_path, base_path).replace("\\", "/") + except Exception: + return abs_path.replace("\\", "/") + + +def parse_vars(filename, typedef_map=None): + root, tree = safe_parse_xml(filename) + if root is None: + return [] + + if typedef_map is None: + typedef_map = {} vars_list = [] variables_elem = root.find('variables') if variables_elem is not None: for var in variables_elem.findall('var'): name = var.attrib.get('name', '') + var_type = var.findtext('type', 'unknown').strip() + + # Вычисляем pt_type и iq_type + pt_type = var.findtext('pt_type') + if not pt_type: + pt_type = map_type_to_pt(var_type, name, typedef_map) + + iq_type = var.findtext('iq_type') + if not iq_type: + iq_type = get_iq_define(var_type) + vars_list.append({ 'name': name, + 'show_var': var.findtext('show_var', 'false'), 'enable': var.findtext('enable', 'false'), 'shortname': var.findtext('shortname', name), - 'pt_type': var.findtext('pt_type', 'pt_unknown'), - 'iq_type': var.findtext('iq_type', 'iq_none'), + 'pt_type': pt_type, + 'iq_type': iq_type, 'return_type': var.findtext('return_type', 'int'), - 'type': var.findtext('type', 'unknown'), + 'type': var_type, 'file': var.findtext('file', ''), 'extern': var.findtext('extern', 'false') == 'true', 'static': var.findtext('static', 'false') == 'true', @@ -52,31 +80,50 @@ def parse_vars(filename): return vars_list + # 2. Парсим structSup.xml def parse_structs(filename): - tree = ET.parse(filename) - root = tree.getroot() + root, tree = safe_parse_xml(filename) + if root is None: + return {}, {} structs = {} typedef_map = {} - # --- Считываем структуры --- - structs_elem = root.find('structs') - if structs_elem is not None: - for struct in structs_elem.findall('struct'): - name = struct.attrib['name'] - fields = {} - for field in struct.findall('field'): - fname = field.attrib.get('name') - ftype = field.attrib.get('type') - if fname and ftype: - fields[fname] = ftype - structs[name] = fields + def parse_struct_element(elem): + fields = {} - # --- Считываем typedef-ы --- - typedefs_elem = root.find('typedefs') + for field in elem.findall("field"): + fname = field.attrib.get("name") + ftype = field.attrib.get("type", "") + + # Проверка на вложенную структуру + nested_struct_elem = field.find("struct") + if nested_struct_elem is not None: + # Рекурсивно парсим вложенную структуру и вставляем её как подсловарь + nested_fields = parse_struct_element(nested_struct_elem) + fields[fname] = nested_fields + else: + # Обычное поле + fields[fname] = ftype + + return fields + + + + + structs_elem = root.find("structs") + if structs_elem is not None: + for struct in structs_elem.findall("struct"): + name = struct.attrib.get("name") + if name and name not in structs: + fields = parse_struct_element(struct) + structs[name] = fields + + # typedefs без изменений + typedefs_elem = root.find("typedefs") if typedefs_elem is not None: - for typedef in typedefs_elem.findall('typedef'): + for typedef in typedefs_elem.findall("typedef"): name = typedef.attrib.get('name') target_type = typedef.attrib.get('type') if name and target_type: @@ -85,486 +132,95 @@ def parse_structs(filename): return structs, typedef_map +def safe_parse_xml(xml_path): + """ + Безопасно парсит XML-файл. + + Возвращает кортеж (root, tree) или (None, None) при ошибках. + """ + if not xml_path or not os.path.isfile(xml_path): + #print(f"Файл '{xml_path}' не найден или путь пустой") + return None, None + + try: + if os.path.getsize(xml_path) == 0: + return None, None + + tree = ET.parse(xml_path) + root = tree.getroot() + return root, tree + + except ET.ParseError as e: + print(f"Ошибка парсинга XML файла '{xml_path}': {e}") + return None, None + except Exception as e: + print(f"Неожиданная ошибка при чтении XML файла '{xml_path}': {e}") + return None, None + +def expand_struct_recursively(prefix, type_str, structs, typedefs, var_attrs, depth=0): + """ + Рекурсивно разворачивает структуру. + type_str может быть строкой (имя типа) или словарём (вложенная структура). + """ + if depth > 10: + return [] + + # Если тип уже является вложенной структурой + if isinstance(type_str, dict): + fields = type_str + else: + base_type = strip_ptr_and_array(type_str) + fields = structs.get(base_type) + if not isinstance(fields, dict): + return [] + + children = [] + for field_name, field_type in fields.items(): + full_name = f"{prefix}.{field_name}" + child = { + 'name': full_name, + 'type': field_type, + 'pt_type': '', + 'file': var_attrs.get('file'), + 'extern': var_attrs.get('extern'), + 'static': var_attrs.get('static'), + } + + # Рекурсивно разворачиваем, если field_type — вложенная структура + subchildren = expand_struct_recursively(full_name, field_type, structs, typedefs, var_attrs, depth + 1) + if subchildren: + child['children'] = subchildren + + children.append(child) + + return children + + +def expand_vars(vars_list, structs, typedefs): + """ + Раскрывает структуры и массивы структур в деревья. + """ + expanded = [] + + for var in vars_list: + pt_type = var.get('pt_type', '') + raw_type = var.get('type', '') + base_type = strip_ptr_and_array(raw_type) + + fields = structs.get(base_type) + + if pt_type.startswith('pt_arr_') and isinstance(fields, dict): + new_var = var.copy() + new_var['children'] = expand_struct_recursively(var['name'], raw_type, structs, typedefs, var) + expanded.append(new_var) + + elif pt_type == 'pt_struct' and isinstance(fields, dict): + new_var = var.copy() + new_var['children'] = expand_struct_recursively(var['name'], raw_type, structs, typedefs, var) + expanded.append(new_var) + + else: + expanded.append(var) + + return expanded -class ProcessOutputWindow(QWidget): - def __init__(self, command, args): - super().__init__() - self.setWindowTitle("Поиск переменных...") - self.resize(600, 400) - - self.layout = QVBoxLayout(self) - self.output_edit = QTextEdit() - self.output_edit.setReadOnly(True) - self.layout.addWidget(self.output_edit) - - self.btn_close = QPushButton("Закрыть") - self.btn_close.setEnabled(False) - self.btn_close.clicked.connect(self.close) - self.layout.addWidget(self.btn_close) - - self.process = QProcess(self) - self.process.setProcessChannelMode(QProcess.MergedChannels) - self.process.readyReadStandardOutput.connect(self.handle_stdout) - self.process.finished.connect(self.process_finished) - - self.process.start(command, args) - - def handle_stdout(self): - data = self.process.readAllStandardOutput() - text = data.data().decode('utf-8') - self.output_edit.append(text) - - def process_finished(self): - self.output_edit.append("\n--- Процесс завершён ---") - self.btn_close.setEnabled(True) - -# 3. UI: таблица с переменными -class VarEditor(QWidget): - def __init__(self): - super().__init__() - self.vars_list = [] - self.structs = {} - self.typedef_map = {} - self.structs_xml_path = None # сюда запишем путь из - self.initUI() - - def initUI(self): - self.setWindowTitle("Variable Editor") - - # --- Поля ввода пути проекта и XML --- - - # XML Output - xml_layout = QHBoxLayout() - xml_layout.addWidget(QLabel("XML Output:")) - self.xml_output_edit = QLineEdit() - xml_layout.addWidget(self.xml_output_edit) - self.xml_output_edit.returnPressed.connect(self.read_xml_file) - btn_xml_browse = QPushButton("...") - btn_xml_browse.setFixedWidth(30) - xml_layout.addWidget(btn_xml_browse) - btn_xml_browse.clicked.connect(self.browse_xml_output) - - # Project Path - proj_layout = QHBoxLayout() - proj_layout.addWidget(QLabel("Project Path:")) - self.proj_path_edit = QLineEdit() - proj_layout.addWidget(self.proj_path_edit) - btn_proj_browse = QPushButton("...") - btn_proj_browse.setFixedWidth(30) - proj_layout.addWidget(btn_proj_browse) - btn_proj_browse.clicked.connect(self.browse_proj_path) - - # Makefile Path - makefile_layout = QHBoxLayout() - makefile_layout.addWidget(QLabel("Makefile Path (relative path):")) - self.makefile_edit = QLineEdit() - makefile_layout.addWidget(self.makefile_edit) - btn_makefile_browse = QPushButton("...") - btn_makefile_browse.setFixedWidth(30) - makefile_layout.addWidget(btn_makefile_browse) - btn_makefile_browse.clicked.connect(self.browse_makefile) - - - - # Source Output File/Directory - source_output_layout = QHBoxLayout() - source_output_layout.addWidget(QLabel("Source Output File:")) - self.source_output_edit = QLineEdit() - source_output_layout.addWidget(self.source_output_edit) - btn_source_output_browse = QPushButton("...") - btn_source_output_browse.setFixedWidth(30) - source_output_layout.addWidget(btn_source_output_browse) - btn_source_output_browse.clicked.connect(self.browse_source_output) - - - self.btn_update_vars = QPushButton("Обновить данные о переменных") - self.btn_update_vars.clicked.connect(self.update_vars_data) - - # Таблица переменных - self.table = QTableWidget(len(self.vars_list), 7) - self.table.setHorizontalHeaderLabels([ - 'Include', - 'Name', - 'Origin Type', - 'Pointer Type', - 'IQ Type', - 'Return Type', - 'Short Name' - ]) - self.table.setEditTriggers(QAbstractItemView.AllEditTriggers) - - # Кнопка сохранения - btn_save = QPushButton("Build") - btn_save.clicked.connect(self.save_build) - - # Основной layout - layout = QVBoxLayout() - layout.addLayout(xml_layout) - layout.addLayout(proj_layout) - layout.addLayout(makefile_layout) - layout.addWidget(self.btn_update_vars) - layout.addWidget(self.table) - layout.addWidget(btn_save) - layout.addLayout(source_output_layout) - - self.setLayout(layout) - - def update_vars_data(self): - proj_path = self.proj_path_edit.text().strip() - xml_path = self.xml_output_edit.text().strip() - - proj_path = os.path.abspath(self.proj_path_edit.text().strip()) - makefile_path = make_absolute_path(self.makefile_edit.text().strip(), proj_path) - - if not proj_path or not xml_path: - QMessageBox.warning(self, "Ошибка", "Пожалуйста, укажите пути проекта и XML.") - return - - if not os.path.isfile(makefile_path): - QMessageBox.warning(self, "Ошибка", f"Makefile не найден по пути:\n{makefile_path}") - return - - scanvars_exe = "scanVars.exe" - args = [proj_path, makefile_path, xml_path] - - # Создаем и показываем окно с выводом процесса - self.proc_win = ProcessOutputWindow(scanvars_exe, args) - self.proc_win.show() - - # Можно подписаться на сигнал завершения процесса, если хочешь обновить UI после - self.proc_win.process.finished.connect(lambda exitCode, exitStatus: self.after_scanvars_finished(exitCode, exitStatus)) - - - def save_build(self): - vars_out = [] - for row in range(self.table.rowCount()): - include_cb = self.table.cellWidget(row, rows.include) - if not include_cb.isChecked(): - continue - name_edit = self.table.cellWidget(row, rows.name) - pt_type_combo = self.table.cellWidget(row, rows.pt_type) - iq_combo = self.table.cellWidget(row, rows.iq_type) - ret_combo = self.table.cellWidget(row, rows.ret_type) - short_name_edit = self.table.cellWidget(row, rows.short_name) - - var_data = { - 'name': name_edit.text(), - 'type': 'pt_' + pt_type_combo.currentText(), - 'iq_type': iq_combo.currentText(), - 'return_type': ret_combo.currentText() if ret_combo.currentText() else 'int', - 'short_name': short_name_edit.text(), - } - vars_out.append(var_data) - - # Здесь нужно указать абсолютные пути к проекту, xml и output (замени на свои) - proj_path = self.proj_path_edit.text().strip() - xml_path = self.xml_output_edit.text().strip() - output_dir_c_file = self.source_output_edit.text().strip() - - # Путь к твоему exe, например - exe_path = r"generateVars.exe" - - # Формируем список аргументов - cmd = [exe_path, proj_path, xml_path, output_dir_c_file] - - try: - # Запускаем exe и ждём завершения - result = subprocess.run(cmd, capture_output=True, text=True, check=True) - except subprocess.CalledProcessError as e: - print("Error calling script:", e) - print("stderr:", e.stderr) - - def browse_proj_path(self): - dir_path = QFileDialog.getExistingDirectory(self, "Выберите папку проекта") - if dir_path: - self.proj_path_edit.setText(dir_path) - - def read_xml_file(self): - file_path = self.xml_output_edit.text().strip() - if file_path and not os.path.isfile(file_path): - return - - self.vars_list = parse_vars(file_path) - try: - tree = ET.parse(file_path) - root = tree.getroot() - - proj_path = self.proj_path_edit.text().strip() - - if not proj_path: - # Если в поле ничего нет, пробуем взять из XML - proj_path_from_xml = root.attrib.get('proj_path', '').strip() - if proj_path_from_xml and os.path.isdir(proj_path_from_xml): - proj_path = proj_path_from_xml - self.proj_path_edit.setText(proj_path_from_xml) - else: - QMessageBox.warning( - self, - "Внимание", - "Путь к проекту (proj_path) не найден или не существует.\n" - "Пожалуйста, укажите его вручную в поле 'Project Path'." - ) - else: - if not os.path.isdir(proj_path): - QMessageBox.warning( - self, - "Внимание", - f"Указанный путь к проекту не существует:\n{proj_path}\n" - "Пожалуйста, исправьте путь в поле 'Project Path'." - ) - - - # --- makefile_path из атрибута --- - makefile_path = root.attrib.get('makefile_path', '').strip() - makefile_path_full = make_absolute_path(makefile_path, proj_path) - if makefile_path_full and os.path.isfile(makefile_path_full): - self.makefile_edit.setText(makefile_path) - - # --- structs_path из атрибута --- - structs_path = root.attrib.get('structs_path', '').strip() - structs_path_full = make_absolute_path(structs_path, proj_path) - if structs_path_full and os.path.isfile(structs_path_full): - self.structs_xml_path = structs_path_full - self.structs, self.typedef_map = parse_structs(structs_path_full) - else: - self.structs_xml_path = None - - self.update_table() - except Exception as e: - QMessageBox.warning(self, "Ошибка", f"Ошибка при чтении XML:\n{e}") - - def browse_xml_output(self): - file_path, _ = QFileDialog.getSaveFileName( - self, - "Выберите XML файл", - filter="XML files (*.xml);;All Files (*)" - ) - self.xml_output_edit.setText(file_path) - self.read_xml_file() - - - def browse_xml_struct(self): - file_path, _ = QFileDialog.getSaveFileName(self, "Выберите XML файл", filter="XML files (*.xml);;All Files (*)") - if file_path: - self.xml_output_edit.setText(file_path) - if os.path.isfile(file_path): - self.structs, self.typedef_map = parse_structs(file_path) - - def browse_makefile(self): - file_path, _ = QFileDialog.getOpenFileName( - self, "Выберите Makefile", filter="Makefile (makefile);;All Files (*)" - ) - if file_path: - self.makefile_edit.setText(file_path) - - def browse_source_output(self): - dir_path = QFileDialog.getExistingDirectory(self, "Выберите папку для debug_vars.c") - if dir_path: - self.source_output_edit.setText(dir_path) - - def after_scanvars_finished(self, exitCode, exitStatus): - xml_path = self.xml_output_edit.text().strip() - if not os.path.isfile(xml_path): - QMessageBox.critical(self, "Ошибка", f"Файл не найден: {xml_path}") - return - - try: - # Читаем структуры, если задан путь - if self.structs_xml_path and os.path.isfile(self.structs_xml_path): - try: - self.structs, self.typedef_map = parse_structs(self.structs_xml_path) - # При необходимости обновите UI или сделайте что-то с self.structs - except Exception as e: - QMessageBox.warning(self, "Внимание", f"Не удалось загрузить структуры из {self.structs_xml_path}:\n{e}") - - self.vars_list = parse_vars(xml_path) - self.update_table() - - - except Exception as e: - QMessageBox.critical(self, "Ошибка", f"Не удалось загрузить переменные:\n{e}") - - def update_table(self): - self.type_options = list(dict.fromkeys(type_map.values())) - self.display_type_options = [t.replace('pt_', '') for t in self.type_options] - iq_types = ['iq_none', 'iq'] + [f'iq{i}' for i in range(1, 31)] - self.table.setRowCount(len(self.vars_list)) - - for row, var in enumerate(self.vars_list): - cb = QCheckBox() - enable_str = var.get('enable', 'false') - cb.setChecked(enable_str.lower() == 'true') - self.table.setCellWidget(row, rows.include, cb) - - name_edit = QLineEdit(var['name']) - if var['type'] in self.structs: - completer = QCompleter(self.structs[var['type']].keys()) - completer.setCaseSensitivity(Qt.CaseInsensitive) - name_edit.setCompleter(completer) - self.table.setCellWidget(row, rows.name, name_edit) - - # Type (origin) - origin_type = var.get('type', '').strip() - origin_item = QTableWidgetItem(origin_type) - origin_item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) # read-only - self.table.setItem(row, rows.type, origin_item) - - pt_type_combo = QComboBox() - pt_type_combo.addItems(self.display_type_options) - internal_type = map_type_to_pt(var['type'], var['name'], self.typedef_map) - display_type = internal_type.replace('pt_', '') - if display_type in self.display_type_options: - pt_type_combo.setCurrentText(display_type) - else: - pt_type_combo.addItem(display_type) - pt_type_combo.setCurrentText(display_type) - self.table.setCellWidget(row, rows.pt_type, pt_type_combo) - - iq_combo = QComboBox() - iq_combo.addItems(iq_types) - iq_type = get_iq_define(var['type']) # Получаем IQ-тип, например 'iq24' - display_type = iq_type.replace('t_', '') - if iq_type in iq_types: - iq_combo.setCurrentText(display_type) - else: - iq_combo.addItem(display_type) - iq_combo.setCurrentText(display_type) - self.table.setCellWidget(row, rows.iq_type, iq_combo) - - ret_combo = QComboBox() - ret_combo.addItems(iq_types) - self.table.setCellWidget(row, rows.ret_type, ret_combo) - - short_name_edit = QLineEdit(var['name']) - self.table.setCellWidget(row, rows.short_name, short_name_edit) - - cb.stateChanged.connect(self.save_table_to_xml) - name_edit.textChanged.connect(self.save_table_to_xml) - pt_type_combo.currentTextChanged.connect(self.save_table_to_xml) - iq_combo.currentTextChanged.connect(self.save_table_to_xml) - ret_combo.currentTextChanged.connect(self.save_table_to_xml) - short_name_edit.textChanged.connect(self.save_table_to_xml) - - - def save_table_to_xml(self): - def make_relative_path(abs_path, base_path): - try: - return os.path.relpath(abs_path, base_path).replace("\\", "/") - except ValueError: - return abs_path.replace("\\", "/") - - xml_path = self.xml_output_edit.text().strip() - proj_path = self.proj_path_edit.text().strip() - makefile_path = self.makefile_edit.text().strip() - - if not xml_path or not os.path.isfile(xml_path): - print("XML файл не найден или путь пустой") - return - - try: - tree = ET.parse(xml_path) - root = tree.getroot() - - # Обновим атрибуты с относительными путями - if os.path.isdir(proj_path): - root.set("proj_path", proj_path.replace("\\", "/")) - - if os.path.isfile(makefile_path): - rel_makefile = make_relative_path(makefile_path, proj_path) - root.set("makefile_path", rel_makefile) - - if self.structs_xml_path and os.path.isfile(self.structs_xml_path): - rel_struct_path = make_relative_path(self.structs_xml_path, proj_path) - root.set("structs_path", rel_struct_path) - - - vars_elem = root.find('variables') - if vars_elem is None: - # Если блока нет, создаём - vars_elem = ET.SubElement(root, 'variables') - - original_info = {} - for var_elem in vars_elem.findall('var'): - name = var_elem.attrib.get('name') - if name: - original_info[name] = { - 'type': var_elem.findtext('type', ''), - 'file': var_elem.findtext('file', ''), - 'extern': var_elem.findtext('extern', ''), - 'static': var_elem.findtext('static', '') - } - # Собираем данные из таблицы - updated_vars = [] - for row in range(self.table.rowCount()): - cb = self.table.cellWidget(row, 0) - name_edit = self.table.cellWidget(row, 1) - pt_type_combo = self.table.cellWidget(row, 3) - iq_combo = self.table.cellWidget(row, 4) - ret_combo = self.table.cellWidget(row, 5) - short_name_edit = self.table.cellWidget(row, 6) - - var_name = name_edit.text() - - # Берём оригинальные type и file из словаря, если есть - orig_type = original_info.get(var_name, {}).get('type', '') - orig_file = original_info.get(var_name, {}).get('file', '') - orig_extern = original_info.get(var_name, {}).get('extern', '') - orig_static = original_info.get(var_name, {}).get('static', '') - - updated_vars.append({ - 'name': var_name, - 'enable': cb.isChecked(), - 'shortname': short_name_edit.text(), - 'pt_type': 'pt_' + pt_type_combo.currentText(), - 'iq_type': iq_combo.currentText(), - 'return_type': ret_combo.currentText() or 'int', - 'type': orig_type, - 'file': orig_file, - 'extern': orig_extern, - 'static': orig_static, - }) - - # Обновляем или добавляем по одному var в XML - for v in updated_vars: - var_elem = None - for ve in vars_elem.findall('var'): - if ve.attrib.get('name') == v['name']: - var_elem = ve - break - if var_elem is None: - var_elem = ET.SubElement(vars_elem, 'var', {'name': v['name']}) - - def set_sub_elem_text(parent, tag, text): - el = parent.find(tag) - if el is None: - el = ET.SubElement(parent, tag) - el.text = str(text) - - set_sub_elem_text(var_elem, 'enable', 'true' if v['enable'] else 'false') - set_sub_elem_text(var_elem, 'shortname', v['shortname']) - set_sub_elem_text(var_elem, 'pt_type', v['pt_type']) - set_sub_elem_text(var_elem, 'iq_type', v['iq_type']) - set_sub_elem_text(var_elem, 'return_type', v['return_type']) - set_sub_elem_text(var_elem, 'type', v['type']) - set_sub_elem_text(var_elem, 'file', v['file']) - set_sub_elem_text(var_elem, 'extern', v['extern']) - set_sub_elem_text(var_elem, 'static', v['static']) - - # Сохраняем изменения - tree.write(xml_path, encoding='utf-8', xml_declaration=True) - - except Exception as e: - print(f"Ошибка при сохранении XML: {e}") - - - -if __name__ == "__main__": - app = QApplication(sys.argv) - - editor = VarEditor() - editor.resize(900, 600) - editor.show() - - sys.exit(app.exec()) - - \ No newline at end of file diff --git a/setupVars_GUI.py b/setupVars_GUI.py new file mode 100644 index 0000000..2c4b7a7 --- /dev/null +++ b/setupVars_GUI.py @@ -0,0 +1,666 @@ +import sys +import os +import subprocess +import xml.etree.ElementTree as ET +from generateVars import type_map +from enum import IntEnum +import threading +from scanVars import run_scan +from generateVars import run_generate +from setupVars import * +from VariableSelector import * + +from PySide6.QtWidgets import ( + QApplication, QWidget, QTableWidget, QTableWidgetItem, + QCheckBox, QComboBox, QLineEdit, QVBoxLayout, QHBoxLayout, QPushButton, + QCompleter, QAbstractItemView, QLabel, QMessageBox, QFileDialog, QTextEdit, + QDialog, QTreeWidget, QTreeWidgetItem +) +from PySide6.QtGui import QTextCursor, QKeyEvent +from PySide6.QtCore import Qt, QProcess, QObject, Signal, QTimer + +class rows(IntEnum): + include = 0 + name = 1 + type = 2 + pt_type = 3 + iq_type = 4 + ret_type = 5 + short_name = 6 + + +class EmittingStream(QObject): + text_written = Signal(str) + + def __init__(self): + super().__init__() + self._buffer = "" + + def write(self, text): + self._buffer += text + while '\n' in self._buffer: + line, self._buffer = self._buffer.split('\n', 1) + # Отправляем строку без '\n' + self.text_written.emit(line) + + def flush(self): + if self._buffer: + self.text_written.emit(self._buffer) + self._buffer = "" + + +class ProcessOutputWindowDummy(QWidget): + def __init__(self, on_done_callback): + super().__init__() + self.setWindowTitle("Поиск переменных...") + self.resize(600, 400) + + self.layout = QVBoxLayout(self) + self.output_edit = QTextEdit() + self.output_edit.setReadOnly(True) + self.layout.addWidget(self.output_edit) + + self.btn_close = QPushButton("Закрыть") + self.btn_close.setEnabled(False) + self.layout.addWidget(self.btn_close) + + self.btn_close.clicked.connect(self.__handle_done) + self._on_done_callback = on_done_callback + + def __handle_done(self): + if self._on_done_callback: + self._on_done_callback() + self.close() + + def append_text(self, text): + cursor = self.output_edit.textCursor() + cursor.movePosition(QTextCursor.End) + for line in text.splitlines(): + self.output_edit.append(line) + self.output_edit.setTextCursor(cursor) + self.output_edit.ensureCursorVisible() + + + +# 3. UI: таблица с переменными +class VarEditor(QWidget): + def __init__(self): + super().__init__() + self.vars_list = [] + self.structs = {} + self.typedef_map = {} + + self.proj_path = None + self.xml_path = None + self.makefile_path = None + self.structs_path = None + self.output_path = None + self.initUI() + + def initUI(self): + self.setWindowTitle("Variable Editor") + + # --- Поля ввода пути проекта и XML --- + + # XML Output + xml_layout = QHBoxLayout() + xml_layout.addWidget(QLabel("XML Output:")) + self.xml_output_edit = QLineEdit() + self.xml_output_edit.returnPressed.connect(self.read_xml_file) + self.xml_output_edit.textChanged.connect(self.__on_xml_path_changed) + xml_layout.addWidget(self.xml_output_edit) + btn_xml_browse = QPushButton("...") + btn_xml_browse.setFixedWidth(30) + xml_layout.addWidget(btn_xml_browse) + btn_xml_browse.clicked.connect(self.__browse_xml_output) + + # Project Path + proj_layout = QHBoxLayout() + proj_layout.addWidget(QLabel("Project Path:")) + self.proj_path_edit = QLineEdit() + self.proj_path_edit.textChanged.connect(self.__on_proj_path_changed) + proj_layout.addWidget(self.proj_path_edit) + btn_proj_browse = QPushButton("...") + btn_proj_browse.setFixedWidth(30) + proj_layout.addWidget(btn_proj_browse) + btn_proj_browse.clicked.connect(self.__browse_proj_path) + + # Makefile Path + makefile_layout = QHBoxLayout() + makefile_layout.addWidget(QLabel("Makefile Path (relative path):")) + self.makefile_edit = QLineEdit() + self.makefile_edit.textChanged.connect(self.__on_makefile_path_changed) + makefile_layout.addWidget(self.makefile_edit) + btn_makefile_browse = QPushButton("...") + btn_makefile_browse.setFixedWidth(30) + makefile_layout.addWidget(btn_makefile_browse) + btn_makefile_browse.clicked.connect(self.__browse_makefile) + + + + # Source Output File/Directory + source_output_layout = QHBoxLayout() + source_output_layout.addWidget(QLabel("Source Output File:")) + self.source_output_edit = QLineEdit() + source_output_layout.addWidget(self.source_output_edit) + btn_source_output_browse = QPushButton("...") + btn_source_output_browse.setFixedWidth(30) + source_output_layout.addWidget(btn_source_output_browse) + btn_source_output_browse.clicked.connect(self.__browse_source_output) + + + self.btn_update_vars = QPushButton("Обновить данные о переменных") + self.btn_update_vars.clicked.connect(self.update_vars_data) + + # Таблица переменных + self.table = QTableWidget(len(self.vars_list), 7) + self.table.setHorizontalHeaderLabels([ + 'Include', + 'Name', + 'Origin Type', + 'Pointer Type', + 'IQ Type', + 'Return Type', + 'Short Name' + ]) + self.table.setEditTriggers(QAbstractItemView.AllEditTriggers) + + # Кнопка сохранения + btn_save = QPushButton("Build") + btn_save.clicked.connect(self.save_build) + + # Кнопка добавления переменных + self.btn_add_vars = QPushButton("Add Variables") + self.btn_add_vars.clicked.connect(self.__open_variable_selector) + + + # Основной layout + layout = QVBoxLayout() + layout.addLayout(xml_layout) + layout.addLayout(proj_layout) + layout.addLayout(makefile_layout) + layout.addWidget(self.btn_update_vars) + layout.addWidget(self.table) + layout.addWidget(self.btn_add_vars) + layout.addLayout(source_output_layout) + layout.addWidget(btn_save) + + self.setLayout(layout) + + + + def get_xml_path(self): + xml_path = self.xml_output_edit.text().strip() + return xml_path + + def get_proj_path(self): + proj_path = self.proj_path_edit.text().strip() + return proj_path + + def get_makefile_path(self): + proj_path = self.get_proj_path() + makefile_path = make_absolute_path(self.makefile_edit.text().strip(), proj_path) + return makefile_path + + def get_struct_path(self): + proj_path = self.get_proj_path() + xml_path = self.get_xml_path() + root, tree = safe_parse_xml(xml_path) + if root is None: + return + # --- structs_path из атрибута --- + structs_path = root.attrib.get('structs_path', '').strip() + structs_path_full = make_absolute_path(structs_path, proj_path) + if structs_path_full and os.path.isfile(structs_path_full): + structs_path = structs_path_full + else: + structs_path = None + return structs_path + + def get_output_path(self): + output_path = os.path.abspath(self.source_output_edit.text().strip()) + return output_path + + def update_all_paths(self): + self.proj_path = self.get_proj_path() + self.xml_path = self.get_xml_path() + self.makefile_path = self.get_makefile_path() + self.structs_path = self.get_struct_path() + self.output_path = self.get_output_path() + + + def update_vars_data(self): + self.update_all_paths() + + if not self.proj_path or not self.xml_path: + QMessageBox.warning(self, "Ошибка", "Укажите пути проекта и XML.") + return + + if not os.path.isfile(self.makefile_path): + QMessageBox.warning(self, "Ошибка", f"Makefile не найден:\n{self.makefile_path}") + return + + + # Создаём окно с кнопкой "Готово" + self.proc_win = ProcessOutputWindowDummy(self.__after_scanvars_finished) + self.proc_win.show() + + self.emitting_stream = EmittingStream() + self.emitting_stream.text_written.connect(self.proc_win.append_text) + + def run_scan_wrapper(): + try: + old_stdout = sys.stdout + sys.stdout = self.emitting_stream + + run_scan(self.proj_path, self.makefile_path, self.xml_path) + + except Exception as e: + self.emitting_stream.text_written.emit(f"\n[ОШИБКА] {e}") + finally: + sys.stdout = old_stdout + self.emitting_stream.text_written.emit("\n--- Анализ завершён ---") + self.proc_win.btn_close.setEnabled(True) + + threading.Thread(target=run_scan_wrapper, daemon=True).start() + + + def save_build(self): + vars_out = [] + for row in range(self.table.rowCount()): + include_cb = self.table.cellWidget(row, rows.include) + if not include_cb.isChecked(): + continue + name_edit = self.table.cellWidget(row, rows.name) + pt_type_combo = self.table.cellWidget(row, rows.pt_type) + iq_combo = self.table.cellWidget(row, rows.iq_type) + ret_combo = self.table.cellWidget(row, rows.ret_type) + short_name_edit = self.table.cellWidget(row, rows.short_name) + + var_data = { + 'name': name_edit.text(), + 'type': 'pt_' + pt_type_combo.currentText(), + 'iq_type': iq_combo.currentText(), + 'return_type': ret_combo.currentText() if ret_combo.currentText() else 'int', + 'short_name': short_name_edit.text(), + } + vars_out.append(var_data) + + # Здесь нужно указать абсолютные пути к проекту, xml и output (замени на свои) + self.update_all_paths() + + if not self.proj_path or not self.xml_path or not self.output_path: + QMessageBox.warning(self, "Ошибка", "Заполните все пути: проект, XML и output.") + return + + try: + run_generate(self.proj_path, self.xml_path, self.output_path) + QMessageBox.information(self, "Готово", "Файл debug_vars.c успешно сгенерирован.") + except Exception as e: + QMessageBox.critical(self, "Ошибка при генерации", str(e)) + + + def read_xml_file(self): + self.update_all_paths() + if self.xml_path and not os.path.isfile(self.xml_path): + return + + try: + root, tree = safe_parse_xml(self.xml_path) + if root is None: + return + + if not self.proj_path: + # Если в поле ничего нет, пробуем взять из XML + proj_path_from_xml = root.attrib.get('proj_path', '').strip() + if proj_path_from_xml and os.path.isdir(proj_path_from_xml): + self.proj_path = proj_path_from_xml + self.proj_path_edit.setText(proj_path_from_xml) + else: + QMessageBox.warning( + self, + "Внимание", + "Путь к проекту (proj_path) не найден или не существует.\n" + "Пожалуйста, укажите его вручную в поле 'Project Path'." + ) + else: + if not os.path.isdir(self.proj_path): + QMessageBox.warning( + self, + "Внимание", + f"Указанный путь к проекту не существует:\n{self.proj_path}\n" + "Пожалуйста, исправьте путь в поле 'Project Path'." + ) + + + # --- makefile_path из атрибута --- + makefile_path = root.attrib.get('makefile_path', '').strip() + makefile_path_full = make_absolute_path(makefile_path, self.proj_path) + if makefile_path_full and os.path.isfile(makefile_path_full): + self.makefile_edit.setText(makefile_path) + self.makefile_path = makefile_path_full + + # --- structs_path из атрибута --- + structs_path = root.attrib.get('structs_path', '').strip() + structs_path_full = make_absolute_path(structs_path, self.proj_path) + if structs_path_full and os.path.isfile(structs_path_full): + self.structs_path = structs_path_full + self.structs, self.typedef_map = parse_structs(structs_path_full) + else: + self.structs_path = None + + self.vars_list = parse_vars(self.xml_path, self.typedef_map) + self.update_table() + except Exception as e: + QMessageBox.warning(self, "Ошибка", f"Ошибка при чтении XML:\n{e}") + + + + def __browse_proj_path(self): + dir_path = QFileDialog.getExistingDirectory(self, "Выберите папку проекта") + if dir_path: + self.proj_path_edit.setText(dir_path) + self.proj_path = dir_path + + if self.makefile_path and self.proj_path: + path = make_relative_path(self.makefile_path, self.proj_path) + self.makefile_edit.setText(path) + self.makefile_path = path + + def __browse_xml_output(self): + file_path, _ = QFileDialog.getSaveFileName( + self, + "Выберите XML файл", + filter="XML files (*.xml);;All Files (*)" + ) + self.xml_output_edit.setText(file_path) + self.xml_path = file_path + self.read_xml_file() + + def keyPressEvent(self, event: QKeyEvent): + if event.key() == Qt.Key_Delete: + self.delete_selected_rows() + else: + super().keyPressEvent(event) + + def __browse_makefile(self): + file_path, _ = QFileDialog.getOpenFileName( + self, "Выберите Makefile", filter="Makefile (makefile);;All Files (*)" + ) + if file_path and self.proj_path: + path = make_relative_path(file_path, self.proj_path) + else: + path = file_path + self.makefile_edit.setText(path) + self.makefile_path = path + + def __browse_source_output(self): + dir_path = QFileDialog.getExistingDirectory(self, "Выберите папку для debug_vars.c") + if dir_path: + self.source_output_edit.setText(dir_path) + self.output_path = dir_path + else: + self.output_path = '' + + + def __on_xml_path_changed(self): + self.xml_path = self.get_xml_path() + + def __on_proj_path_changed(self): + self.proj_path = self.get_proj_path() + + def __on_makefile_path_changed(self): + self.makefile_path = self.get_makefile_path() + if self.makefile_path and self.proj_path: + path = make_relative_path(self.makefile_path, self.proj_path) + self.makefile_edit.setText(path) + self.makefile_path = path + + + def __after_scanvars_finished(self): + xml_path = self.xml_output_edit.text().strip() + if not os.path.isfile(xml_path): + QMessageBox.critical(self, "Ошибка", f"Файл не найден: {xml_path}") + return + + try: + # Читаем структуры, если задан путь + if self.structs_path and os.path.isfile(self.structs_path): + try: + self.structs, self.typedef_map = parse_structs(self.structs_path) + # При необходимости обновите UI или сделайте что-то с self.structs + except Exception as e: + QMessageBox.warning(self, "Внимание", f"Не удалось загрузить структуры из {self.structs_path}:\n{e}") + + self.vars_list = parse_vars(xml_path) + self.update_table() + + + except Exception as e: + QMessageBox.critical(self, "Ошибка", f"Не удалось загрузить переменные:\n{e}") + + def delete_selected_rows(self): + selected_rows = sorted(set(index.row() for index in self.table.selectedIndexes()), reverse=True) + if not selected_rows: + return + + # Удаляем из vars_list те, у кого show_var == true и имя совпадает + filtered_vars = [v for v in self.vars_list if v.get('show_var', 'false') == 'true'] + for row in selected_rows: + if 0 <= row < len(filtered_vars): + var_to_remove = filtered_vars[row] + for v in self.vars_list: + if v['name'] == var_to_remove['name']: + v['show_var'] = 'false' + break + + self.update_table() + + + def __open_variable_selector(self): + if not self.vars_list: + QMessageBox.warning(self, "Нет переменных", "Сначала загрузите или обновите переменные.") + return + + dlg = VariableSelectorDialog(self.vars_list, self.structs, self.typedef_map, self) + if dlg.exec(): + self.write_to_xml() + self.read_xml_file() + self.update_table() + + + + def update_table(self): + self.type_options = list(dict.fromkeys(type_map.values())) + self.display_type_options = [t.replace('pt_', '') for t in self.type_options] + iq_types = ['iq_none', 'iq'] + [f'iq{i}' for i in range(1, 31)] + filtered_vars = [v for v in self.vars_list if v.get('show_var', 'false') == 'true'] + self.table.setRowCount(len(filtered_vars)) + + for row, var in enumerate(filtered_vars): + cb = QCheckBox() + enable_str = var.get('enable', 'false') + cb.setChecked(enable_str.lower() == 'true') + self.table.setCellWidget(row, rows.include, cb) + + name_edit = QLineEdit(var['name']) + if var['type'] in self.structs: + completer = QCompleter(self.structs[var['type']].keys()) + completer.setCaseSensitivity(Qt.CaseInsensitive) + name_edit.setCompleter(completer) + self.table.setCellWidget(row, rows.name, name_edit) + + # Type (origin) + origin_type = var.get('type', '').strip() + origin_item = QTableWidgetItem(origin_type) + origin_item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) # read-only + self.table.setItem(row, rows.type, origin_item) + + pt_type_combo = QComboBox() + pt_type_combo.addItems(self.display_type_options) + internal_type = var['pt_type'].replace('pt_', '') + if internal_type in self.display_type_options: + pt_type_combo.setCurrentText(internal_type) + else: + pt_type_combo.addItem(internal_type) + pt_type_combo.setCurrentText(internal_type) + self.table.setCellWidget(row, rows.pt_type, pt_type_combo) + + iq_combo = QComboBox() + iq_combo.addItems(iq_types) + iq_type = var['iq_type'].replace('t_', '') + if iq_type in iq_types: + iq_combo.setCurrentText(iq_type) + else: + iq_combo.addItem(iq_type) + iq_combo.setCurrentText(iq_type) + self.table.setCellWidget(row, rows.iq_type, iq_combo) + + ret_combo = QComboBox() + ret_combo.addItems(iq_types) + self.table.setCellWidget(row, rows.ret_type, ret_combo) + + short_name_edit = QLineEdit(var['name']) + self.table.setCellWidget(row, rows.short_name, short_name_edit) + + cb.stateChanged.connect(self.write_to_xml) + name_edit.textChanged.connect(self.write_to_xml) + pt_type_combo.currentTextChanged.connect(self.write_to_xml) + iq_combo.currentTextChanged.connect(self.write_to_xml) + ret_combo.currentTextChanged.connect(self.write_to_xml) + short_name_edit.textChanged.connect(self.write_to_xml) + + self.write_to_xml() + + + def read_table(self): + vars_data = [] + for row in range(self.table.rowCount()): + cb = self.table.cellWidget(row, rows.include) + name_edit = self.table.cellWidget(row, rows.name) + pt_type_combo = self.table.cellWidget(row, rows.pt_type) + iq_combo = self.table.cellWidget(row, rows.iq_type) + ret_combo = self.table.cellWidget(row, rows.ret_type) + short_name_edit = self.table.cellWidget(row, rows.short_name) + origin_item = self.table.item(row, rows.type) + + vars_data.append({ + 'show_var': True, + 'enable': cb.isChecked() if cb else False, + 'name': name_edit.text() if name_edit else '', + 'pt_type': 'pt_' + pt_type_combo.currentText() if pt_type_combo else '', + 'iq_type': iq_combo.currentText() if iq_combo else '', + 'return_type': ret_combo.currentText() if ret_combo else '', + 'shortname': short_name_edit.text() if short_name_edit else '', + 'type': origin_item.text() if origin_item else '', + }) + return vars_data + + + + def write_to_xml(self): + self.update_all_paths() + + if not self.xml_path or not os.path.isfile(self.xml_path): + print("XML файл не найден или путь пустой") + return + if not self.proj_path or not os.path.isdir(self.proj_path): + print("Project path не найден или путь пустой") + return + if not self.makefile_path or not os.path.isfile(self.makefile_path): + print("makefile файл не найден или путь пустой") + return + + try: + root, tree = safe_parse_xml(self.xml_path) + if root is None: + return + + + root.set("proj_path", self.proj_path.replace("\\", "/")) + + if self.makefile_path and os.path.isfile(self.makefile_path): + rel_makefile = make_relative_path(self.makefile_path, self.proj_path) + root.set("makefile_path", rel_makefile) + + if self.structs_path and os.path.isfile(self.structs_path): + rel_struct = make_relative_path(self.structs_path, self.proj_path) + root.set("structs_path", rel_struct) + + vars_elem = root.find('variables') + if vars_elem is None: + vars_elem = ET.SubElement(root, 'variables') + + original_info = {} + for var_elem in vars_elem.findall('var'): + name = var_elem.attrib.get('name') + if name: + original_info[name] = { + 'file': var_elem.findtext('file', ''), + 'extern': var_elem.findtext('extern', ''), + 'static': var_elem.findtext('static', '') + } + + # Читаем переменные из таблицы (активные/изменённые) + table_vars = {v['name']: v for v in self.read_table()} + # Все переменные (в том числе новые, которых нет в XML) + all_vars_by_name = {v['name']: v for v in self.vars_list} + + # Объединённый список переменных для записи + all_names = set(all_vars_by_name.keys()) + for name in all_names: + v = all_vars_by_name[name] + v_table = table_vars.get(name) + var_elem = None + + # Ищем уже существующий в XML + for ve in vars_elem.findall('var'): + if ve.attrib.get('name') == name: + var_elem = ve + break + if var_elem is None: + var_elem = ET.SubElement(vars_elem, 'var', {'name': name}) + + def set_sub_elem_text(parent, tag, text): + el = parent.find(tag) + if el is None: + el = ET.SubElement(parent, tag) + el.text = str(text) + + set_sub_elem_text(var_elem, 'show_var', v.get('show_var', 'false')) + set_sub_elem_text(var_elem, 'enable', v.get('enable', 'false')) + set_sub_elem_text(var_elem, 'shortname', v['shortname']) + set_sub_elem_text(var_elem, 'pt_type', v['pt_type']) + set_sub_elem_text(var_elem, 'iq_type', v['iq_type']) + set_sub_elem_text(var_elem, 'return_type', v['return_type']) + set_sub_elem_text(var_elem, 'type', v['type']) + + # file/extern/static: из original_info, либо из v + file_val = v.get('file') or original_info.get(name, {}).get('file', '') + extern_val = v.get('extern') or original_info.get(name, {}).get('extern', '') + static_val = v.get('static') or original_info.get(name, {}).get('static', '') + + set_sub_elem_text(var_elem, 'file', file_val) + set_sub_elem_text(var_elem, 'extern', extern_val) + set_sub_elem_text(var_elem, 'static', static_val) + + + ET.indent(tree, space=" ", level=0) + tree.write(self.xml_path, encoding='utf-8', xml_declaration=True) + + except Exception as e: + print(f"Ошибка при сохранении XML: {e}") + + + + + +if __name__ == "__main__": + app = QApplication(sys.argv) + + editor = VarEditor() + editor.resize(900, 600) + editor.show() + + sys.exit(app.exec()) + diff --git a/setupVars_out.py b/setupVars_out.py new file mode 100644 index 0000000..90c00c8 --- /dev/null +++ b/setupVars_out.py @@ -0,0 +1,581 @@ +import sys +import os +import subprocess +import xml.etree.ElementTree as ET +from generateVars import map_type_to_pt, get_iq_define, type_map +from enum import IntEnum +from scanVars import run_scan +from generateVars import run_generate + +from PySide6.QtWidgets import ( + QApplication, QWidget, QTableWidget, QTableWidgetItem, + QCheckBox, QComboBox, QLineEdit, QVBoxLayout, QHBoxLayout, QPushButton, + QCompleter, QAbstractItemView, QLabel, QMessageBox, QFileDialog, QTextEdit +) +from PySide6.QtGui import QTextCursor +from PySide6.QtCore import Qt, QProcess + +class rows(IntEnum): + include = 0 + name = 1 + type = 2 + pt_type = 3 + iq_type = 4 + ret_type = 5 + short_name = 6 + +# 1. Парсим vars.xml +def make_absolute_path(path, base_path): + if not os.path.isabs(path): + return os.path.abspath(os.path.join(base_path, path)) + return os.path.abspath(path) + +def parse_vars(filename): + tree = ET.parse(filename) + root = tree.getroot() + + vars_list = [] + variables_elem = root.find('variables') + if variables_elem is not None: + for var in variables_elem.findall('var'): + name = var.attrib.get('name', '') + vars_list.append({ + 'name': name, + 'enable': var.findtext('enable', 'false'), + 'shortname': var.findtext('shortname', name), + 'pt_type': var.findtext('pt_type', 'pt_unknown'), + 'iq_type': var.findtext('iq_type', 'iq_none'), + 'return_type': var.findtext('return_type', 'int'), + 'type': var.findtext('type', 'unknown'), + 'file': var.findtext('file', ''), + 'extern': var.findtext('extern', 'false') == 'true', + 'static': var.findtext('static', 'false') == 'true', + }) + + return vars_list + +# 2. Парсим structSup.xml +def parse_structs(filename): + tree = ET.parse(filename) + root = tree.getroot() + + structs = {} + typedef_map = {} + + # --- Считываем структуры --- + structs_elem = root.find('structs') + if structs_elem is not None: + for struct in structs_elem.findall('struct'): + name = struct.attrib['name'] + fields = {} + for field in struct.findall('field'): + fname = field.attrib.get('name') + ftype = field.attrib.get('type') + if fname and ftype: + fields[fname] = ftype + structs[name] = fields + + # --- Считываем typedef-ы --- + typedefs_elem = root.find('typedefs') + if typedefs_elem is not None: + for typedef in typedefs_elem.findall('typedef'): + name = typedef.attrib.get('name') + target_type = typedef.attrib.get('type') + if name and target_type: + typedef_map[name.strip()] = target_type.strip() + + return structs, typedef_map + + + +class ProcessOutputWindow(QWidget): + def __init__(self, command, args): + super().__init__() + self.setWindowTitle("Поиск переменных...") + self.resize(600, 400) + + self.layout = QVBoxLayout(self) + self.output_edit = QTextEdit() + self.output_edit.setReadOnly(True) + self.layout.addWidget(self.output_edit) + + self.btn_close = QPushButton("Закрыть") + self.btn_close.setEnabled(False) + self.btn_close.clicked.connect(self.close) + self.layout.addWidget(self.btn_close) + + self.process = QProcess(self) + self.process.setProcessChannelMode(QProcess.MergedChannels) + self.process.readyReadStandardOutput.connect(self.handle_stdout) + self.process.finished.connect(self.process_finished) + + self.process.start(command, args) + + def handle_stdout(self): + data = self.process.readAllStandardOutput() + text = data.data().decode('utf-8') + self.output_edit.append(text) + + def process_finished(self): + self.output_edit.append("\n--- Процесс завершён ---") + self.btn_close.setEnabled(True) + +# 3. UI: таблица с переменными +class VarEditor(QWidget): + def __init__(self): + super().__init__() + self.vars_list = [] + self.structs = {} + self.typedef_map = {} + self.structs_xml_path = None # сюда запишем путь из + self.initUI() + + def initUI(self): + self.setWindowTitle("Variable Editor") + + # --- Поля ввода пути проекта и XML --- + + # XML Output + xml_layout = QHBoxLayout() + xml_layout.addWidget(QLabel("XML Output:")) + self.xml_output_edit = QLineEdit() + xml_layout.addWidget(self.xml_output_edit) + self.xml_output_edit.returnPressed.connect(self.read_xml_file) + btn_xml_browse = QPushButton("...") + btn_xml_browse.setFixedWidth(30) + xml_layout.addWidget(btn_xml_browse) + btn_xml_browse.clicked.connect(self.browse_xml_output) + + # Project Path + proj_layout = QHBoxLayout() + proj_layout.addWidget(QLabel("Project Path:")) + self.proj_path_edit = QLineEdit() + proj_layout.addWidget(self.proj_path_edit) + btn_proj_browse = QPushButton("...") + btn_proj_browse.setFixedWidth(30) + proj_layout.addWidget(btn_proj_browse) + btn_proj_browse.clicked.connect(self.browse_proj_path) + + # Makefile Path + makefile_layout = QHBoxLayout() + makefile_layout.addWidget(QLabel("Makefile Path (relative path):")) + self.makefile_edit = QLineEdit() + makefile_layout.addWidget(self.makefile_edit) + btn_makefile_browse = QPushButton("...") + btn_makefile_browse.setFixedWidth(30) + makefile_layout.addWidget(btn_makefile_browse) + btn_makefile_browse.clicked.connect(self.browse_makefile) + + + + # Source Output File/Directory + source_output_layout = QHBoxLayout() + source_output_layout.addWidget(QLabel("Source Output File:")) + self.source_output_edit = QLineEdit() + source_output_layout.addWidget(self.source_output_edit) + btn_source_output_browse = QPushButton("...") + btn_source_output_browse.setFixedWidth(30) + source_output_layout.addWidget(btn_source_output_browse) + btn_source_output_browse.clicked.connect(self.browse_source_output) + + + self.btn_update_vars = QPushButton("Обновить данные о переменных") + self.btn_update_vars.clicked.connect(self.update_vars_data) + + # Таблица переменных + self.table = QTableWidget(len(self.vars_list), 7) + self.table.setHorizontalHeaderLabels([ + 'Include', + 'Name', + 'Origin Type', + 'Pointer Type', + 'IQ Type', + 'Return Type', + 'Short Name' + ]) + self.table.setEditTriggers(QAbstractItemView.AllEditTriggers) + + # Кнопка сохранения + btn_save = QPushButton("Build") + btn_save.clicked.connect(self.save_build) + + # Основной layout + layout = QVBoxLayout() + layout.addLayout(xml_layout) + layout.addLayout(proj_layout) + layout.addLayout(makefile_layout) + layout.addWidget(self.btn_update_vars) + layout.addWidget(self.table) + layout.addWidget(btn_save) + layout.addLayout(source_output_layout) + + self.setLayout(layout) + + def update_vars_data(self): + proj_path = os.path.abspath(self.proj_path_edit.text().strip()) + xml_path = os.path.abspath(self.xml_output_edit.text().strip()) + makefile_path = make_absolute_path(self.makefile_edit.text().strip(), proj_path) + + if not proj_path or not xml_path: + QMessageBox.warning(self, "Ошибка", "Пожалуйста, укажите пути проекта и XML.") + return + + if not os.path.isfile(makefile_path): + QMessageBox.warning(self, "Ошибка", f"Makefile не найден по пути:\n{makefile_path}") + return + + scanvars_exe = "scanVars.exe" + args = [proj_path, makefile_path, xml_path] + + # Создаем и показываем окно с выводом процесса + self.proc_win = ProcessOutputWindow("python", []) + self.proc_win.show() + self.proc_win.output_edit.append("Запуск анализа переменных...") + + # Запускаем в отдельном процессе через QProcess, если нужен live-вывод: + from threading import Thread + + def run_scan_wrapper(): + try: + run_scan(proj_path, makefile_path, xml_path) + self.proc_win.output_edit.append("\n--- Анализ завершён ---") + except Exception as e: + self.proc_win.output_edit.append(f"\n[ОШИБКА] {e}") + self.proc_win.btn_close.setEnabled(True) + self.after_scanvars_finished(0, 0) + + Thread(target=run_scan_wrapper).start() + # Можно подписаться на сигнал завершения процесса, если хочешь обновить UI после + #self.proc_win.process.finished.connect(lambda exitCode, exitStatus: self.after_scanvars_finished(exitCode, exitStatus)) + + + def save_build(self): + vars_out = [] + for row in range(self.table.rowCount()): + include_cb = self.table.cellWidget(row, rows.include) + if not include_cb.isChecked(): + continue + name_edit = self.table.cellWidget(row, rows.name) + pt_type_combo = self.table.cellWidget(row, rows.pt_type) + iq_combo = self.table.cellWidget(row, rows.iq_type) + ret_combo = self.table.cellWidget(row, rows.ret_type) + short_name_edit = self.table.cellWidget(row, rows.short_name) + + var_data = { + 'name': name_edit.text(), + 'type': 'pt_' + pt_type_combo.currentText(), + 'iq_type': iq_combo.currentText(), + 'return_type': ret_combo.currentText() if ret_combo.currentText() else 'int', + 'short_name': short_name_edit.text(), + } + vars_out.append(var_data) + + # Здесь нужно указать абсолютные пути к проекту, xml и output (замени на свои) + proj_path = os.path.abspath(self.proj_path_edit.text().strip()) + xml_path = os.path.abspath(self.xml_output_edit.text().strip()) + output_dir_c_file = os.path.abspath(self.source_output_edit.text().strip()) + + if not proj_path or not xml_path or not output_dir_c_file: + QMessageBox.warning(self, "Ошибка", "Заполните все пути: проект, XML и output.") + return + + try: + run_generate(proj_path, xml_path, output_dir_c_file) + QMessageBox.information(self, "Готово", "Файл debug_vars.c успешно сгенерирован.") + except Exception as e: + QMessageBox.critical(self, "Ошибка при генерации", str(e)) + + def browse_proj_path(self): + dir_path = QFileDialog.getExistingDirectory(self, "Выберите папку проекта") + if dir_path: + self.proj_path_edit.setText(dir_path) + + def read_xml_file(self): + file_path = self.xml_output_edit.text().strip() + if file_path and not os.path.isfile(file_path): + return + + self.vars_list = parse_vars(file_path) + try: + tree = ET.parse(file_path) + root = tree.getroot() + + proj_path = self.proj_path_edit.text().strip() + + if not proj_path: + # Если в поле ничего нет, пробуем взять из XML + proj_path_from_xml = root.attrib.get('proj_path', '').strip() + if proj_path_from_xml and os.path.isdir(proj_path_from_xml): + proj_path = proj_path_from_xml + self.proj_path_edit.setText(proj_path_from_xml) + else: + QMessageBox.warning( + self, + "Внимание", + "Путь к проекту (proj_path) не найден или не существует.\n" + "Пожалуйста, укажите его вручную в поле 'Project Path'." + ) + else: + if not os.path.isdir(proj_path): + QMessageBox.warning( + self, + "Внимание", + f"Указанный путь к проекту не существует:\n{proj_path}\n" + "Пожалуйста, исправьте путь в поле 'Project Path'." + ) + + + # --- makefile_path из атрибута --- + makefile_path = root.attrib.get('makefile_path', '').strip() + makefile_path_full = make_absolute_path(makefile_path, proj_path) + if makefile_path_full and os.path.isfile(makefile_path_full): + self.makefile_edit.setText(makefile_path) + + # --- structs_path из атрибута --- + structs_path = root.attrib.get('structs_path', '').strip() + structs_path_full = make_absolute_path(structs_path, proj_path) + if structs_path_full and os.path.isfile(structs_path_full): + self.structs_xml_path = structs_path_full + self.structs, self.typedef_map = parse_structs(structs_path_full) + else: + self.structs_xml_path = None + + self.update_table() + except Exception as e: + QMessageBox.warning(self, "Ошибка", f"Ошибка при чтении XML:\n{e}") + + def browse_xml_output(self): + file_path, _ = QFileDialog.getSaveFileName( + self, + "Выберите XML файл", + filter="XML files (*.xml);;All Files (*)" + ) + self.xml_output_edit.setText(file_path) + self.read_xml_file() + + + def browse_xml_struct(self): + file_path, _ = QFileDialog.getSaveFileName(self, "Выберите XML файл", filter="XML files (*.xml);;All Files (*)") + if file_path: + self.xml_output_edit.setText(file_path) + if os.path.isfile(file_path): + self.structs, self.typedef_map = parse_structs(file_path) + + def browse_makefile(self): + file_path, _ = QFileDialog.getOpenFileName( + self, "Выберите Makefile", filter="Makefile (makefile);;All Files (*)" + ) + if file_path: + self.makefile_edit.setText(file_path) + + def browse_source_output(self): + dir_path = QFileDialog.getExistingDirectory(self, "Выберите папку для debug_vars.c") + if dir_path: + self.source_output_edit.setText(dir_path) + + def after_scanvars_finished(self, exitCode, exitStatus): + xml_path = self.xml_output_edit.text().strip() + if not os.path.isfile(xml_path): + QMessageBox.critical(self, "Ошибка", f"Файл не найден: {xml_path}") + return + + try: + # Читаем структуры, если задан путь + if self.structs_xml_path and os.path.isfile(self.structs_xml_path): + try: + self.structs, self.typedef_map = parse_structs(self.structs_xml_path) + # При необходимости обновите UI или сделайте что-то с self.structs + except Exception as e: + QMessageBox.warning(self, "Внимание", f"Не удалось загрузить структуры из {self.structs_xml_path}:\n{e}") + + self.vars_list = parse_vars(xml_path) + self.update_table() + + + except Exception as e: + QMessageBox.critical(self, "Ошибка", f"Не удалось загрузить переменные:\n{e}") + + def update_table(self): + self.type_options = list(dict.fromkeys(type_map.values())) + self.display_type_options = [t.replace('pt_', '') for t in self.type_options] + iq_types = ['iq_none', 'iq'] + [f'iq{i}' for i in range(1, 31)] + self.table.setRowCount(len(self.vars_list)) + + for row, var in enumerate(self.vars_list): + cb = QCheckBox() + enable_str = var.get('enable', 'false') + cb.setChecked(enable_str.lower() == 'true') + self.table.setCellWidget(row, rows.include, cb) + + name_edit = QLineEdit(var['name']) + if var['type'] in self.structs: + completer = QCompleter(self.structs[var['type']].keys()) + completer.setCaseSensitivity(Qt.CaseInsensitive) + name_edit.setCompleter(completer) + self.table.setCellWidget(row, rows.name, name_edit) + + # Type (origin) + origin_type = var.get('type', '').strip() + origin_item = QTableWidgetItem(origin_type) + origin_item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) # read-only + self.table.setItem(row, rows.type, origin_item) + + pt_type_combo = QComboBox() + pt_type_combo.addItems(self.display_type_options) + internal_type = map_type_to_pt(var['type'], var['name'], self.typedef_map) + display_type = internal_type.replace('pt_', '') + if display_type in self.display_type_options: + pt_type_combo.setCurrentText(display_type) + else: + pt_type_combo.addItem(display_type) + pt_type_combo.setCurrentText(display_type) + self.table.setCellWidget(row, rows.pt_type, pt_type_combo) + + iq_combo = QComboBox() + iq_combo.addItems(iq_types) + iq_type = get_iq_define(var['type']) # Получаем IQ-тип, например 'iq24' + display_type = iq_type.replace('t_', '') + if iq_type in iq_types: + iq_combo.setCurrentText(display_type) + else: + iq_combo.addItem(display_type) + iq_combo.setCurrentText(display_type) + self.table.setCellWidget(row, rows.iq_type, iq_combo) + + ret_combo = QComboBox() + ret_combo.addItems(iq_types) + self.table.setCellWidget(row, rows.ret_type, ret_combo) + + short_name_edit = QLineEdit(var['name']) + self.table.setCellWidget(row, rows.short_name, short_name_edit) + + cb.stateChanged.connect(self.save_table_to_xml) + name_edit.textChanged.connect(self.save_table_to_xml) + pt_type_combo.currentTextChanged.connect(self.save_table_to_xml) + iq_combo.currentTextChanged.connect(self.save_table_to_xml) + ret_combo.currentTextChanged.connect(self.save_table_to_xml) + short_name_edit.textChanged.connect(self.save_table_to_xml) + + + def save_table_to_xml(self): + def make_relative_path(abs_path, base_path): + try: + return os.path.relpath(abs_path, base_path).replace("\\", "/") + except ValueError: + return abs_path.replace("\\", "/") + + xml_path = self.xml_output_edit.text().strip() + proj_path = self.proj_path_edit.text().strip() + makefile_path = self.makefile_edit.text().strip() + + if not xml_path or not os.path.isfile(xml_path): + print("XML файл не найден или путь пустой") + return + + try: + tree = ET.parse(xml_path) + root = tree.getroot() + + # Обновим атрибуты с относительными путями + if os.path.isdir(proj_path): + root.set("proj_path", proj_path.replace("\\", "/")) + + if os.path.isfile(makefile_path): + rel_makefile = make_relative_path(makefile_path, proj_path) + root.set("makefile_path", rel_makefile) + + if self.structs_xml_path and os.path.isfile(self.structs_xml_path): + rel_struct_path = make_relative_path(self.structs_xml_path, proj_path) + root.set("structs_path", rel_struct_path) + + + vars_elem = root.find('variables') + if vars_elem is None: + # Если блока нет, создаём + vars_elem = ET.SubElement(root, 'variables') + + original_info = {} + for var_elem in vars_elem.findall('var'): + name = var_elem.attrib.get('name') + if name: + original_info[name] = { + 'type': var_elem.findtext('type', ''), + 'file': var_elem.findtext('file', ''), + 'extern': var_elem.findtext('extern', ''), + 'static': var_elem.findtext('static', '') + } + # Собираем данные из таблицы + updated_vars = [] + for row in range(self.table.rowCount()): + cb = self.table.cellWidget(row, 0) + name_edit = self.table.cellWidget(row, 1) + pt_type_combo = self.table.cellWidget(row, 3) + iq_combo = self.table.cellWidget(row, 4) + ret_combo = self.table.cellWidget(row, 5) + short_name_edit = self.table.cellWidget(row, 6) + + var_name = name_edit.text() + + # Берём оригинальные type и file из словаря, если есть + orig_type = original_info.get(var_name, {}).get('type', '') + orig_file = original_info.get(var_name, {}).get('file', '') + orig_extern = original_info.get(var_name, {}).get('extern', '') + orig_static = original_info.get(var_name, {}).get('static', '') + + updated_vars.append({ + 'name': var_name, + 'enable': cb.isChecked(), + 'shortname': short_name_edit.text(), + 'pt_type': 'pt_' + pt_type_combo.currentText(), + 'iq_type': iq_combo.currentText(), + 'return_type': ret_combo.currentText() or 'int', + 'type': orig_type, + 'file': orig_file, + 'extern': orig_extern, + 'static': orig_static, + }) + + # Обновляем или добавляем по одному var в XML + for v in updated_vars: + var_elem = None + for ve in vars_elem.findall('var'): + if ve.attrib.get('name') == v['name']: + var_elem = ve + break + if var_elem is None: + var_elem = ET.SubElement(vars_elem, 'var', {'name': v['name']}) + + def set_sub_elem_text(parent, tag, text): + el = parent.find(tag) + if el is None: + el = ET.SubElement(parent, tag) + el.text = str(text) + + set_sub_elem_text(var_elem, 'enable', 'true' if v['enable'] else 'false') + set_sub_elem_text(var_elem, 'shortname', v['shortname']) + set_sub_elem_text(var_elem, 'pt_type', v['pt_type']) + set_sub_elem_text(var_elem, 'iq_type', v['iq_type']) + set_sub_elem_text(var_elem, 'return_type', v['return_type']) + set_sub_elem_text(var_elem, 'type', v['type']) + set_sub_elem_text(var_elem, 'file', v['file']) + set_sub_elem_text(var_elem, 'extern', v['extern']) + set_sub_elem_text(var_elem, 'static', v['static']) + + # Сохраняем изменения + tree.write(xml_path, encoding='utf-8', xml_declaration=True) + + except Exception as e: + print(f"Ошибка при сохранении XML: {e}") + + + +if __name__ == "__main__": + app = QApplication(sys.argv) + + editor = VarEditor() + editor.resize(900, 600) + editor.show() + + sys.exit(app.exec()) + + \ No newline at end of file diff --git a/vars.xml b/vars.xml index 2fa366b..2b7f467 100644 --- a/vars.xml +++ b/vars.xml @@ -1,3315 +1,3648 @@ - - F:\Work\Projects\TMS\TMS_new_bus\Src\DebugTools\structs.xml + - false + false + true ADC0finishAddr pt_int16 iq_none iq_none int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true ADC0startAddr pt_int16 iq_none iq_none int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true ADC1finishAddr pt_int16 iq_none iq_none int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true ADC1startAddr pt_int16 iq_none iq_none int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true ADC2finishAddr pt_int16 iq_none iq_none int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true ADC2startAddr pt_int16 iq_none iq_none int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true ADC_f pt_arr_int16 iq_none iq_none int[2][16] - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true ADC_sf pt_arr_int16 iq_none iq_none int[2][16] - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true ADDR_FOR_ALL pt_int16 iq_none iq_none int - Src/myXilinx/RS_Functions.c + Src/DebugTools/Src/myXilinx/RS_Functions.c false false - false + false + true BUSY pt_int16 iq_none iq_none int - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true Bender pt_arr_struct iq_none iq_none BENDER[2] - Src/myLibs/bender.c + Src/DebugTools/Src/myLibs/bender.c false false - false + false + true CAN_answer_wait pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[32] - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true CAN_count_cycle_input_units pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[8] - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true CAN_no_answer pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[32] - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true CAN_refresh_cicle pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[32] - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true CAN_request_sent pt_arr_int16 iq_none iq_none int[32] - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true CAN_timeout pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[32] - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true CAN_timeout_cicle pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[32] - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true CNTRL_ADDR pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/RS_Functions.c + Src/DebugTools/Src/myXilinx/RS_Functions.c false false - false + false + true CNTRL_ADDR_UNIVERSAL pt_int16 - iq_none - iq_none + t_iq_none + int const int - Src/myXilinx/RS_Functions.c + Src/DebugTools/Src/myXilinx/RS_Functions.c false false - false + false + true CONST_15 pt_int32 - iq - iq_none + t_iq + int _iq - Src/myLibs/mathlib.c + Src/DebugTools/Src/myLibs/mathlib.c false false - false + false + true CONST_23 pt_int32 - iq - iq_none + t_iq + int _iq - Src/myLibs/mathlib.c + Src/DebugTools/Src/myLibs/mathlib.c false false - false + false + true CanOpenUnites pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[30] - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true CanTimeOutErrorTR pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true Controll pt_union - iq_none - iq_none + t_iq_none + int XControll_reg - Src/myXilinx/Spartan2E_Functions.c + Src/DebugTools/Src/myXilinx/Spartan2E_Functions.c false false - false + false + true Dpwm pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTMSHandle.c + Src/DebugTools/Src/main/PWMTMSHandle.c false false - false + false + true Dpwm2 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTMSHandle.c + Src/DebugTools/Src/main/PWMTMSHandle.c false false - false + false + true Dpwm4 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTMSHandle.c + Src/DebugTools/Src/main/PWMTMSHandle.c false false - false + false + true EvaTimer1InterruptCount pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/281xEvTimersInit.c + Src/DebugTools/Src/main/281xEvTimersInit.c false false - false + false + true EvaTimer2InterruptCount pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/281xEvTimersInit.c + Src/DebugTools/Src/main/281xEvTimersInit.c false false - false + false + true EvbTimer3InterruptCount pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/281xEvTimersInit.c + Src/DebugTools/Src/main/281xEvTimersInit.c false false - false + false + true EvbTimer4InterruptCount pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/281xEvTimersInit.c + Src/DebugTools/Src/main/281xEvTimersInit.c false false - false + false + true Fpwm pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTMSHandle.c + Src/DebugTools/Src/main/PWMTMSHandle.c false false - false + false + true Gott pt_arr_int8 - iq_none - iq_none + t_iq_none + int char[8][16] - Src/myLibs/bender.c + Src/DebugTools/Src/myLibs/bender.c false - true + True - false + false + true IN0finishAddr pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true IN0startAddr pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true IN1finishAddr pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true IN1startAddr pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true IN2finishAddr pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true IN2startAddr pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true IQ_OUT_NOM pt_float - iq_none - iq_none + t_iq_none + int float - Src/main/params_i_out.c + Src/DebugTools/Src/main/params_i_out.c false false - false + false + true I_OUT_1_6_NOMINAL_IQ pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/main/params_i_out.c + Src/DebugTools/Src/main/params_i_out.c false false - false + false + true I_OUT_1_8_NOMINAL_IQ pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/main/params_i_out.c + Src/DebugTools/Src/main/params_i_out.c false false - false + false + true I_OUT_NOMINAL pt_float - iq_none - iq_none + t_iq_none + int float - Src/main/params_i_out.c + Src/DebugTools/Src/main/params_i_out.c false false - false + false + true I_OUT_NOMINAL_IQ pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/main/params_i_out.c + Src/DebugTools/Src/main/params_i_out.c false false - false + false + true I_ZPT_NOMINAL_IQ pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/main/params_i_out.c + Src/DebugTools/Src/main/params_i_out.c false false - false + false + true Id_out_max_full pt_int32 - iq - iq_none + t_iq + int _iq - Src/VectorControl/regul_power.c + Src/DebugTools/Src/VectorControl/regul_power.c false false - false + false + true Id_out_max_low_speed pt_int32 - iq - iq_none + t_iq + int _iq - Src/VectorControl/regul_power.c + Src/DebugTools/Src/VectorControl/regul_power.c false false - false + false + true Iq_out_max pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/params_i_out.c + Src/DebugTools/Src/main/params_i_out.c false false - false + false + true Iq_out_nom pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/params_i_out.c + Src/DebugTools/Src/main/params_i_out.c false false - false + false + true K_LEM_ADC pt_arr_uint32 - iq_none - iq_none + t_iq_none + int const unsigned long[20] - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true KmodTerm pt_float - iq_none - iq_none + t_iq_none + int float - Src/myXilinx/RS_Functions.c + Src/DebugTools/Src/myXilinx/RS_Functions.c false false - false + false + true ROTfinishAddr pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true RS_Len pt_arr_uint16 - iq_none - iq_none + t_iq_none + int unsigned int[70] - Src/myXilinx/RS_Functions.c + Src/DebugTools/Src/myXilinx/RS_Functions.c false false - false + false + true R_ADC pt_arr_uint16 - iq_none - iq_none + t_iq_none + int const unsigned int[20] - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true RotPlaneStartAddr pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true SQRT_32 pt_int32 - iq - iq_none + t_iq + int _iq - Src/myLibs/mathlib.c + Src/DebugTools/Src/myLibs/mathlib.c false false - false + false + true Unites pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[8][128] - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true VAR_FREQ_PWM_XTICS pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true VAR_PERIOD_MAX_XTICS pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true VAR_PERIOD_MIN_BR_XTICS pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true VAR_PERIOD_MIN_XTICS pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true Zpwm pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTMSHandle.c + Src/DebugTools/Src/main/PWMTMSHandle.c false false - false + false + true a pt_struct - iq_none - iq_none + t_iq_none + int WINDING - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true addrToSent pt_union - iq_none - iq_none + t_iq_none + int volatile AddrToSent - Src/myXilinx/xPeriphSP6_loader.c + Src/DebugTools/Src/myXilinx/xPeriphSP6_loader.c false false - false + false + true adr_read_from_modbus3 pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/myXilinx/RS_Functions_modbus.c + Src/DebugTools/Src/myXilinx/RS_Functions_modbus.c false false - false + false + true alarm_log_can pt_struct - iq_none - iq_none + t_iq_none + int ALARM_LOG_CAN - Src/myLibs/alarm_log_can.c + Src/DebugTools/Src/myLibs/alarm_log_can.c false false - false + false + true alarm_log_can_setup pt_struct - iq_none - iq_none + t_iq_none + int ALARM_LOG_CAN_SETUP - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true analog pt_struct - iq_none - iq_none + t_iq_none + int ANALOG_VALUE - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true ar_sa_all pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[3][6][4][7] - Src/main/v_pwm24.c + Src/DebugTools/Src/main/v_pwm24.c false false - false + false + true ar_tph pt_int32 - iq - iq_none + t_iq + int _iq[7] - Src/main/v_pwm24.c + Src/DebugTools/Src/main/v_pwm24.c false false - false + false + true biTemperatureLimits pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[12] - Src/main/init_protect_levels.c + Src/DebugTools/Src/main/init_protect_levels.c false - true + True - false + false + true biTemperatureWarnings pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[12] - Src/main/init_protect_levels.c + Src/DebugTools/Src/main/init_protect_levels.c false - true + True - false + false + true block_size_counter_fast pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/log_to_memory.c + Src/DebugTools/Src/myLibs/log_to_memory.c false false - false + false + true block_size_counter_slow pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/log_to_memory.c + Src/DebugTools/Src/myLibs/log_to_memory.c false false - false + false + true break_result_1 pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/break_regul.c + Src/DebugTools/Src/main/break_regul.c false false - false + false + true break_result_2 pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/break_regul.c + Src/DebugTools/Src/main/break_regul.c false false - false + false + true break_result_3 pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/break_regul.c + Src/DebugTools/Src/main/break_regul.c false false - false + false + true break_result_4 pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/break_regul.c + Src/DebugTools/Src/main/break_regul.c false false - false + false + true bvTemperatureLimits pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[12] - Src/main/init_protect_levels.c + Src/DebugTools/Src/main/init_protect_levels.c false - true + True - false + false + true bvTemperatureWarnings pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[12] - Src/main/init_protect_levels.c + Src/DebugTools/Src/main/init_protect_levels.c false - true + True - false + false + true byte pt_union - iq_none - iq_none + t_iq_none + int Byte - Src/myXilinx/xPeriphSP6_loader.c + Src/DebugTools/Src/myXilinx/xPeriphSP6_loader.c false false - false + false + true c_s pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/main/rotation_speed.c + Src/DebugTools/Src/main/rotation_speed.c false false - false + false + true calibration1 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/isolation.c + Src/DebugTools/Src/main/isolation.c false false - false + false + true calibration2 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/isolation.c + Src/DebugTools/Src/main/isolation.c false false - false + false + true callfunc pt_struct - iq_none - iq_none + t_iq_none + int test_functions - Src/main/Main.c + Src/DebugTools/Src/main/Main.c false false - false + false + true canopen_can_setup pt_struct - iq_none - iq_none + t_iq_none + int CANOPEN_CAN_SETUP - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true capnum0 pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/main/sync_tools.c + Src/DebugTools/Src/main/sync_tools.c false false - false + false + true capnum1 pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/main/sync_tools.c + Src/DebugTools/Src/main/sync_tools.c false false - false + false + true capnum2 pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/main/sync_tools.c + Src/DebugTools/Src/main/sync_tools.c false false - false + false + true capnum3 pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/main/sync_tools.c + Src/DebugTools/Src/main/sync_tools.c false false - false + false + true chNum pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/myXilinx/x_example_all.c + Src/DebugTools/Src/myXilinx/x_example_all.c false false - false + false + true chanell1 pt_struct - iq_none - iq_none + t_iq_none + int BREAK_PHASE_I - Src/main/detect_phase.c + Src/DebugTools/Src/main/detect_phase.c false false - false + false + true chanell2 pt_struct - iq_none - iq_none + t_iq_none + int BREAK_PHASE_I - Src/main/detect_phase.c + Src/DebugTools/Src/main/detect_phase.c false false - false + false + true cmd_3_or_16 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/RS_Functions_modbus.c + Src/DebugTools/Src/myXilinx/RS_Functions_modbus.c false false - false + false + true cmd_crc pt_arr_int8 - iq_none - iq_none + t_iq_none + int char[4] - Src/myLibs/bender.c + Src/DebugTools/Src/myLibs/bender.c false - true + True - false + false + true cmd_finish1 pt_int8 - iq_none - iq_none + t_iq_none + int char - Src/myLibs/bender.c + Src/DebugTools/Src/myLibs/bender.c false - true + True - false + false + true cmd_finish2 pt_int8 - iq_none - iq_none + t_iq_none + int char - Src/myLibs/bender.c + Src/DebugTools/Src/myLibs/bender.c false - true + True - false + false + true cmd_start pt_arr_int8 - iq_none - iq_none + t_iq_none + int char[5] - Src/myLibs/bender.c + Src/DebugTools/Src/myLibs/bender.c false - true + True - false + false + true cmd_txt pt_arr_int8 - iq_none - iq_none + t_iq_none + int char[4][8] - Src/myLibs/bender.c + Src/DebugTools/Src/myLibs/bender.c false - true + True - false + false + true compress_size pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/alarm_log_can.c + Src/DebugTools/Src/myLibs/alarm_log_can.c false false - false + false + true controlReg pt_union - iq_none - iq_none + t_iq_none + int ControlReg - Src/myXilinx/xPeriphSP6_loader.c + Src/DebugTools/Src/myXilinx/xPeriphSP6_loader.c false false - false + false + true cos_fi pt_struct - iq_none - iq_none + t_iq_none + int COS_FI_STRUCT - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true count_error_sync pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/main/sync_tools.c + Src/DebugTools/Src/main/sync_tools.c false false - false + false + true count_modbus_table_changed pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/modbus_fill_table.c + Src/DebugTools/Src/myLibs/modbus_fill_table.c false false - false + false + true count_run_pch pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true counterSBWriteErrors pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/myXilinx/x_serial_bus.c + Src/DebugTools/Src/myXilinx/x_serial_bus.c false - true + True - false + false + true crc_16_tab pt_arr_uint16 - iq_none - iq_none + t_iq_none + int WORD[256] - Src/myXilinx/CRC_Functions.c + Src/DebugTools/Src/myXilinx/CRC_Functions.c false false - false + false + true crypt pt_arr_int8 - iq_none - iq_none + t_iq_none + int char[34] - Src/myLibs/bender.c + Src/DebugTools/Src/myLibs/bender.c false false - false + false + true cur_position_buf_modbus16 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/message_modbus.c + Src/DebugTools/Src/myLibs/message_modbus.c false - true + True - false + false + true cur_position_buf_modbus16_can pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/message_modbus.c + Src/DebugTools/Src/myLibs/message_modbus.c false false - false + false + true cur_position_buf_modbus3 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/message_modbus.c + Src/DebugTools/Src/myLibs/message_modbus.c false - true + True - false + false + true cycle pt_arr_struct - iq_none - iq_none + t_iq_none + int CYCLE[32] - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true data_to_umu1_7f pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/init_protect_levels.c + Src/DebugTools/Src/main/init_protect_levels.c false - true + True - false + false + true data_to_umu1_8 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/init_protect_levels.c + Src/DebugTools/Src/main/init_protect_levels.c false - true + True - false + false + true data_to_umu2_7f pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/init_protect_levels.c + Src/DebugTools/Src/main/init_protect_levels.c false - true + True - false + false + true data_to_umu2_8 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/init_protect_levels.c + Src/DebugTools/Src/main/init_protect_levels.c false - true + True - false + false + true delta_capnum pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/sync_tools.c + Src/DebugTools/Src/main/sync_tools.c false false - false + false + true delta_error pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/sync_tools.c + Src/DebugTools/Src/main/sync_tools.c false false - false + false + true doors pt_union - iq_none - iq_none + t_iq_none + int volatile DOORS_STATUS - Src/main/doors_control.c + Src/DebugTools/Src/main/doors_control.c false false - false + false + true dq_to_ab pt_struct - iq_none - iq_none + t_iq_none + int DQ_TO_ALPHABETA - Src/main/v_pwm24.c + Src/DebugTools/Src/main/v_pwm24.c false - true + True - false + false + true enable_can pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/message_modbus.c + Src/DebugTools/Src/myLibs/message_modbus.c false false - false + false + true enable_can_recive_after_units_box pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true err_level_adc pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true err_level_adc_on_go pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true err_main pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/main/Main.c + Src/DebugTools/Src/main/Main.c false false - false + false + true err_modbus16 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/RS_Functions_modbus.c + Src/DebugTools/Src/myXilinx/RS_Functions_modbus.c false false - false + false + true err_modbus3 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/RS_Functions_modbus.c + Src/DebugTools/Src/myXilinx/RS_Functions_modbus.c false false - false + false + true errors pt_struct - iq_none - iq_none + t_iq_none + int ERRORS - Src/main/errors.c + Src/DebugTools/Src/main/errors.c false false - false + false + true f pt_struct - iq_none - iq_none + t_iq_none + int FLAG - Src/main/Main.c + Src/DebugTools/Src/main/Main.c false false - false + false + true fail pt_int16 - iq_none - iq_none + t_iq_none + int volatile int - Src/myXilinx/xPeriphSP6_loader.c + Src/DebugTools/Src/myXilinx/xPeriphSP6_loader.c false false - false + false + true faults pt_struct - iq_none - iq_none + t_iq_none + int FAULTS - Src/main/errors.c + Src/DebugTools/Src/main/errors.c false false - false + false + true fifo pt_struct - iq_none - iq_none + t_iq_none + int FIFO - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true filter pt_struct - iq_none - iq_none + t_iq_none + int ANALOG_VALUE - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true flag_buf pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/rotation_speed.c + Src/DebugTools/Src/main/rotation_speed.c false false - false + false + true flag_enable_can_from_mpu pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true flag_enable_can_from_terminal pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true flag_on_off_pch pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true flag_received_first_mess_from_MPU pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/myXilinx/RS_Functions_modbus.c + Src/DebugTools/Src/myXilinx/RS_Functions_modbus.c false false - false + false + true flag_reverse pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/myLibs/modbus_read_table.c + Src/DebugTools/Src/myLibs/modbus_read_table.c false false - false + false + true flag_send_answer_rs pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/myXilinx/RS_Functions_modbus.c + Src/DebugTools/Src/myXilinx/RS_Functions_modbus.c false false - false + false + true flag_test_tabe_filled pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/modbus_fill_table.c + Src/DebugTools/Src/myLibs/modbus_fill_table.c false false - false + false + true flag_we_int_pwm_on pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true freq1 pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true freqTerm pt_float - iq_none - iq_none + t_iq_none + int float - Src/myXilinx/RS_Functions.c + Src/DebugTools/Src/myXilinx/RS_Functions.c false false - false + false + true global_time pt_struct - iq_none - iq_none + t_iq_none + int GLOBAL_TIME - Src/main/global_time.c + Src/DebugTools/Src/main/global_time.c false false - false + false + true hb_logs_data pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/log_to_memory.c + Src/DebugTools/Src/myLibs/log_to_memory.c false false - false + false + true i pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true i1_out pt_struct - iq_none - iq_none + t_iq_none + int BREAK2_PHASE - Src/main/errors.c + Src/DebugTools/Src/main/errors.c false false - false + false + true i2_out pt_struct - iq_none - iq_none + t_iq_none + int BREAK2_PHASE - Src/main/errors.c + Src/DebugTools/Src/main/errors.c false false - false + false + true init_log pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[3] - Src/myLibs/log_can.c + Src/DebugTools/Src/myLibs/log_can.c false false - false + false + true iq19_k_norm_ADC pt_int32 - iq19 - iq_none + t_iq19 + int _iq19[20] - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true iq19_zero_ADC pt_int32 - iq19 - iq_none + t_iq19 + int _iq19[20] - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true iq_alfa_coef pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/v_pwm24.c + Src/DebugTools/Src/main/v_pwm24.c false false - false + false + true iq_k_norm_ADC pt_int32 - iq - iq_none + t_iq + int _iq[20] - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true iq_logpar pt_struct - iq_none - iq_none + t_iq_none + int IQ_LOGSPARAMS - Src/myLibs/log_to_memory.c + Src/DebugTools/Src/myLibs/log_to_memory.c false false - false + false + true iq_max pt_int32 - iq - iq_none + t_iq + int _iq - Src/myLibs/svgen_dq_v2.c + Src/DebugTools/Src/myLibs/svgen_dq_v2.c false false - false + false + true iq_norm_ADC pt_int32 - iq - iq_none + t_iq + int _iq[20] - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true isolation1 pt_struct - iq_none - iq_none + t_iq_none + int ISOLATION - Src/main/isolation.c + Src/DebugTools/Src/main/isolation.c false false - false + false + true isolation2 pt_struct - iq_none - iq_none + t_iq_none + int ISOLATION - Src/main/isolation.c + Src/DebugTools/Src/main/isolation.c false false - false + false + true k1 pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true kI_D pt_float - iq_none - iq_none + t_iq_none + int float - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true kI_D_Inv31 pt_float - iq_none - iq_none + t_iq_none + int float - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true kI_Q pt_float - iq_none - iq_none + t_iq_none + int float - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true kI_Q_Inv31 pt_float - iq_none - iq_none + t_iq_none + int float - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true kP_D pt_float - iq_none - iq_none + t_iq_none + int float - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true kP_D_Inv31 pt_float - iq_none - iq_none + t_iq_none + int float - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true kP_Q pt_float - iq_none - iq_none + t_iq_none + int float - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true kP_Q_Inv31 pt_float - iq_none - iq_none + t_iq_none + int float - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true kan pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/bender.c + Src/DebugTools/Src/myLibs/bender.c false - true + True - false + false + true koef_Base_stop_run pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/break_regul.c + Src/DebugTools/Src/main/break_regul.c false false - false + false + true koef_Iabc_filter pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true koef_Im_filter pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true koef_Im_filter_long pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true koef_K_stop_run pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/break_regul.c + Src/DebugTools/Src/main/break_regul.c false false - false + false + true koef_Krecup pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/break_regul.c + Src/DebugTools/Src/main/break_regul.c false false - false + false + true koef_Min_recup pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/break_regul.c + Src/DebugTools/Src/main/break_regul.c false false - false + false + true koef_TemperBSU_long_filter pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true koef_Ud_fast_filter pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true koef_Ud_long_filter pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true koef_Wlong pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c false false - false + false + true koef_Wout_filter pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/rotation_speed.c + Src/DebugTools/Src/main/rotation_speed.c false false - false + false + true koef_Wout_filter_long pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/rotation_speed.c + Src/DebugTools/Src/main/rotation_speed.c false false - false + false + true koeff_Fs_filter pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true koeff_Idq_filter pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true koeff_Iq_filter pt_int32 - iq - iq_none + t_iq + int _iq - Src/VectorControl/regul_power.c + Src/DebugTools/Src/VectorControl/regul_power.c false false - false + false + true koeff_Iq_filter_slow pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true koeff_Ud_filter pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true koeff_Uq_filter pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true kom pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/bender.c + Src/DebugTools/Src/myLibs/bender.c false - true + True - false + false + true length pt_uint32 - iq_none - iq_none + t_iq_none + int volatile unsigned long - Src/myXilinx/xPeriphSP6_loader.c + Src/DebugTools/Src/myXilinx/xPeriphSP6_loader.c false false - false + false + true level_on_off_break pt_int32 - iq - iq_none + t_iq + int _iq[13][2] - Src/main/break_tools.c + Src/DebugTools/Src/main/break_tools.c false false - false + false + true log_can pt_struct - iq_none - iq_none + t_iq_none + int logcan_TypeDef - Src/myLibs/log_can.c + Src/DebugTools/Src/myLibs/log_can.c false false - false + false + true log_can_setup pt_struct - iq_none - iq_none + t_iq_none + int LOG_CAN_SETUP - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true log_params pt_struct - iq_none - iq_none + t_iq_none + int TYPE_LOG_PARAMS - Src/myLibs/log_params.c + Src/DebugTools/Src/myLibs/log_params.c false false - false + false + true logbuf_sync1 pt_arr_int32 - iq_none - iq_none + t_iq_none + int long[10] - Src/main/sync_tools.c + Src/DebugTools/Src/main/sync_tools.c false false - false + false + true logpar pt_struct - iq_none - iq_none + t_iq_none + int LOGSPARAMS - Src/myLibs/log_to_memory.c + Src/DebugTools/Src/myLibs/log_to_memory.c false false - false + false + true mPWM_a pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTMSHandle.c + Src/DebugTools/Src/main/PWMTMSHandle.c false - true + True - false + false + true mPWM_b pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTMSHandle.c + Src/DebugTools/Src/main/PWMTMSHandle.c false - true + True - false + false + true m_PWM pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/PWMTMSHandle.c + Src/DebugTools/Src/main/PWMTMSHandle.c false false - false + false + true mailboxs_can_setup pt_struct - iq_none - iq_none + t_iq_none + int MAILBOXS_CAN_SETUP - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true manufactorerAndProductID pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/xPeriphSP6_loader.c + Src/DebugTools/Src/myXilinx/xPeriphSP6_loader.c false false - false + false + true modbus_table_can_in pt_ptr_union - iq_none - iq_none + t_iq_none + int MODBUS_REG_STRUCT * - Src/myLibs/modbus_table.c + Src/DebugTools/Src/myLibs/modbus_table.c false false - false + false + true modbus_table_can_out pt_ptr_union - iq_none - iq_none + t_iq_none + int MODBUS_REG_STRUCT * - Src/myLibs/modbus_table.c + Src/DebugTools/Src/myLibs/modbus_table.c false false - false + false + true modbus_table_in pt_arr_union - iq_none - iq_none + t_iq_none + int MODBUS_REG_STRUCT[450] - Src/myLibs/modbus_table.c + Src/DebugTools/Src/myLibs/modbus_table.c false false - false + false + true modbus_table_out pt_arr_union - iq_none - iq_none + t_iq_none + int MODBUS_REG_STRUCT[450] - Src/myLibs/modbus_table.c + Src/DebugTools/Src/myLibs/modbus_table.c false false - false + false + true modbus_table_rs_in pt_ptr_union - iq_none - iq_none + t_iq_none + int MODBUS_REG_STRUCT * - Src/myLibs/modbus_table.c + Src/DebugTools/Src/myLibs/modbus_table.c false false - false + false + true modbus_table_rs_out pt_ptr_union - iq_none - iq_none + t_iq_none + int MODBUS_REG_STRUCT * - Src/myLibs/modbus_table.c + Src/DebugTools/Src/myLibs/modbus_table.c false false - false + false + true modbus_table_test pt_arr_union - iq_none - iq_none + t_iq_none + int MODBUS_REG_STRUCT[450] - Src/myLibs/modbus_table.c + Src/DebugTools/Src/myLibs/modbus_table.c false false - false + false + true mpu_can_setup pt_struct - iq_none - iq_none + t_iq_none + int MPU_CAN_SETUP - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true mzz_limit_100 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/modbus_read_table.c + Src/DebugTools/Src/myLibs/modbus_read_table.c false - true + True - false + false + true mzz_limit_1000 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/modbus_read_table.c + Src/DebugTools/Src/myLibs/modbus_read_table.c false - true + True - false + false + true mzz_limit_1100 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/modbus_read_table.c + Src/DebugTools/Src/myLibs/modbus_read_table.c false - true + True - false + false + true mzz_limit_1200 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/modbus_read_table.c + Src/DebugTools/Src/myLibs/modbus_read_table.c false - true + True - false + false + true mzz_limit_1400 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/modbus_read_table.c + Src/DebugTools/Src/myLibs/modbus_read_table.c false - true + True - false + false + true mzz_limit_1500 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/modbus_read_table.c + Src/DebugTools/Src/myLibs/modbus_read_table.c false - true + True - false + false + true mzz_limit_2000 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/modbus_read_table.c + Src/DebugTools/Src/myLibs/modbus_read_table.c false - true + True - false + false + true mzz_limit_500 pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/modbus_read_table.c + Src/DebugTools/Src/myLibs/modbus_read_table.c false - true + True - false + false + true new_cycle_fifo pt_struct - iq_none - iq_none + t_iq_none + int NEW_CYCLE_FIFO - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true no_write pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/log_to_memory.c + Src/DebugTools/Src/myLibs/log_to_memory.c false false - false + false + true no_write_slow pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/log_to_memory.c + Src/DebugTools/Src/myLibs/log_to_memory.c false false - false + false + true number_modbus_table_changed pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/modbus_fill_table.c + Src/DebugTools/Src/myLibs/modbus_fill_table.c false false - false + false + true optical_read_data pt_struct - iq_none - iq_none + t_iq_none + int OPTICAL_BUS_DATA - Src/main/optical_bus.c + Src/DebugTools/Src/main/optical_bus.c false false - false + false + true optical_write_data pt_struct - iq_none - iq_none + t_iq_none + int OPTICAL_BUS_DATA - Src/main/optical_bus.c + Src/DebugTools/Src/main/optical_bus.c false false - false + false + true options_controller pt_arr_union - iq_none - iq_none + t_iq_none + int MODBUS_REG_STRUCT[200] - Src/myXilinx/RS_Functions_modbus.c + Src/DebugTools/Src/myXilinx/RS_Functions_modbus.c false false - false + false + true pidCur_Ki pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/v_pwm24.c + Src/DebugTools/Src/main/v_pwm24.c false false - false + false + true pidD pt_struct - iq_none - iq_none + t_iq_none + int PIDREG3 - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true pidD2 pt_struct - iq_none - iq_none + t_iq_none + int PIDREG3 - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true pidFvect pt_struct - iq_none - iq_none + t_iq_none + int PIDREG3 - Src/VectorControl/regul_turns.c + Src/DebugTools/Src/VectorControl/regul_turns.c false false - false + false + true pidFvectKi_test pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/message2.c + Src/DebugTools/Src/main/message2.c false false - false + false + true pidFvectKp_test pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/message2.c + Src/DebugTools/Src/main/message2.c false false - false + false + true pidPvect pt_struct - iq_none - iq_none + t_iq_none + int PIDREG3 - Src/VectorControl/regul_power.c + Src/DebugTools/Src/VectorControl/regul_power.c false false - false + false + true pidQ pt_struct - iq_none - iq_none + t_iq_none + int PIDREG3 - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true pidQ2 pt_struct - iq_none - iq_none + t_iq_none + int PIDREG3 - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true pidReg_koeffs pt_struct - iq_none - iq_none + t_iq_none + int PIDREG_KOEFFICIENTS - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true pidTetta pt_struct - iq_none - iq_none + t_iq_none + int PIDREG3 - Src/VectorControl/teta_calc.c + Src/DebugTools/Src/VectorControl/teta_calc.c false false - false + false + true power_ratio pt_struct - iq_none - iq_none + t_iq_none + int POWER_RATIO - Src/myLibs/modbus_read_table.c + Src/DebugTools/Src/myLibs/modbus_read_table.c false false - false + false + true prev_flag_buf pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/main/rotation_speed.c + Src/DebugTools/Src/main/rotation_speed.c false false - false + false + true prev_status_received pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/myLibs/log_can.c + Src/DebugTools/Src/myLibs/log_can.c false false - false + false + true project pt_struct - iq_none - iq_none + t_iq_none + int T_project - Src/myXilinx/xp_project.c + Src/DebugTools/Src/myXilinx/xp_project.c false false - false + false + true pwmd pt_struct - iq_none - iq_none + t_iq_none + int PWMGEND - Src/main/PWMTMSHandle.c + Src/DebugTools/Src/main/PWMTMSHandle.c false false - false + false + true r_c_sbus pt_struct - iq_none - iq_none + t_iq_none + int T_controller_read - Src/myXilinx/x_serial_bus.c + Src/DebugTools/Src/myXilinx/x_serial_bus.c false false - false + false + true r_controller pt_struct - iq_none - iq_none + t_iq_none + int T_controller_read - Src/myXilinx/xp_hwp.c + Src/DebugTools/Src/myXilinx/xp_hwp.c false false - false + false + true refo pt_struct - iq_none - iq_none + t_iq_none + int FIFO - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true reply pt_struct - iq_none - iq_none + t_iq_none + int TMS_TO_TERMINAL_STRUCT - Src/myXilinx/RS_Functions_modbus.c + Src/DebugTools/Src/myXilinx/RS_Functions_modbus.c false false - false + false + true reply_test_all pt_struct - iq_none - iq_none + t_iq_none + int TMS_TO_TERMINAL_TEST_ALL_STRUCT - Src/myXilinx/RS_Functions_modbus.c + Src/DebugTools/Src/myXilinx/RS_Functions_modbus.c false false - false + false + true return_var pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/main/Main.c + Src/DebugTools/Src/main/Main.c false false - false + false + true rmp_freq pt_struct - iq_none - iq_none + t_iq_none + int RMP_MY1 - Src/main/PWMTools.c + Src/DebugTools/Src/main/PWMTools.c false false - false + false + true rmp_wrot pt_struct - iq_none - iq_none + t_iq_none + int RMP_MY1 - Src/main/rotation_speed.c + Src/DebugTools/Src/main/rotation_speed.c false false - false + false + true rotation_sensor pt_struct - iq_none - iq_none + t_iq_none + int T_rotation_sensor - Src/myXilinx/xp_rotation_sensor.c + Src/DebugTools/Src/myXilinx/xp_rotation_sensor.c false false - false + false + true rotor pt_struct - iq_none - iq_none + t_iq_none + int ROTOR_VALUE - Src/main/rotation_speed.c + Src/DebugTools/Src/main/rotation_speed.c false false - false + false + true rs_a pt_struct - iq_none - iq_none + t_iq_none + int RS_DATA_STRUCT - Src/myXilinx/RS_Functions.c + Src/DebugTools/Src/myXilinx/RS_Functions.c false false - false + false + true rs_b pt_struct - iq_none - iq_none + t_iq_none + int RS_DATA_STRUCT - Src/myXilinx/RS_Functions.c + Src/DebugTools/Src/myXilinx/RS_Functions.c false false - false + false + true sincronisationFault pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/myLibs/modbus_read_table.c + Src/DebugTools/Src/myLibs/modbus_read_table.c false false - false + false + true size_cmd15 pt_int8 - iq_none - iq_none + t_iq_none + int char - Src/myXilinx/RS_Functions.c + Src/DebugTools/Src/myXilinx/RS_Functions.c false false - false + false + true size_cmd16 pt_int8 - iq_none - iq_none + t_iq_none + int char - Src/myXilinx/RS_Functions.c + Src/DebugTools/Src/myXilinx/RS_Functions.c false false - false + false + true size_fast_done pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/log_to_memory.c + Src/DebugTools/Src/myLibs/log_to_memory.c false false - false + false + true size_slow_done pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/log_to_memory.c + Src/DebugTools/Src/myLibs/log_to_memory.c false false - false + false + true stop_log pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/log_to_memory.c + Src/DebugTools/Src/myLibs/log_to_memory.c false false - false + false + true stop_log_slow pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/log_to_memory.c + Src/DebugTools/Src/myLibs/log_to_memory.c false false - false + false + true svgen_dq_1 pt_struct - iq_none - iq_none + t_iq_none + int SVGENDQ - Src/main/v_pwm24.c + Src/DebugTools/Src/main/v_pwm24.c false false - false + false + true svgen_dq_2 pt_struct - iq_none - iq_none + t_iq_none + int SVGENDQ - Src/main/v_pwm24.c + Src/DebugTools/Src/main/v_pwm24.c false false - false + false + true svgen_pwm24_1 pt_struct - iq_none - iq_none + t_iq_none + int SVGEN_PWM24 - Src/main/v_pwm24.c + Src/DebugTools/Src/main/v_pwm24.c false false - false + false + true svgen_pwm24_2 pt_struct - iq_none - iq_none + t_iq_none + int SVGEN_PWM24 - Src/main/v_pwm24.c + Src/DebugTools/Src/main/v_pwm24.c false false - false + false + true temp pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/main/sync_tools.c + Src/DebugTools/Src/main/sync_tools.c false false - false + false + true temperature_limit_koeff pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/errors_temperature.c + Src/DebugTools/Src/main/errors_temperature.c false false - false + false + true temperature_warning_BI1 pt_union - iq_none - iq_none + t_iq_none + int INVERTER_TEMPERATURES - Src/main/errors.c + Src/DebugTools/Src/main/errors.c false false - false + false + true temperature_warning_BI2 pt_union - iq_none - iq_none + t_iq_none + int INVERTER_TEMPERATURES - Src/main/errors.c + Src/DebugTools/Src/main/errors.c false false - false + false + true temperature_warning_BV1 pt_union - iq_none - iq_none + t_iq_none + int RECTIFIER_TEMPERATURES - Src/main/errors.c + Src/DebugTools/Src/main/errors.c false false - false + false + true temperature_warning_BV2 pt_union - iq_none - iq_none + t_iq_none + int RECTIFIER_TEMPERATURES - Src/main/errors.c + Src/DebugTools/Src/main/errors.c false false - false + false + true terminal_can_setup pt_struct - iq_none - iq_none + t_iq_none + int TERMINAL_CAN_SETUP - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true tetta_calc pt_struct - iq_none - iq_none + t_iq_none + int TETTA_CALC - Src/VectorControl/teta_calc.c + Src/DebugTools/Src/VectorControl/teta_calc.c false false - false + false + true timCNT_alg pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/Spartan2E_Functions.c + Src/DebugTools/Src/myXilinx/Spartan2E_Functions.c false false - false + false + true timCNT_prev pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myXilinx/Spartan2E_Functions.c + Src/DebugTools/Src/myXilinx/Spartan2E_Functions.c false false - false + false + true time pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/myXilinx/Spartan2E_Functions.c + Src/DebugTools/Src/myXilinx/Spartan2E_Functions.c false false - false + false + true timePauseBENDER_Messages pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/main/main22220.c + Src/DebugTools/Src/main/main22220.c false - true + True - false + false + true timePauseCAN_Messages pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/main/main22220.c + Src/DebugTools/Src/main/main22220.c false - true + True - false + false + true time_alg pt_float - iq_none - iq_none + t_iq_none + int float - Src/myXilinx/Spartan2E_Functions.c + Src/DebugTools/Src/myXilinx/Spartan2E_Functions.c false false - false + false + true time_pause_enable_can_from_mpu pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true time_pause_enable_can_from_terminal pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true time_pause_logs pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/log_can.c + Src/DebugTools/Src/myLibs/log_can.c false false - false + false + true time_pause_titles pt_int16 - iq_none - iq_none + t_iq_none + int int - Src/myLibs/log_can.c + Src/DebugTools/Src/myLibs/log_can.c false false - false + false + true tryNumb pt_int16 - iq_none - iq_none + t_iq_none + int volatile int - Src/myXilinx/xPeriphSP6_loader.c + Src/DebugTools/Src/myXilinx/xPeriphSP6_loader.c false false - false + false + true unites_can_setup pt_struct - iq_none - iq_none + t_iq_none + int UNITES_CAN_SETUP - Src/myLibs/CAN_Setup.c + Src/DebugTools/Src/myLibs/CAN_Setup.c false false - false + false + true var_numb pt_int32 - iq_none - iq_none + t_iq_none + int long - Src/main/Main.c + Src/DebugTools/Src/main/Main.c false false - false + false + true vect_control pt_struct - iq_none - iq_none + t_iq_none + int VECTOR_CONTROL - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true water_cooler pt_struct - iq_none - iq_none + t_iq_none + int WaterCooler - Src/myLibs/can_watercool.c + Src/DebugTools/Src/myLibs/can_watercool.c false false - false + false + true winding_displacement pt_int32 - iq - iq_none + t_iq + int _iq - Src/main/v_pwm24.c + Src/DebugTools/Src/main/v_pwm24.c false false - false + false + true word pt_union - iq_none - iq_none + t_iq_none + int Word - Src/myXilinx/xPeriphSP6_loader.c + Src/DebugTools/Src/myXilinx/xPeriphSP6_loader.c false false - false + false + true wordReversed pt_union - iq_none - iq_none + t_iq_none + int WordReversed - Src/myXilinx/xPeriphSP6_loader.c + Src/DebugTools/Src/myXilinx/xPeriphSP6_loader.c false false - false + false + true wordToReverse pt_union - iq_none - iq_none + t_iq_none + int WordToReverse - Src/myXilinx/xPeriphSP6_loader.c + Src/DebugTools/Src/myXilinx/xPeriphSP6_loader.c false false - false + false + true x_parallel_bus_project pt_struct - iq_none - iq_none + t_iq_none + int X_PARALLEL_BUS - Src/myXilinx/x_parallel_bus.c + Src/DebugTools/Src/myXilinx/x_parallel_bus.c false false - false + false + true x_serial_bus_project pt_struct - iq_none - iq_none + t_iq_none + int X_SERIAL_BUS - Src/myXilinx/x_serial_bus.c + Src/DebugTools/Src/myXilinx/x_serial_bus.c false false - false + false + true xeeprom_controll_fast pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/myXilinx/Spartan2E_Functions.c + Src/DebugTools/Src/myXilinx/Spartan2E_Functions.c false false - false + false + true xeeprom_controll_store pt_uint16 - iq_none - iq_none + t_iq_none + int unsigned int - Src/myXilinx/Spartan2E_Functions.c + Src/DebugTools/Src/myXilinx/Spartan2E_Functions.c false false - false + false + true xpwm_time pt_struct - iq_none - iq_none + t_iq_none + int XPWM_TIME - Src/myXilinx/xp_write_xpwm_time.c + Src/DebugTools/Src/myXilinx/xp_write_xpwm_time.c false false - false + false + true zadan_Id_min pt_int32 - iq - iq_none + t_iq + int _iq - Src/VectorControl/pwm_vector_regul.c + Src/DebugTools/Src/VectorControl/pwm_vector_regul.c false false - false + false + true zero_ADC pt_arr_int16 - iq_none - iq_none + t_iq_none + int int[20] - Src/main/adc_tools.c + Src/DebugTools/Src/main/adc_tools.c + false + false + + + false + true + Bender.KOhms + pt_uint16 + t_iq_none + iq_none + unsigned int + Src/DebugTools/Src/myLibs/bender.c + false + false + + + false + true + Bender.Times + pt_uint16 + t_iq_none + iq_none + unsigned int + Src/DebugTools/Src/myLibs/bender.c + false + false + + + true + true + project.cds_tk.plane_address + pt_uint16 + t_iq_none + iq_none + UInt16 + Src/DebugTools/Src/myXilinx/xp_project.c false false + Src/myXilinx/xp_project.h Src/myXilinx/RS_Functions_modbus.h Src/main/vector.h - Src/myXilinx/xp_project.h + Src/main/errors.h + Src/main/adc_tools.h + Src/VectorControl/pwm_vector_regul.h + Src/myXilinx/xp_write_xpwm_time.h + Src/myLibs/log_can.h + Src/main/f281xpwm.h Src/main/v_pwm24.h Src/main/rotation_speed.h - Src/main/f281xpwm.h - Src/main/errors.h - Src/myXilinx/xp_write_xpwm_time.h - Src/VectorControl/pwm_vector_regul.h - Src/VectorControl/dq_to_alphabeta_cos.h Src/VectorControl/teta_calc.h - Src/main/adc_tools.h - Src/myLibs/log_can.h - Src/myXilinx/RS_Functions.h + Src/VectorControl/dq_to_alphabeta_cos.h Src/myXilinx/xp_controller.h - Src/myXilinx/xPeriphSP6_loader.h - Src/myXilinx/x_serial_bus.h Src/myXilinx/x_parallel_bus.h Src/myXilinx/xp_rotation_sensor.h + Src/myXilinx/xPeriphSP6_loader.h Src/myXilinx/Spartan2E_Functions.h - Src/myLibs/svgen_dq.h + Src/myXilinx/x_serial_bus.h + Src/myXilinx/RS_Functions.h Src/myLibs/detect_phase_break2.h - Src/myLibs/pid_reg3.h - Src/myXilinx/CRC_Functions.h - Src/myLibs/log_params.h - Src/myLibs/CAN_Setup.h Src/myLibs/log_to_memory.h + Src/myLibs/log_params.h Src/main/global_time.h + Src/myLibs/CAN_Setup.h + Src/myXilinx/CRC_Functions.h + Src/myLibs/svgen_dq.h + Src/myLibs/pid_reg3.h Src/myLibs/IQmathLib.h Src/main/doors_control.h Src/main/isolation.h