mirror of
https://github.com/goldenfishs/MRobot.git
synced 2025-07-05 06:54:17 +08:00
各种修复
This commit is contained in:
parent
e9eb169547
commit
34a0874156
3
.gitignore
vendored
3
.gitignore
vendored
@ -31,4 +31,5 @@ Examples/
|
|||||||
|
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
*.spec
|
*.spec
|
||||||
|
*.exe
|
@ -1,6 +1,6 @@
|
|||||||
[Setup]
|
[Setup]
|
||||||
AppName=MRobot
|
AppName=MRobot
|
||||||
AppVersion=1.0
|
AppVersion=1.0.1
|
||||||
DefaultDirName={userappdata}\MRobot
|
DefaultDirName={userappdata}\MRobot
|
||||||
DefaultGroupName=MRobot
|
DefaultGroupName=MRobot
|
||||||
OutputDir=.
|
OutputDir=.
|
||||||
|
@ -52,7 +52,7 @@ from qfluentwidgets import (
|
|||||||
from urllib.parse import quote
|
from urllib.parse import quote
|
||||||
|
|
||||||
from packaging.version import parse as vparse
|
from packaging.version import parse as vparse
|
||||||
__version__ = "1.0.0"
|
__version__ = "1.0.1"
|
||||||
|
|
||||||
# ===================== 页面基类 =====================
|
# ===================== 页面基类 =====================
|
||||||
class BaseInterface(QWidget):
|
class BaseInterface(QWidget):
|
||||||
@ -665,7 +665,7 @@ class DataInterface(BaseInterface):
|
|||||||
# 2. 在 /* USER CODE BEGIN RTOS_THREADS */ 区域添加 osThreadNew(Task_Init, NULL, &attr_init);
|
# 2. 在 /* USER CODE BEGIN RTOS_THREADS */ 区域添加 osThreadNew(Task_Init, NULL, &attr_init);
|
||||||
rtos_threads_pattern = r'(\/\* *USER CODE BEGIN RTOS_THREADS *\*\/\s*)(.*?)(\/\* *USER CODE END RTOS_THREADS *\*\/)'
|
rtos_threads_pattern = r'(\/\* *USER CODE BEGIN RTOS_THREADS *\*\/\s*)(.*?)(\/\* *USER CODE END RTOS_THREADS *\*\/)'
|
||||||
match = re.search(rtos_threads_pattern, code, re.DOTALL)
|
match = re.search(rtos_threads_pattern, code, re.DOTALL)
|
||||||
task_line = ' initTaskHandle = osThreadNew(Task_Init, NULL, &attr_init); // 创建初始化任务\n'
|
task_line = ' osThreadNew(Task_Init, NULL, &attr_init); // 创建初始化任务\n'
|
||||||
if match:
|
if match:
|
||||||
threads_code = match.group(2)
|
threads_code = match.group(2)
|
||||||
if 'Task_Init' not in threads_code:
|
if 'Task_Init' not in threads_code:
|
||||||
@ -1026,6 +1026,10 @@ class DataInterface(BaseInterface):
|
|||||||
with open(task_c_path, "w", encoding="utf-8") as f:
|
with open(task_c_path, "w", encoding="utf-8") as f:
|
||||||
f.write(code)
|
f.write(code)
|
||||||
|
|
||||||
|
# ----------- 保存任务配置到 config.yaml -----------
|
||||||
|
config_yaml_path = os.path.join(output_dir, "config.yaml")
|
||||||
|
with open(config_yaml_path, "w", encoding="utf-8") as f:
|
||||||
|
yaml.safe_dump(task_list, f, allow_unicode=True)
|
||||||
# ===================== 串口终端界面 =====================
|
# ===================== 串口终端界面 =====================
|
||||||
class SerialReadThread(QThread):
|
class SerialReadThread(QThread):
|
||||||
data_received = pyqtSignal(str)
|
data_received = pyqtSignal(str)
|
||||||
|
@ -40,4 +40,3 @@ void Task_Init(void *argument) {
|
|||||||
osKernelUnlock(); // 解锁内核
|
osKernelUnlock(); // 解锁内核
|
||||||
osThreadTerminate(osThreadGetId()); // 任务完成后结束自身
|
osThreadTerminate(osThreadGetId()); // 任务完成后结束自身
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,4 +54,4 @@ void {{task_function}}(void *argument) {
|
|||||||
osDelay(1); /* 默认1ms延时,防止死循环卡死CPU */
|
osDelay(1); /* 默认1ms延时,防止死循环卡死CPU */
|
||||||
}
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
}
|
}
|
||||||
|
@ -10,3 +10,4 @@ const osThreadAttr_t attr_init = {
|
|||||||
|
|
||||||
/* User_task */
|
/* User_task */
|
||||||
{{task_attr_definitions}}
|
{{task_attr_definitions}}
|
||||||
|
|
||||||
|
@ -78,3 +78,4 @@ void Task_Init(void *argument);
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user