1st June 2016

  1. Worked on problem that if we change the default value in .scad then it does not change value in model and parametric Wind
  2. Study how present ParameterWidget interact with mainwindow and how we can solve below problem.
  3. Designed alternative way for solving the problem.
  4. Evaluated both the designed and choose one and wrote the pseudo code to implement it.
  5. Coded to solve above problem( prototype ).
  6. changed the way parameterwidget interact with mainwindow.


Design 1:

It is the exiting way how the parameterWindow interact with mainwindow i.e.

  1. First, applyParameter() is called that inject all the parameter in AST from parameterObject container.
  2. Then setParameter() is called which first clear the container of parameterObject and then it make new  parameterObjects and insert in the container.
  3. After This, GUI is given to all the parameterObject and displayed on the screen.
  4. If  value of parameter is changed then the signal is emitted which eventually execute the compileTopLevelDocument()
  5. goto step1.

We can improve this to solve the above issue by differentiating who (parameteric widget or .scad ) updated the the value in AST . We need to define a new slot to connect to refresh signal by parameterWidget and thne pass a bool to tell whether parameters value was updated by through .scad file or parameterWidget. and then accordingly inject the parameter in AST.

This approach was not so logical and was just a hack.

Design 2:

  1. First, setParameter() is called by mainwindow which extract the parameters from AST and then add them to a container and mark them as set.
  2. GUI applied to given parameterObjects and displayed on screen.
  3.  When value of parameter is updated then applyParameter() is called through compileTopLevelDocument().
  4. applyParameter() update the value in AST and mark them as injected.
  5. Again setParameter() is called and it update the parameter whose default value is changed and add new parameters in container and mark them as set.
  6. GUI is given to parameterObject those marked as set and those which are not are deleted.
  7. and again got to step 1.

This is better and more logical approach which also solved the issue of being that we are unable to  apply changes to parameter  value from .scad file.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s