默认信息机台名

This commit is contained in:
sc committed 2026-01-01 00:12:02 +08:00
1 parent c5fb58b732
commit 5bdb8cbe2b
5 files changed
+978 -942

No files matched your search

+937 -937
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>project</name>
<name>828F</name>
<comment />
<projects>
</projects>
+1 -1
View File
@@ -35,7 +35,7 @@ int read_write_sample(void)
}
// 读取各种类型的值
strncpy(machine_ID, ini_get_value(ini, "CONFIG", "ID","99"),sizeof(machine_ID));
machine_name = ini_get_value(ini, "CONFIG", "NAME","828");
machine_name = ini_get_value(ini, "CONFIG", "NAME","SC828");
//// ini_set_value(ini,"database", "host","192.168.9.1");
+37 -1
View File
@@ -131,6 +131,7 @@ void pasre_DAT(const char *api, const char *json_str)
cJSON_AddItemToObject(dat,"SYSTEMP",cJSON_CreateNumber(sys_temperature));
cJSON_AddItemToObject(dat,"SYSHUM",cJSON_CreateNumber(sys_humidity));
cJSON_AddItemToObject(dat,"SYSTIME",cJSON_CreateString(systime));
cJSON_AddItemToObject(dat,"NAME",cJSON_CreateString(machine_name));
cJSON_AddItemToObject(dat,"VAR",cJSON_CreateString(sys_var));
}
else if (strcmp(api, "SC810") == 0)
@@ -292,12 +293,47 @@ void pasre_DAT(const char *api, const char *json_str)
else if (strcmp(ins_, "INSERT") == 0)
{}
else if (strcmp(ins_, "EDIT") == 0)
{}
{
}
else if (strcmp(ins_, "DELETE") == 0)
{
int ID_s;
GET_INT_FROM_ANY(ID_s, root, "ID", sizeof(ID_s));
if (!(ID_s < 0 || ID_s >= 99))
{
// 1. 如果不是最后一项,将 [index+1, 98] 前移一位到 [index, 97]
if (ID_s < 98) {
memmove(&step_table[ID_s],&step_table[ID_s + 1],(98 - ID_s) * sizeof(IO_STEP_DATA));
}
}
// 2. 末尾(最后一个位置)填入空步骤
step_table[99].RUN = 0;
step_table[99].Parameter1 = 0;
step_table[99].Parameter2 = 0;
step_table[99].Parameter3 = 0;
step_table[99].Parameter4 = 0;
step_table[99].Parameter5 = 0;
step_table[99].Parameter1_S1 = 0;
step_table[99].Parameter2_S1 = 0;
step_table[99].Parameter3_S1 = 0;
step_table[99].Parameter4_S1 = 0;
step_table[99].Parameter5_S1 = 0;
step_table[99].Parameter1_S2 = 0;
step_table[99].Parameter2_S2 = 0;
step_table[99].Parameter3_S2 = 0;
step_table[99].Parameter4_S2 = 0;
step_table[99].Parameter5_S2 = 0;
step_table[99].Parameter1_S3 = 0;
step_table[99].Parameter2_S3 = 0;
step_table[99].Parameter3_S3 = 0;
step_table[99].Parameter4_S3 = 0;
step_table[99].Parameter5_S3 = 0;
rt_snprintf(step_table[99].StepID, 3,"000");
rt_snprintf(step_table[99].StepID_S1, 3,"000");
rt_snprintf(step_table[99].StepID_S2, 3,"000");
rt_snprintf(step_table[99].StepID_S3, 3,"000");
}
else
{}
+2 -2
View File
@@ -14,8 +14,8 @@ unsigned int sys_run_time;//运行时间
char *DATA_dat;
char DATA_machins[3];
char DATA_api[5];
char *machine_name = "828";
char machine_ID[3] = "1";
char *machine_name;
char machine_ID[3];
// 状态标志
char MACHINE_ERR = 0;