• Restarting a Primitive:
    • Typically the macro writer does not need to be aware of situations that require a restart. The primitive takes care of it inside one its setFoo(..) methods.
    • Since a restart is similar to a normal start with different input parameters, the restart is implemented this way.
      • Prior to a restart a primitive overwrites its original input arguments and then sets the state to RESTART.
      • Since NeXtMidas 2.3.0 the arguments are overridden using the setArg(name, value) method.
        • (Prior to NeXtMidas 2.3.0 it was necessary to directly call the methods in MA to override the arguments.)
      • Example:
          public void setFrameSize(int fs) {
            setArg("FS", Integer.toString(fs));
            setState(RESTART);
          }
        
      • The open() treats the setArg("FOO","newVal") as if the user had put "FOO=newVal" on the command line.