Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » jzimmer
  • » Profile

Posts

Posts

Thanks for the fast response, I will look out for those builds!

Hello there!

I asked this question on stackoverflow, with a complete working example and more explanation:
https://stackoverflow.com/questions/62168453

But the gist is: I would like to be able to replace the "sensitivity" in the example below via a command line expression. Using setComponentModifierValue() allows me to edit component.value, but not anything within a redeclare statement.

Code:


  model System "A system with a component"
    Component component(value = 200, redeclare SpecialSensor sensor(sensitivity = 10)) "Modified component";
  end System;

While my question refers to the use of Python, any answer relying on the OpenModelica Compiler CLI should help me, since omc.sendExpression() is just a wrapper around the CLI. I would be grateful for any advice.

Or will this only (maybe) be possible when this issue has been resolved (i.e. when this functionality has been added to OMEdit)?
https://trac.openmodelica.org/OpenModelica/ticket/2079

  • Index
  • » Users
  • » jzimmer
  • » Profile
You are here: