Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/CommandParser/cmd.cpp
- Revision:
- 180:b548e289b648
- Parent:
- 177:9ec90c8e3ce1
- Parent:
- 179:a31ea334e2b7
- Child:
- 186:16912aa18c2a
--- a/src/CommandParser/cmd.cpp Tue Oct 04 15:48:12 2016 +0000 +++ b/src/CommandParser/cmd.cpp Tue Oct 04 16:08:49 2016 +0000 @@ -91,6 +91,7 @@ {"stack", "get thread stack usage stats", cmd_stack }, {"stats", "get current mDot statistics", cmd_stats }, {"time", "get current time", cmd_time }, + {"simall", "simulate multiple inputs", cmd_simall }, {NULL, NULL, NULL} }; @@ -1073,13 +1074,65 @@ if ( argc < 3 ) { SimulateInputMap[argv[1]].min = 0; SimulateInputMap[argv[1]].max = 0; + SimulateInputMap[argv[1]].moving_up = false; return; } SimulateInputMap[argv[1]].min = atof(argv[3]); SimulateInputMap[argv[1]].max = atof(argv[4]); SimulateInputMap[argv[1]].up_step = atof(argv[5]); SimulateInputMap[argv[1]].down_step = atof(argv[6]); + SimulateInputMap[argv[1]].moving_up = true; +} + +/***************************************************************************** + * Function: cmd_simall + * Description: simulat multiple inputs + * + * @return none + *****************************************************************************/ +void cmd_simall(int argc, char **argv) +{ + + if ( argc > 1 ) { + printf("\rsetting: simin i_tra01 100\r\n"); + printf("\rsetting: simin i_bdcond01 2000\r\n"); + + ModbusRegisterMap["i_tra01"].simulated = true; + SimulateInputMap["i_tra01"].start_value = 100; + SimulateInputMap["i_tra01"].min = 0; + SimulateInputMap["i_tra01"].max = 0; + SimulateInputMap["i_tra01"].up_step = 0; + SimulateInputMap["i_tra01"].down_step = 0; + SimulateInputMap["i_tra01"].moving_up = true; + + ModbusRegisterMap["i_bdcond01"].simulated = true; + SimulateInputMap["i_bdcond01"].start_value = 2000; + SimulateInputMap["i_bdcond01"].min = 0; + SimulateInputMap["i_bdcond01"].max = 0; + SimulateInputMap["i_bdcond01"].up_step = 0; + SimulateInputMap["i_bdcond01"].down_step = 0; + SimulateInputMap["i_bdcond01"].moving_up = true; + + return; + } + + printf("\rsetting: simin i_tra01 100 94 106 1 .25\r\n"); + printf("\rsetting: simin i_bdcond01 2000 1990 2006 .25 1\r\n"); + + ModbusRegisterMap["i_tra01"].simulated = true; + SimulateInputMap["i_tra01"].start_value = 100; + SimulateInputMap["i_tra01"].min = 94; + SimulateInputMap["i_tra01"].max = 106; + SimulateInputMap["i_tra01"].up_step = 1; + SimulateInputMap["i_tra01"].down_step = .25; + + ModbusRegisterMap["i_bdcond01"].simulated = true; + SimulateInputMap["i_bdcond01"].start_value = 2000; + SimulateInputMap["i_bdcond01"].min = 1990; + SimulateInputMap["i_bdcond01"].max = 2006; + SimulateInputMap["i_bdcond01"].up_step = .25; + SimulateInputMap["i_bdcond01"].down_step = 1; }