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

ModelicaML code-sync problem

ModelicaML code-sync problem

Hi,

I am following the ModelicaML: Getting Started pdf to build ModelicaML model based on existing .mo file. So I put .mo files under code-sync, somehow it doesn't pick up the model. I also tried the two tank model code, which is auto generated, but still nothing being pick up. The following is the proxy synchronization report.
Number of loaded classes: 0
Number of loaded components: 0
Number of loaded extends relations: 0




********************   LOG ********************

Is there particular steps, I have to do before putting models under code-sync folder? Is there any constraint on the code structure?

Thanks,
Yuchen

Re: ModelicaML code-sync problem

Hi,

there is the restriction that the first level Modelica class must be a package (I updated the getting started document) with no extends and import.
Also, you will may have to use the latest OMC nighly build because there were changes in the OMC API.

Hope it helps.
Wladimir

Re: ModelicaML code-sync problem

Hi Wladimir,


I was using 1.8.1 r10984. I wish that's not the problem.
Can you upload the example in the start up tutorial for code-sync model, so I can refer to as what it should look like?
I tried very simple model like the following,

package testModel
 
class SamplingClock
  parameter Modelica.SIunits.Time first = 0;
  parameter Modelica.SIunits.Time interval = 1;
  Boolean clock;
  Real x(start=1);
equation
  clock = sample(first,interval);
  when clock then
    x=-pre(x);
  end when;
end SamplingClock;

end testModel;


Thank you,
Yuchen

Re: ModelicaML code-sync problem

That's already ancient, take the latest build from here:
http://build.openmodelica.org/omc/build … ly-builds/

Cheers,
Adrian Pop/

Re: ModelicaML code-sync problem

I tried the newest night build. Same problem. I think an example model file would help.

Yuchen

Re: ModelicaML code-sync problem

I used your code, created a ModelicaML project and imported/synchronized the code.
You can find the example here: http://www.ida.liu.se/~pelab/modelica/O … caML/temp/
To import the exmple in Eclipse goto Import->Existing Project into Workspace -> select Archive File.

What Eclipse and ModelicaML are you using?

Wladimir

Re: ModelicaML code-sync problem

Its Eclipse 3.7.1 and ModelicaML 1.8.5.201202201920

Re: ModelicaML code-sync problem

Now I upgrade Eclipse to 3.7.2 and ModleicaML to the newest version with OpenModelica latest night-build. I still cannot synchronize the code. Does anyone else have similar experience?

Yuchen

Re: ModelicaML code-sync problem

Hi,

what is the result, are there any messages? Have you tried the project I created?

Wladimir

Re: ModelicaML code-sync problem

Same result as before it doesn't recognize the model in the folder, which is

Number of loaded classes: 0
Number of loaded components: 0
Number of loaded extends relations: 0




********************   LOG ********************

I tried that project, and whenever I want to refresh it complains about not being able to find the model file.

Re: ModelicaML code-sync problem

Are you using windows? It may lead to problems if the path to your files is too long. Have you tried to put your workspace to a shorter path?

Is OMC installed correctly (e.g. is the omc.exe in the /bin/ folder of your OpenModelica installation)?
What is shown in the tree viewer?

Wladimir

Re: ModelicaML code-sync problem

It is indeed the Windows problem. I changed the workspace location, and it works great thanks so much.

Yuchen

There are 0 guests and 0 other users also viewing this topic
You are here: