1. 20 Jan, 2015 8 commits
    • Jeroen Vreeken's avatar
      Add a few extra test cases. · feb47c82
      Jeroen Vreeken authored
      feb47c82
    • Daan Vreeken's avatar
      Keep controller_load_check_arg() from crashing when filename doesn't contain '/'. · 8cd6afe9
      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
      8cd6afe9
    • Daan Vreeken's avatar
      Add missing checks for controller_block_add()'s return value. · ff394fc1
      Daan Vreeken authored
      	modified:   dt_azimuth/dt_az_safety.c
      	modified:   dt_elevation/dt_el_safety.c
      ff394fc1
    • Daan Vreeken's avatar
      Fix long-standing copy/pasto. · a454f2d6
      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
      a454f2d6
    • Daan Vreeken's avatar
      Also add the optional initial value argument to 'value_bool' and 'value_uint32'. · 6d0a8b7b
      Daan Vreeken authored
      My .ctrl file is so much cleaner this way :)
      
      	modified:   block/block_value_bool.c
      	modified:   block/block_value_uint32.c
      6d0a8b7b
    • Daan Vreeken's avatar
      Add optional initial value to argument list of the 'value' block. · ca041574
      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
      ca041574
    • Daan Vreeken's avatar
      Explicitly show that an empty argument type string ("") means 'no arguments'. · a9a42203
      Daan Vreeken authored
      (You'll see why in the next commit..)
      
      	modified:   controller/controller_load.c
      a9a42203
    • Daan Vreeken's avatar
      Don't try to load directories as blocks. · 73a5252d
      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
      73a5252d
  2. 19 Jan, 2015 9 commits
  3. 18 Jan, 2015 14 commits
  4. 17 Jan, 2015 6 commits
  5. 16 Jan, 2015 3 commits
    • Daan Vreeken's avatar
      Add the name of the param to the arguments of the param set function. · 713eedaa
      Daan Vreeken authored
      This way we can use one function to set a number of params. All blocks
      (including the il2c generator) have been updated with the extra argument.
      
      	modified:   Makefile
      	modified:   controller/am335x/block_am335x_adc.c
      	modified:   controller/am335x/block_am335x_pwm.c
      	modified:   controller/am335x/block_am335x_qed.c
      	modified:   controller/block/block_bridge_pwm.c
      	modified:   controller/block/block_counter.c
      	modified:   controller/block/block_filter_iir.c
      	modified:   controller/block/block_filter_lp.c
      	modified:   controller/block/block_friction.c
      	modified:   controller/block/block_gain.c
      	modified:   controller/block/block_inverse_proportional.c
      	modified:   controller/block/block_limit.c
      	modified:   controller/block/block_limit_2nd.c
      	modified:   controller/block/block_limit_var.c
      	modified:   controller/block/block_matrix_2x2.c
      	modified:   controller/block/block_pid.c
      	modified:   controller/block/block_pid_aw.c
      	modified:   controller/block/block_quantize.c
      	modified:   controller/block/block_rangecheck.c
      	modified:   controller/block/block_servo_state.c
      	modified:   controller/block/block_setpoint_generator_1d.c
      	modified:   controller/block/block_setpoint_generator_3d.c
      	modified:   controller/block/block_sine.c
      	modified:   controller/block/block_state_machine.c
      	modified:   controller/block/block_trajectplayer.c
      	modified:   controller/block/block_trigger.c
      	modified:   controller/block/block_value.c
      	modified:   controller/block/block_value_bool.c
      	modified:   controller/block/block_value_uint32.c
      	modified:   controller/block/il2c/il2c.c
      	modified:   controller/controller/controller_block.h
      	modified:   controller/controller/controller_block_param.c
      	modified:   controller/dt_azimuth/dt_az_safety.c
      	modified:   controller/dt_elevation/dt_el_safety.c
      	modified:   controller/ec/block_beckhoff_el2xxx.c
      	modified:   controller/ec/block_beckhoff_el3xxx.c
      	modified:   controller/ec/block_beckhoff_el4xxx.c
      	modified:   controller/ec/block_ec.c
      	modified:   controller/ec/block_ec_sim.c
      	modified:   controller/test/block_test_command.c
      	modified:   controller/test/block_test_input_bool.c
      	modified:   controller/test/block_test_input_float.c
      	modified:   controller/test/block_test_input_uint32.c
      	modified:   controller/test/block_test_output_bool.c
      	modified:   controller/test/block_test_output_float.c
      	modified:   controller/test/block_test_output_uint32.c
      713eedaa
    • Jeroen Vreeken's avatar
      Add new module keyword. · 8cfc3505
      Jeroen Vreeken authored
      Add module code in controller_module
      Introduce new test for module
      Use module in azimuth and elevation simulators
      Remove dedicated simulator blocks
      8cfc3505
    • Daan Vreeken's avatar
      On blocks with less than 8 inputs, don't expose check_input[x] params of · 1252ae97
      Daan Vreeken authored
      inputs that don't exist. We do this by reversing the order of the params list
      and feeding the ..param_list_add() function the params list, starting at the
      first check_input param that actually exists on the current hardware.
      
      	modified:   controller/ec/block_beckhoff_el3xxx.c
      1252ae97