- 20 Jan, 2015 9 commits
-
-
Jeroen Vreeken authored
-
Jeroen Vreeken authored
-
Daan Vreeken authored
'slash' would be used uninitialized in this case. While we're here, change code to use strrchr() instead of rolling our own and only stat() a filename if we've found a '/', since we know 'extern->filename' will not contain a directory name otherwise. modified: controller/controller_load.c
-
Daan Vreeken authored
modified: dt_azimuth/dt_az_safety.c modified: dt_elevation/dt_el_safety.c
-
Daan Vreeken authored
Don't intialize bool or uint32_t with float value. modified: block/block_value_bool.c modified: block/block_value_uint32.c
-
Daan Vreeken authored
My .ctrl file is so much cleaner this way :) modified: block/block_value_bool.c modified: block/block_value_uint32.c
-
Daan Vreeken authored
Before, a value of '1.0' had to be created like this : blocks(..) { { "value", "one" } } params { { "one", "value", 1.0 } } Now you can simply instantiate the same block with : blocks(..) { { "value", "one", 1.0 } } I've finally found a good use for fully specified multiple choice argument lists :) modified: block/block_value.c
-
Daan Vreeken authored
(You'll see why in the next commit..) modified: controller/controller_load.c
-
Daan Vreeken authored
When the .ctrl file contains a line to create an 'ec' block with incorrect arguments, the following errors would be emitted : ERROR: Invalid arguments trying to create block 'ethercat' DEBUG: Load module 'ec' with prefix 'ethercat' ERROR: ec:1: syntax error, unexpected $end DEBUG: End of module 'ec': 1 ERROR: pand.ctrl:50: Error creating block ERROR: Could not load controller file The code would first try to load the dynamically loadable 'ec' block's module. This would fail, because of incorrect arguments. controller_load_block_create() would then try to stat() the file 'ec'. When found, it is opened and loaded as a module block. The code didn't check for the file to be a regular file and my build system contains a directory with the name 'ec'. On FreeBSD, directories can be opened and read as if they were regular files, but the .ctrl file parser would fail to load the directory. Change the code to *not* try to parse directories. (It would be even better if we just stopped trying to load blocks when controller_block_create() tells us that the block does exist, but the user has made an error. At this moment though, controller_block_create() has no way of telling the caller that.) The new code bails out with : ERROR: Invalid arguments trying to create block 'ethercat' ERROR: Could not load or create block 'ec' ERROR: pand.ctrl:50: Error creating block ERROR: Could not load controller file modified: controller/controller/controller_load.c
-
- 19 Jan, 2015 10 commits
-
-
Daan Vreeken authored
The incorrect error was line 3 of the following example: ERROR: Too many arguments supplied! This function doesn't accept arguments. ERROR: Invalid arguments trying to create block 'heater3' ERROR: Could not find create function or struct for block bridge_pwm ERROR: pand.ctrl:36: Error creating block Both the create function and the create struct were found, but the block wasn't created because the arguments didn't match. This version reports: .. ERROR: Could not load or create block 'bridge_pwm' modified: controller/controller/controller_load.c
-
Daan Vreeken authored
modified: controller/controller/controller_block.c
-
Daan Vreeken authored
modified: controller/block/block_bridge_pwm.c
-
Daan Vreeken authored
are. modified: controller/controller/controller_load.c
-
Daan Vreeken authored
o My two cents: If you can give explicit errors that tell the user exactly what is wrong with a minimal amount of code, please do. modified: controller/controller/controller_load.c
-
Jeroen Vreeken authored
is killed out of the blue) Add return value to controller_block_add() and add a check to the blocks for its value.
-
Jeroen Vreeken authored
is killed out of the blue) Add return value to controller_block_add() and add a check to the blocks for its value.
-
Jeroen Vreeken authored
Fixed some merge conflicts between argument checker and module code. Conflicts: controller/controller/controller_block.c controller/controller/controller_load.c
-
Jeroen Vreeken authored
Move parameter argument check to block_parameter file. Remove arugment number check. (Full type check makes it redundant) Rename check function with controller_load prefix. Don't treat 1 argument option different from multiple options.
-
Jeroen Vreeken authored
Module inputs can now be used multiple times in a module Added test for this to test_module.ctrl
-
- 18 Jan, 2015 14 commits
-
-
Daan Vreeken authored
modified: controller/controller_load.c
-
Daan Vreeken authored
when creative block names are used. Bumped into an almost undecipherable error message due to the name I choose for a block :) modified: controller/controller_block.c
-
Daan Vreeken authored
This will produce error messages like: ERROR: Argument mismatch in argument 1. Expected argument of type 'double' instead of 'char*' ERROR: Invalid arguments trying to create trigger 'prestart' ERROR: pand.ctrl:7: Error in trigger ERROR: Could not load controller file modified: controller/controller_load.c modified: controller/controller_sample.c modified: controller/controller_sample.h
-
Daan Vreeken authored
Do this by reversing the logic in some ifs and adding a couple of gotos. (No functional changes.) modified: controller/controller_sample.c
-
Daan Vreeken authored
modified: controller/controller_block.c modified: controller/controller_load.h
-
Daan Vreeken authored
This will produce errors like: ERROR: Argument mismatch in argument 2. Expected argument of type 'int' instead of 'double' ERROR: Invalid arguments trying to create block 'daan_1' ERROR: pand.ctrl:52: Error creating block modified: controller/controller_block.c modified: controller/controller_block.h modified: controller/controller_load.c
-
Daan Vreeken authored
Reverse the logic in some of the if's and introduce a couple of gotos to accomplish this. (No functional changes.) modified: controller/controller_block.c
-
Daan Vreeken authored
type lists. The code will generate errors like: ERROR: Invalid arguments! This function accepts any of the following: ERROR: int,float ERROR: char*,char* ERROR: Argument mismatch while trying to set 'test_arg' param on block 'daan_1' ERROR: pand.ctrl:207: Error setting parameter modified: controller/controller_load.c
-
Daan Vreeken authored
Its output will rise when (positive > negative + window/2) and fall when (positive < negative - window/2). new file: block/block_schmitt_trigger.c modified: block/build.mk
-
Daan Vreeken authored
modified: block/block_comparator.c
-
Daan Vreeken authored
The block will output 'true' when input positive >= input negative. new file: block/block_comparator.c modified: block/build.mk
-
Daan Vreeken authored
modified: controller/controller_load.c
-
Daan Vreeken authored
We now interpret it as 'from this point on, zero or more arguments of any type will do'. modified: controller/controller_load.c
-
Daan Vreeken authored
used to verify the arguments and types of block create functions, etc., but start by validating parameters for now. This helps a lot when writing .ctrl files as the parser will now stop with a sensible error instead of a segfault when arguments are mismatched. Some example output: ERROR: Invalid number of arguments! Expecting 1 argument instead of 3. ERROR: Argument mismatch while trying to set 'divider' param on block 'heater' ERROR: pand-test.ctrl:169: Error setting parameter ERROR: Argument mismatch in argument 1. Expected argument of type 'int' instead of 'char*' ERROR: Argument mismatch while trying to set 'divider' param on block 'heater' ERROR: pand-test.ctrl:169: Error setting parameter modified: controller/controller_load.c
-
- 17 Jan, 2015 7 commits
-
-
Jeroen Vreeken authored
When the blocks in the module use frequency 0.0 the module will inherit the parent blocks frequency (typicall case for makin modules of small networks which should just integrate with the parent network). If a blocks segment in a module has any other frequency it will use that. test_module.ctrl has been extended with module blocks, nested modules and a module with its own frequency domain.
-
Daan Vreeken authored
modified: controller/controller_load.c
-
Daan Vreeken authored
This prevents copy/paste errors in a .ctrl file where a user would create two blocks with the exact same name. Since the functions returns void, we'll bail out using errx() here. modified: controller/controller_block.c
-
Daan Vreeken authored
modified: ec/block_beckhoff_el3xxx.c
-
Daan Vreeken authored
This allows the user to specify e.g. 'rtd_element_input1' => 'PT1000' in the params list of a .ctrl file. modified: ec/block_beckhoff_el3xxx.c
-
Daan Vreeken authored
Remove my *.il2c.c clean-up code now we've merged Jeroen's version. Conflicts: Makefile
-
Daan Vreeken authored
There's now only a single function left to set all 'check' bits of each input, instead of having 8 nearly identical functions, one for each input. modified: controller/ec/block_beckhoff_el3xxx.c
-