Browse Source

默认信息机台名

master
忱 沈 3 weeks ago
parent
commit
5bdb8cbe2b
  1. 4
      .cproject
  2. 2
      .project
  3. 2
      applications/INI/config.c
  4. 38
      applications/data/DATA_comm.c
  5. 4
      applications/data/Variable.c

4
.cproject

@ -1024,7 +1024,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="//rt-thread/components/dfs/dfs_v1/filesystems/romfs|//rt-thread/src/slab.c|//rt-thread/libcpu/m16c|//rt-thread/libcpu/arm/arm926|//rt-thread/libcpu/arm/cortex-a|//rt-thread/libcpu/arc|//rt-thread/libcpu/arm/common/divsi3.S|//rt-thread/components/drivers/pinctrl|//rt-thread/components/libc/compilers/armlibc|//rt-thread/libcpu/arm/s3c44b0|//rt-thread/components/drivers/serial/serial_tty.c|//rt-thread/components/dfs/dfs_v1/filesystems/mqueue|//rt-thread/libcpu/c-sky|//rt-thread/libcpu/avr32|//rt-thread/components/drivers/ktime|//rt-thread/components/drivers/rtc/alarm.c|//cubemx/EWARM|//rt-thread/components/drivers/sensor|//rt-thread/libcpu/arm/am335x|//rt-thread/components/dfs/dfs_v1/filesystems/cromfs|//rt-thread/components/drivers/can|//rt-thread/components/drivers/pin/pin_dm.c|//rt-thread/components/libc/compilers/picolibc|//rt-thread/components/legacy|//rt-thread/components/drivers/wlan|//rt-thread/libcpu/arm/cortex-r4|//rt-thread/libcpu/mips|//rt-thread/src/cpu.c|//rt-thread/components/drivers/ofw|//rt-thread/libcpu/arm/sep4020|packages/sqlite/rtthread_io_methods.c|//packages/sqlite/rtthread_io_methods.c|//rt-thread/libcpu/nios|//rt-thread/components/lwp|//rt-thread/libcpu/arm/dm36x|//rt-thread/components/drivers/misc|//rt-thread/components/drivers/pic|//rt-thread/components/drivers/mtd/mtd_nand.c|//rt-thread/components/drivers/core/driver.c|//rt-thread/libcpu/arm/cortex-m85|//rt-thread/components/libc/compilers/dlib|//rt-thread/components/dfs/dfs_v1/filesystems/skeleton|//rt-thread/components/drivers/i2c/i2c_dm.c|//rt-thread/components/drivers/serial/serial_v2.c|//rt-thread/components/mprotect|//rt-thread/libcpu/ppc|//rt-thread/components/drivers/hwcrypto|//rt-thread/libcpu/sparc-v8|//rt-thread/libcpu/unicore32|//cubemx/Src/stm32h7xx_it.c|//rt-thread/components/drivers/pm|//rt-thread/libcpu/risc-v|//rt-thread/libcpu/rx|//cubemx/Src/system_stm32h7xx.c|//packages/littlefs-v2.11.2/runners|//rt-thread/libcpu/arm/zynqmp-r5|//packages/LVGL-v8.3.11/tests|//rt-thread/libcpu/arm/cortex-m4|//rt-thread/libcpu/arm/cortex-m33|//rt-thread/src/mem.c|//rt-thread/libcpu/arm/AT91SAM7S|//rt-thread/components/libc/cplusplus|//rt-thread/libcpu/v850|//rt-thread/libcpu/xilinx|//rt-thread/libcpu/arm/common/atomic_arm.c|//rt-thread/libcpu/ia32|//rt-thread/components/drivers/fdt|//rt-thread/libcpu/arm/cortex-m23|//rt-thread/components/libc/compilers/musl|//rt-thread/components/dfs/dfs_v2|//rt-thread/components/drivers/core/dm.c|//rt-thread/components/drivers/core/platform.c|//rt-thread/components/drivers/i2c/i2c_bus.c|//rt-thread/libcpu/ti-dsp|//rt-thread/libcpu/sim|//packages/LVGL-v8.3.11/examples|//rt-thread/components/dfs/dfs_v1/filesystems/nfs|//rt-thread/components/drivers/core/platform_ofw.c|packages/sqlite/shell.c|//rt-thread/libcpu/arm/realview-a8-vmm|//packages/sqlite/shell.c|//rt-thread/components/drivers/spi/spi-bit-ops.c|//rt-thread/tools|//rt-thread/components/drivers/i2c/soft_i2c.c|//rt-thread/components/net|//rt-thread/components/utilities|drivers/drv_ltdc.c|//packages/LVGL-v8.3.11/env_support/rt-thread/squareline|//rt-thread/components/drivers/spi/enc28j60.c|//rt-thread/components/drivers/phy|//rt-thread/libcpu/arm/cortex-m0|//rt-thread/libcpu/arm/lpc24xx|//rt-thread/libcpu/arm/s3c24x0|//rt-thread/components/vbus|//rt-thread/components/drivers/hwtimer|//rt-thread/libcpu/blackfin|//rt-thread/libcpu/arm/cortex-m7/context_iar.S|//packages/sqlite/rtthread_mutex.c|packages/sqlite/rtthread_mutex.c|//rt-thread/components/drivers/spi/spi_wifi_rw009.c|//rt-thread/components/dfs/dfs_v1/filesystems/ramfs|//rt-thread/components/fal/samples/porting/fal_flash_stm32f2_port.c|//rt-thread/libcpu/arm/armv6|//rt-thread/components/drivers/audio|//rt-thread/libcpu/arm/lpc214x|//rt-thread/components/drivers/clk|//rt-thread/libcpu/arm/cortex-m7/context_rvds.S|packages/sqlite/rtthread_vfs.c|//rt-thread/components/libc/posix|//rt-thread/libcpu/arm/cortex-m7/mpu.c|//packages/sqlite/rtthread_vfs.c|//rt-thread/components/drivers/cputime|//rt-thread/components/drivers/pin/pin_ofw.c|//rt-thread/components/drivers/usb|//rt-thread/libcpu/arm/AT91SAM7X|//rt-thread/components/drivers/serial/serial_dm.c|//rt-thread/components/drivers/virtio|//rt-thread/libcpu/aarch64|//rt-thread/libcpu/arm/cortex-r52|//cubemx/Drivers|//rt-thread/src/scheduler_mp.c|//rt-thread/libcpu/arm/cortex-m3|//rt-thread/components/mm" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="packages/sqlite/rtthread_io_methods.c|packages/sqlite/rtthread_vfs.c|//cubemx/Drivers|//cubemx/EWARM|//cubemx/Src/stm32h7xx_it.c|//cubemx/Src/system_stm32h7xx.c|//packages/LVGL-v8.3.11/env_support/rt-thread/squareline|//packages/LVGL-v8.3.11/examples|//packages/LVGL-v8.3.11/tests|//packages/littlefs-v2.11.2/runners|//packages/sqlite/rtthread_io_methods.c|//packages/sqlite/rtthread_mutex.c|//packages/sqlite/rtthread_vfs.c|//packages/sqlite/shell.c|//rt-thread/components/dfs/dfs_v1/filesystems/cromfs|//rt-thread/components/dfs/dfs_v1/filesystems/mqueue|//rt-thread/components/dfs/dfs_v1/filesystems/nfs|//rt-thread/components/dfs/dfs_v1/filesystems/ramfs|//rt-thread/components/dfs/dfs_v1/filesystems/romfs|//rt-thread/components/dfs/dfs_v1/filesystems/skeleton|//rt-thread/components/dfs/dfs_v2|//rt-thread/components/drivers/audio|//rt-thread/components/drivers/can|//rt-thread/components/drivers/clk|//rt-thread/components/drivers/core/dm.c|//rt-thread/components/drivers/core/driver.c|//rt-thread/components/drivers/core/platform.c|//rt-thread/components/drivers/core/platform_ofw.c|//rt-thread/components/drivers/cputime|//rt-thread/components/drivers/fdt|//rt-thread/components/drivers/hwcrypto|//rt-thread/components/drivers/hwtimer|//rt-thread/components/drivers/i2c/i2c_bus.c|//rt-thread/components/drivers/i2c/i2c_dm.c|//rt-thread/components/drivers/i2c/soft_i2c.c|//rt-thread/components/drivers/ktime|//rt-thread/components/drivers/misc|//rt-thread/components/drivers/mtd/mtd_nand.c|//rt-thread/components/drivers/ofw|//rt-thread/components/drivers/phy|//rt-thread/components/drivers/pic|//rt-thread/components/drivers/pin/pin_dm.c|//rt-thread/components/drivers/pin/pin_ofw.c|//rt-thread/components/drivers/pinctrl|//rt-thread/components/drivers/pm|//rt-thread/components/drivers/rtc/alarm.c|//rt-thread/components/drivers/sensor|//rt-thread/components/drivers/serial/serial_dm.c|//rt-thread/components/drivers/serial/serial_tty.c|//rt-thread/components/drivers/serial/serial_v2.c|//rt-thread/components/drivers/spi/enc28j60.c|//rt-thread/components/drivers/spi/spi-bit-ops.c|//rt-thread/components/drivers/spi/spi_wifi_rw009.c|//rt-thread/components/drivers/usb|//rt-thread/components/drivers/virtio|//rt-thread/components/drivers/wlan|//rt-thread/components/fal/samples/porting/fal_flash_stm32f2_port.c|//rt-thread/components/legacy|//rt-thread/components/libc/compilers/armlibc|//rt-thread/components/libc/compilers/dlib|//rt-thread/components/libc/compilers/musl|//rt-thread/components/libc/compilers/picolibc|//rt-thread/components/libc/cplusplus|//rt-thread/components/libc/posix|//rt-thread/components/lwp|//rt-thread/components/mm|//rt-thread/components/mprotect|//rt-thread/components/net|//rt-thread/components/utilities|//rt-thread/components/vbus|//rt-thread/libcpu/aarch64|//rt-thread/libcpu/arc|//rt-thread/libcpu/arm/AT91SAM7S|//rt-thread/libcpu/arm/AT91SAM7X|//rt-thread/libcpu/arm/am335x|//rt-thread/libcpu/arm/arm926|//rt-thread/libcpu/arm/armv6|//rt-thread/libcpu/arm/common/atomic_arm.c|//rt-thread/libcpu/arm/common/divsi3.S|//rt-thread/libcpu/arm/cortex-a|//rt-thread/libcpu/arm/cortex-m0|//rt-thread/libcpu/arm/cortex-m23|//rt-thread/libcpu/arm/cortex-m3|//rt-thread/libcpu/arm/cortex-m33|//rt-thread/libcpu/arm/cortex-m4|//rt-thread/libcpu/arm/cortex-m7/context_iar.S|//rt-thread/libcpu/arm/cortex-m7/context_rvds.S|//rt-thread/libcpu/arm/cortex-m7/mpu.c|//rt-thread/libcpu/arm/cortex-m85|//rt-thread/libcpu/arm/cortex-r4|//rt-thread/libcpu/arm/cortex-r52|//rt-thread/libcpu/arm/dm36x|//rt-thread/libcpu/arm/lpc214x|//rt-thread/libcpu/arm/lpc24xx|//rt-thread/libcpu/arm/realview-a8-vmm|//rt-thread/libcpu/arm/s3c24x0|//rt-thread/libcpu/arm/s3c44b0|//rt-thread/libcpu/arm/sep4020|//rt-thread/libcpu/arm/zynqmp-r5|//rt-thread/libcpu/avr32|//rt-thread/libcpu/blackfin|//rt-thread/libcpu/c-sky|//rt-thread/libcpu/ia32|//rt-thread/libcpu/m16c|//rt-thread/libcpu/mips|//rt-thread/libcpu/nios|//rt-thread/libcpu/ppc|//rt-thread/libcpu/risc-v|//rt-thread/libcpu/rx|//rt-thread/libcpu/sim|//rt-thread/libcpu/sparc-v8|//rt-thread/libcpu/ti-dsp|//rt-thread/libcpu/unicore32|//rt-thread/libcpu/v850|//rt-thread/libcpu/xilinx|//rt-thread/src/cpu.c|//rt-thread/src/mem.c|//rt-thread/src/scheduler_mp.c|//rt-thread/src/slab.c|//rt-thread/tools" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="" />
</sourceEntries>
</configuration>
</storageModule>
@ -1044,7 +1044,7 @@
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders" />
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/project"/>
<resource resourceType="PROJECT" workspacePath="/828F" />
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets" />

2
.project

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>project</name>
<name>828F</name>
<comment />
<projects>
</projects>

2
applications/INI/config.c

@ -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");

38
applications/data/DATA_comm.c

@ -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
{}

4
applications/data/Variable.c

@ -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;

Loading…
Cancel
Save