# ticket

type: defect
priority: trivial
owner: petar
reporter: petar
cc: petar, adrpo
version: unspecified
status: closed
resolution: fixed
summary: Strange error message
description:
  {{{
  I got this strange error message
  Internal error: FOLToCPS.lookupVar: id
  Error: Bug

  for this code: (DAE.mo:3479)
   case ((COMP(ident = id,dAElist = DAE(elementLst = lst)) :: xs))
        equation 
          res1 = getFlowVariables(lst);
          res1_1 = getFlowVariables2(res1, id);
          res2 = getFlowVariables(xs);
          res = listAppend(res1_1, res2);
        then
        res;

  The problem is that no line number is given, so it was really hard to find where
  the problem was.
  }}}


type: defect
priority: major
owner: dietmarw
reporter: dietmarw
cc: dietmarw, adrpo
status: closed
resolution: fixed
summary: configure on Debian based system fails because 'ml-lex' is actually called 'mllex' there
description:
  Here is what I get on a Ubuntu 7.10 system:

  {{{
  ...OM1RML_trunk$ ./configure 
  ./configure: TARGET is x86-linux-gcc
  ./configure: unable to locate ml-lex in $PATH.
  .../OM1RML_trunk$ locate mllex
  /usr/bin/mllex
  /usr/share/doc-base/mllex
  /usr/share/doc/mlton/mllex.pdf
  /usr/share/man/man1/mllex.1.gz
  /var/lib/doc-base/info/mllex.status
  /var/lib/doc-base/omf/mllex
  /var/lib/doc-base/omf/mllex/mllex-C.omf
  }}}

  Maybe ./configure can take both versions into account?


type: defect
priority: major
owner: dietmarw
reporter: dietmarw
cc: dietmarw,
status: closed
resolution: fixed
summary: Building of mlton fails
description:
  After a long time I tried to build mlton again (this has always worked so far). I followed the instructions of  {{INSTALL.MLton.txt}}
  but 

  {{compiler> mlton -verbose 3 -target self rml.mlb}}

  fails. I attached the output in {{compile-mlton.log}}

  Has any thing mlton related changed towards r144?


type: defect
component: Code Generator
priority: major
owner: barnet
reporter: barnet
cc: barnet, adrpo
status: assigned
summary: Function returning multiple results does not simulate (MultiRes.onb)
description:
  {{Dear Developers, \\


  Simulating a model containing a function returning multiple results
  seems to be broken. \\


  Regards, \\


  Beat Arnet \\


  1) MultiRes.onb fails when executing "}}{{simulate(fCall)" \\


  2) Executing the example in a script also fails: \\
  }} \\
  function f \\
  Â  input Real x; \\
  Â  input Real y; \\
  Â  output Real r1; \\
  Â  output Real r2; \\
  Â  output Real r3; \\
  algorithm \\
  Â  r1 := x; \\
  Â  r2 := y; \\
  Â  r3 := x*y; \\
  end f;Â Â   \\


  model fCall \\
  Â  Real x[3]; \\
  Â  Real a, b, c; \\
  equation \\
  Â  (a, b, c) = f(1.0, 2.0); \\
  Â  (x[1], x[2], x[3]) = f(3.0, 4.0); \\
  end fCall; \\


  getVersion(); \\
  loadFile("functions.mo"); \\
  instantiateModel(fCall); \\
  f(2.5, 3); \\
  simulate(fCall); \\


  incidence_row_exp TUPLE not impl. yet.incidence_row_exp TUPLE not impl.
  yet.incidence_row_exp TUPLE not impl. yet.incidence_row_exp TUPLE not
  impl. yet."1.4.4"0 \\
  true \\
  "fclass fCall \\
  Real x[1]; \\
  Real x[2]; \\
  Real x[3]; \\
  Real a; \\
  Real b; \\
  Real c; \\
  equation \\
  Â  (a,b,c) = (1.0,2.0,2.0); \\
  Â  (x[1],x[2],x[3]) = (3.0,4.0,12.0); \\
  end fCall; \\
  " \\
  (2.5,3.0,7.5) \\
  record \\
  Â Â Â  resultFile = "Simulation failed. \\
  Too few equations, underdetermined system. The model has 6 variables
  and 2 equations \\
  " \\
  end record


type: defect
priority: major
owner: barnet
reporter: barnet
cc: barnet,
status: closed
resolution: fixed
summary: Problem with record constructor functions
description:
  Dear Developers, 

  For some reason, the code below does not simulate.

  Regards,

  Bear Arnet 

   

  record Person \\  String name; \\  Integer age; \\end Person; \\

  model CreatePerson \\  Integer hisage; \\  Person john = Person("John", 35); \\  equation \\    hisage = john.age; \\end CreatePerson; \\ \\

  getVersion(); \\system("if not exist bin mkdir bin"); \\loadFile("RecordConstructor.mo"); \\cd("bin"); \\instantiateModel(CreatePerson); \\simulate(CreatePerson); \\

  -lower2 failed \\-lower2 failed \\-lower2 failed \\-lower2 failed \\-lower2 failed \\-lower2 failed \\"1.4.4"0 \\true \\"D:/eclipsews/Java_32/ModelicaTesting/bin" \\"fclass CreatePerson \\Integer hisage; \\String john.name; \\Integer john.age; \\equation \\  __TMP__0 = Person("John",35); \\  john.name = __TMP__0.name; \\  john.age = __TMP__0.age; \\  hisage = john.age; \\end CreatePerson; \\" \\record \\    resultFile = "Simulation failed. \\" \\end record \\


type: defect
priority: major
owner: adrpo
reporter: adrpo
cc: adrpo, adrpo
status: assigned
summary: Named patterns in tuples should return error
description:
  {{{
  tuple<String, Real> x;
  matchcontinue(x)
  local 
    String s, ss, Real r;
  case (ss as s, NAME=r) <-- should fail!
  }}}


type: defect
priority: critical
owner: sjoelund.se
reporter: sjoelund.se
cc: sjoelund.se, adrpo
status: new
summary: Parallel make using rml sometimes fail
description:
  The issue is that one process starts writing to Filename.srz, another finds it and thinks it is safe to start reading it.
  The easy way to solve this would be to create Filename.srz.$$.tmp ($$ = the ID of the process). When it is finished, rename the file.


type: defect
priority: major
owner: sjoelund.se
reporter: sjoelund.se
cc: sjoelund.se, adrpo
status: closed
resolution: fixed
summary: RML Parser cannot handle external function annotations
description:
  For example, the following would be nice to have:

  {{{public function printBuf
    input String inString;

    external "C" annotation(Library = "omcruntime");
  end printBuf;}}}

  Also, the following does not work (only ident = call)
  {{{public function printBuf
    input String inString;

    external "C" Print__printBuf(inString);
  end printBuf;}}}


type: defect
priority: major
owner: sjoelund.se
reporter: sjoelund.se
cc: sjoelund.se, adrpo
status: closed
resolution: fixed
summary: Add support for Modelica FQ path notation
description:
  The following is valid Modelica (3.2):
  {{{type Env = .Env.Env}}}

  The following is used in RML (but is not valid Modelica):
  {{{type Env = Env.Env}}}


type: defect
priority: major
owner: perost
reporter: perost
cc: perost, adrpo
status: closed
resolution: invalid
summary: Package types fails if protected imports are used before
description:
  A package type will cause an "unbound type constructor" error if it is declared after a protected import. If the import is public or is placed after the type it works. For example:
  {{{
  package Test
    protected import SomePackage; // The content of SomePackage is not important, it can be empty and still cause the error.

    replaceable type T subtypeof Any;
    
    public function F
      input T t;  // This line will produce a "unbound type constructor T" error.
      output list<T> l;
    algorithm
      l := {t};
    end F;
  end Test;
  }}}


# ticket_change

author: petar
field: comment
oldvalue: 1
newvalue:
  The lexer sometimes outputs too many lines (skipping tokens, etc.). This is not
  useful. It should instead only output the first skipped token for each time the
  parser finds a new token to retry on.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Fixed in rml-mmc-2.3.4 (to be released)
  Now the lexer actually throws a ParseError, it does 
  not just collect all the errors and delays the output 
  until parsing is done.


author: petar
field: comment
oldvalue: 1
newvalue:
  Local variables in match expressions are not used at all. They can be commented
  out, or replaced by other (errorenous) types. The code still compiles.

  I belive this is a major bug since people will write declarations that are wrong
  and when the compiler starts checking these declarations a lot of errors will occur!


author: petar
field: comment
oldvalue: 1
newvalue:
  a function with both a match expression in a statement followed by other
  algorithm statements, e.g. a print will not give a warning. The preceding
  statements are simpli ignored!


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Not that easy as it requires analysis of all the modules and all the external
  c files. But possible.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  The problem list is for the bugs that comes from omc.exe when parsing modelica.
  I wonder if the bugs that are due to the OMDev-builder can be put there... 


author: petar
field: comment
oldvalue: 3
newvalue:
  After using the environent for a while I would like to increase the severity of
  this bug/enhancement. It happens quite often that the error messages are
  overlooked since the last commands of the makefile always succeeds. Thus, it
  uses an old version of the omc.exe since the last compile had errors. This is
  hopefully solved when the problem list is updated.


author: adrpo
field: comment
oldvalue: 4
newvalue:
  The problem with continuing make was due to a bug that made MetaModelica 
  exiting with success even if it was an error. This is fixed in the latest 
  rml-mmc:
  http://www.ida.liu.se/~adrpo/omc/omdev/mingw/_hot_fixes/
  So make should actually fail, when rml-mmc fails.

  However, I will implement functionality to add the 
  problems found to the problem list.


author: petar
field: comment
oldvalue: 1
newvalue:
  Today, different arithmetic operators are used depending on type.
  For instance 1 + 1 but 1.0 +. 1.0

  These should be the same.
  Also, operator for string concatenation should be legal. E.g. "foo"+"bar" = "foobar"


author: petar
field: comment
oldvalue: 1
newvalue:
  consider the following RML code( I assume similar problems exist in MetaModelica)

  	generate_equation_order(blocks) => res 
  	-------------------------------------
  	generate_equation_order(DAELow.COND_EQN_BLOCK(_)::blocks) => res

  The error in this code is that the pattern should read
  DAELow.COND_EQN_BLOCK(_,_) . The error message produced by this is:
  type (int list,Exp.Exp) => DAELow.Block differs from type int list => 'a
  reason: different number of relation arguments

  It is a bit confusing that it says that relation arguments are different, since
  there is no relation at that line, only a pattern. It should therefore say that
  the type of the pattern is wrong, or similar.


author: petar
field: comment
oldvalue: 1
newvalue:
  The following code:

  Util.string_append_list(["a",1.0,"b"]) => str

  gives error messages like:
  BlaBla.rml:1.~1-1.~1 Error: while processing while elaborating expression 
  type real differs from type string
  reason: different type names
  Error: StaticElaborationError

  This makes it very hard to find the error if many changes are made between
  compilations. I gave it major in severity since you can spend -a lot- of time
  trying to find these types of errors. Especially if you do not know what to look
  for.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Fixed in release rml-mmc-2.3.4.

  Util.string_append_list(["x","y",1.0]) => x
  Error reported now:
  -------------------
  rmltomod.rml:90.27-90.39 Error: while processing while elaborating expression 

  Error reported before:
  ----------------------
  rmltomod.rml:1.1-1.1 Error: while processing while elaborating expression


author: mtiller
field: comment
oldvalue: 1
newvalue:
  I installed OpenModelica 1.3.1 and the MDT plug-in.  The editor works if I open
  a file (does the syntax highlighting) but if I type I get a message saying that
  I have not set my "OPENMODELICAPATH".  But I have set it (and restarted Eclipse)
  and I confirmed it was set with a command window.


author: x05andre
field: comment
oldvalue: 3
newvalue:
  (In reply to comment #0)
  > I installed OpenModelica 1.3.1 and the MDT plug-in.  The editor works if I open
  > a file (does the syntax highlighting) but if I type I get a message saying that
  > I have not set my "OPENMODELICAPATH".  But I have set it (and restarted Eclipse)
  > and I confirmed it was set with a command window.

  The problem was with the error message. It's actually OPENMODELICAHOME that
  should be set, not OPENMODELICAPATH.

  -Remar


author: adrpo
field: comment
oldvalue: 1
newvalue:
  From Interactive.mo
      case (ISTMTS(interactiveStmtLst = {IEXP(exp = Absyn.CALL(function_ = 
  Absyn.CREF_IDENT(name = "getComponentModifierValue"),functionArgs = 
  Absyn.FUNCTIONARGS(args = {Absyn.CREF(componentReg = class_),Absyn.CREF
  (componentReg = Absyn.CREF_IDENT(name = ident))},argNames = {})))}),(st as 
  SYMBOLTABLE(ast = p,explodedAst = s,instClsLst = ic,lstVarVal = 
  iv,compiledFunctions = cf)))
        equation 
          resstr = getParameterValue(class_, Absyn.CREF_IDENT(ident,{}), p);
        then ...

  If I edit to be case (ISTMTS(interactiveStmtMISTAKE = {...})
  i get an error that class_ is not bound:
  Interactive.mo:1018.36-1018.41 Error: unbound variable class_
  Error: StaticElaborationError
  The error should say that there is no component called
  interactiveStmtMISTAKE in ISTMTS


author: petar
field: comment
oldvalue: 1
newvalue:
  It would be nice with balancing of parentheses in the Modelica Editor, i.e. when
  a ')' is typed the corresponding '(' blinks once or twice..


author: petar
field: comment
oldvalue: 1
newvalue:
  It would be nice to have "find in files" in MetaModelica Editor. It is available
  in CDT C/C++ editor so it should just be to copy the functionality.


author: petar
field: comment
oldvalue: 1
newvalue:
  It would be very nice to have "Goto Definition" as a right-click menu choice i
  the MetaModelica editor.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Fixed since MDT 0.6.8. Use Ctrl+Mouse click to activate.
  Quite slow right now. I'm working at making it faster.


author: petar
field: comment
oldvalue: 1
newvalue:
  It would be nice is the MetaModelica editor colorcoded the function calls with
  the functionname in some nice color. This because the equation parts of match
  expressions are sometimes large and the function calls are most important.


author: petar
field: comment
oldvalue: 1
newvalue:
  The following code does not work:
  case (env,els,true) 
      equation      
      then ({},env,ClassInf.EXTERNAL_OBJ(Env.getClassName(env)));

  This generates:
  Error: unbound variable temp_t_101
  Error: StaticElaborationError

  This can be worked around by introducing tempory variable and make the
  assignment before the then clause.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Can you give me the exact location and which file to cause this bug?
  For me is working, and I cannot debug properly.

  Have you used the latest rml.exe?
  http://www.ida.liu.se/~adrpo/omc/omdev/mingw/_hot_fixes/

  Adrian/


author: adrpo
field: comment
oldvalue: 4
newvalue:
  I think in some cases it doesn't work.
  I'll re-check the code again if this bug re-appears.

  Adrian/


author: petar
field: comment
oldvalue: 1
newvalue:
  C comments on the form:
  /* bla bla <newline>
   bla bla */
  is not highlighted correctly, because of the newline.

  This makes it quite hard to read the comments of case's in matchcontinue
  expressions.


author: adrpo
field: comment
oldvalue: 1
newvalue:
  Code like:
     case (DIV(type_ = _)) then 36; 
  is displayed like:
     [case:binopPriority(DIV(type_ = _)) then ()]
  in the debugger, which is WRONG!

  Adrian/


author: adrpo
field: comment
oldvalue: 1
newvalue:
  Legend:
  |  = cursor
  [] = matching

  Example of error:
   ( ( [)] )|
  Example of how it should be:
   [(] ( ) )|

  Adrian/


author: petar
field: comment
oldvalue: 1
newvalue:
  The following code give errror:

    s=Util.stringAppendList({"instClassIn ",n," ",realString(time)," s\n"});

  Workaround
  s = realString(time);
  s =  s=Util.stringAppendList({"instClassIn ",n," ",s," s\n"});


author: petar
field: comment
oldvalue: 1
newvalue:
  CacheTree envTree[:];  // Gives parse error

  CacheTree[:] envTree;  // is ok.

  Modelica has both and so should MetaModelica.

  Since an obvious workaround exist, this is a low priority bug.


author: dietmarw
field: comment
oldvalue: 1
newvalue:
  Hi Adrian,

  I thought I will add the "bug" here so you can keep better track of it :)

  ./configure should automatically insert the right libs for mico (retrieved by
  "mico-config --libs") in the appropriate  Makefiles. Thus sparing me of manually
  replacing the code after a new ./configure call.


author: adrpo
field: comment
oldvalue: 1
newvalue:
  The MetaModelica compiler doesn't check the varibles
  on the left hand side of matchcontinue!
  Example that works even if it shouldn't!
  function F
    input Real  x;
    output Real y;
  algorithm
    undeclared_variable := matchcontinue(x)
      local Real k;
      case (k) then k;
    end matchontinue;
  end F;


author: petar
field: comment
oldvalue: 1
newvalue:
  Goto last Edit location (Ctrl-Q with emacs bindings) does no longer work. It
  worked in earlier versions of MDT, but now (0.6.9) it jumps to the wrong location.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  I belive this is because I disabled the class folding, but I will look
  into it and see what's the problem.


author: adrpo
field: comment
oldvalue: 3
newvalue:
  I cannot reproduce this bug. 
  For me it works. I edit something, 
  I go to the start of the file, I hit the
  "Go to last edit location" icon on the 
  toolbar and it goes where it should.

  Can you give me a more detailed description on this?
  Is it just the key combination for emacs mode that 
  doesn't work or also the toobar button?

  Thanks,
  Adrian/


author: petar
field: comment
oldvalue: 4
newvalue:
  Strangely engough I cannot reproduce the bug either. Perhaps my MDT was in some
  kind of inconsistent state? 


author: dietmarw
field: comment
oldvalue: 1
newvalue:
  I just stumbled across a missing feature of MDT which would be really
  nice to have. When creating a default project in eclipse the user can
  choose between a workspace location or a alternative location on the
  file system for this project. Unfortunately the latter alternative can
  not be chosen when a new Modelica project is created. I normally find
  this very useful.


author: elsheikh
field: comment
oldvalue: 1
newvalue:
  For OMShell, 
  The $OPENMODELICAHOME should be set to /path/to/open/modelica/build, otherwise I
  get such message:

  To get help on using Mosh and OpenModelica, type "help()" and press enter
  Started server using:/software/modelica/OPENMODELICA_1_4_2/build/bin//bin/omc
  +d=interactive > /tmp/error.log 2>&1 &
   res = 0
  Error connecting to omc server in interactive mode.
  : Connection refused

  I am trying to install MDT (version 0.6.7 for eclipse). The Manual suggests that
  I should set the path to the folder where excutables are, i.e. 
  /path/to/open/modelica/build/bin/
  which is different than the suggested path for OMShell. I think that this clash
  is due to the different file structure of openmodelica under linux, and under
  windows.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  $OPENMODELICAHOME should always be set to the parent of the "bin" directory.
  If the manual say otherwise, then is wrong.

  Actually, MDT searches for the omc executable in several places:
  $OPENMODELICAHOME/
  $OPENMODELICAHOME/bin/
  In order to use MDT you need to have OMC compiled with Corba, not with
  the socket interface!

  I see you use OpenModelica 1.4.2 and MDT 0.6.7.

  I suggest you move for OpenModelica to the latest sources from 
  Subversion because is now much faster and a lot of bugs were
  fixed. Also, you can move to MDT 0.6.9 as it has new features.

  Also, check out our Linux packages here:
  http://www.ida.liu.se/labs/pelab/modelica/OpenModelica.html#Download

  Regards,
  Adrian Pop/


author: petar
field: comment
oldvalue: 1
newvalue:
  I got this strange error message
  Internal error: FOLToCPS.lookupVar: id
  Error: Bug

  for this code: (DAE.mo:3479)
   case ((COMP(ident = id,dAElist = DAE(elementLst = lst)) :: xs))
        equation 
          res1 = getFlowVariables(lst);
          res1_1 = getFlowVariables2(res1, id);
          res2 = getFlowVariables(xs);
          res = listAppend(res1_1, res2);
        then
        res;

  The problem is that no line number is given, so it was really hard to find where
  the problem was.


author: petar
field: comment
oldvalue: 3
newvalue:
  The error is that I copied the code from a similar case, but forgot to remove
  the line  res1_1 = getFlowVariables2(res1, id);
  id is not declared anywhere, so thats what the error message should say, and on
  which line the error occured. 

  I set the priority very low on this bug, so you do not need to fix it right away.

  /Peter


author: petar
field: comment
oldvalue: 1
newvalue:
  When I try to open the rotationalgears.mos file in eclipse (I use C++
  perspective) I get the following error:
  java.lang.ClassCastException: org.modelica.mdt.internal.core.ModelicaFile
  	at
  org.modelica.mdt.ui.text.ModelicaFoldingStructureProvider.computeFoldingStructure(ModelicaFoldingStructureProvider.java:805)
  	at
  org.modelica.mdt.ui.text.ModelicaFoldingStructureProvider.update(ModelicaFoldingStructureProvider.java:745)
  	at
  org.modelica.mdt.ui.text.ModelicaFoldingStructureProvider.initialize(ModelicaFoldingStructureProvider.java:697)
  	at
  org.modelica.mdt.ui.text.ModelicaFoldingStructureProvider.handleProjectionEnabled(ModelicaFoldingStructureProvider.java:668)
  	at
  org.modelica.mdt.ui.text.ModelicaFoldingStructureProvider$ProjectionListener.projectionEnabled(ModelicaFoldingStructureProvider.java:554)
  	at
  org.eclipse.jface.text.source.projection.ProjectionViewer.fireProjectionEnabled(ProjectionViewer.java:481)
  	at
  org.eclipse.jface.text.source.projection.ProjectionViewer.enableProjection(ProjectionViewer.java:529)
  	at
  org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1429)
  	at
  org.modelica.mdt.ui.editor.ModelicaSourceViewer.doOperation(ModelicaSourceViewer.java:143)
  	at
  org.modelica.mdt.ui.editor.ModelicaEditor.createPartControl(ModelicaEditor.java:306)
  	at
  org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)
  	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372)
  	at
  org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
  	at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:214)
  	at
  org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2595)
  	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2528)
  	at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2520)
  	at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2505)
  	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
  	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2500)
  	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2485)
  	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:388)
  	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:350)
  	at
  org.eclipse.ui.internal.ide.EditorAreaDropAdapter.openNonExternalEditor(EditorAreaDropAdapter.java:136)
  	at
  org.eclipse.ui.internal.ide.EditorAreaDropAdapter.asyncDrop(EditorAreaDropAdapter.java:109)
  	at
  org.eclipse.ui.internal.ide.EditorAreaDropAdapter.access$0(EditorAreaDropAdapter.java:75)
  	at
  org.eclipse.ui.internal.ide.EditorAreaDropAdapter$1.run(EditorAreaDropAdapter.java:69)
  	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
  	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
  	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
  	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
  	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
  	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
  	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
  	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
  	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
  	at
  org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
  	at
  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
  	at
  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  	at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  	at java.lang.reflect.Method.invoke(Method.java:585)
  	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
  	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
  	at org.eclipse.core.launcher.Main.run(Main.java:977)
  	at org.eclipse.core.launcher.Main.main(Main.java:952)


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Yep. I know.
  An easy fix is to do this in Eclipse:
  Window->Preferences->General->Editors->File Associations
  Locate *.mos and remove the Modelica Editor.
  You could also add the Text Editor to *.mos if you want.

  I fixed this in the code for the next plugin release.


author: dietmarw
field: comment
oldvalue: 1
newvalue:
  When working on a Modelica package using the MDT with the Modelica perspective I
  noticed that the "Outline view" will only work properly if the Modelica package
  is in the root folder of the Modelica project. 

  Example:
  It *won't* work with this stucture:
  ModelicaProject/
  |-- docs
  |   `-- ModelicaLicense.tex
  `-- ModelicaPackage
      |-- a.mo    
      |-- b.mo    
      |-- c.mo
      `-- package.mo

  But will work with this structure:

  ModelicaProject/
      |-- a.mo    
      |-- b.mo    
      |-- c.mo
      `-- package.mo


author: dietmarw
field: comment
oldvalue: 1
newvalue:
  Hi Adrian,

  having a look at your improvements in r135 (how on earth can you do revision and source code links in codebeamer? ). 

  I did change the following:

  * use 'aptitude' instead of 'apt-get', as aptitude has an improved algorithm for tracking dependencies
  * converted tabs to spaces

  See attached INSTALL.patch


author: adrpo
field: comment
oldvalue: 2
newvalue:
  I tested on my Ubuntu 7.10 and installed:
  sml, ml-lex, ml-yacc with
  apt-get install

  Then I changed the "configure" script to fix it
  and everything went fine.

  On my system ml-lex and ml-yacc have "-" in them.

  What version of sml have you installed??

  Cheers,
  Adrian Pop/


author: adrpo
field: comment
oldvalue: 4
newvalue:
  I will try to fix the configure script to also 
  try mllex and mlyacc instead of ml-lex and ml-yacc.
  \\
  I'll get back to you when I put it in the subversion
  so you can test, as on my system things are different.
  \\

  Cheers,\\
  Adrian Pop/


author: dietmarw
field: comment
oldvalue: 5
newvalue:
  Could you also change:
  {{{
  - run these commands to install SML & others:
  + run this command to install SML & others:
  }}}
  in `INSTALL`

  And now I will shut up :)


author: adrpo
field: comment
oldvalue: 1
newvalue:
  Hi,

  I think you haven't read the INSTALL.MLton.txt carefuly. \\
  It say: "Just follow all the steps in INSTALL and then".

  If you have done what it say, it would work. \\
  Your error is: "File mod.grm.sig does not exist." \\
  which means you haven't run ml-yacc on mod.grm. \\Which in turn means you haven't follow the steps in INSTALL.

  Cheers, \\
  Adrian Pop/


author: dietmarw
field: comment
oldvalue: 2
newvalue:
  Adrian,

  Negative, I did exactly as stated in INSTALL.mlton.txt. Metamodelica is compiled successfully and also runs fine. I did have another look at the INSTALL.mlton.txt and couldn't find any reference to running "ml-yacc on mod.grm". 

  What did I miss? I mean I did compile mlton lot's of times before and haven't done anything different ... :(


author: adrpo
field: comment
oldvalue: 3
newvalue:
  Hi,

  Strange. After you build rml you should have mod.grm.sig there \\as the Makefile inside the "compiler" directory is calling ml-yacc \\on mod.grm. Did you do make clean or make distclean before \\you tried building rml using mlton?

  Cheers, \\Adrian Pop/


author: dietmarw
field: comment
oldvalue: 5
newvalue:
  This is resolved with the fix in r146. The problem was not mlton but MetaModelica not being compiled correctly because of a erroneous Makefile.

  From the [documentation of GNU make|http://www.gnu.org/software/make/manual/html_node/Error-Messages.html#Error-Messages]: 

  `commands commence before first target. Stop.'
      

  This means the first thing in the makefile seems to be part of a command script: it begins with a TAB character and doesn't appear to be a legal make command (such as a variable assignment). Command scripts must always be associated with a target.


author: adrpo
field: comment
oldvalue: 6
newvalue:
  Hi Dietmar,

  I think you commited the wrong Makefile. \\
  I had a look at your changes an there aren't any :) \\
  You commited trunk/compiler/Make.mk with absolutely no changes. \\
  I think you wanted to commit trunk/Makefile maybe.

  Cheers, \\
  Adrian Pop


author: adrpo
field: comment
oldvalue: 1
newvalue:
  Hi, \\

  As far as I know (I'll need to check in the code) we haven't implemented yet \\functions returning multiple results:
  {{{(x, y, z) = functionCall(...);}}}

  However it should work with arrays:
  {{{{x, y, z} = functionCall(...);
  }}}

  You could try this code and see if it works:
  {{{function f
    input Real x, y;
    output Real r[3];
  algorithm
    r := {x, y, x*y};
  end f;

  model fCall
    Real x[3];
    Real a, b, c;
  equation
    {a, b, c} = f(1.0, 2.0);
    {x[1], x[2], x[3]} = f(3.0, 4.0);
  end fCall; }}}

  I actually tested the function+model above:
  {{{adrpo@KAFKA ~/dev/OpenModelica/build/bin/BeatArnet/Tuples
  $ cat test.mo
  /* functions returning arrays could be used */
  function f
    input Real x, y;
    output Real r[3];
  algorithm
    r := {x, y, x*y};
  end f;


  model fCall
    Real x[3];
    Real a, b, c;
  equation
    {a, b, c} = f(1.0, 2.0);
    {x[1], x[2], x[3]} = f(3.0, 4.0);
  end fCall;
  }}}

  {{{adrpo@KAFKA ~/dev/OpenModelica/build/bin/BeatArnet/Tuples
  $ cat test.mos
  loadFile("test.mo");
  simulate(fCall);
  val(x[1], 0);
  val(x[2], 0);
  val(x[3], 0);
  val(a, 0);
  val(b, 0);
  val(c, 0);}}}

  {{{adrpo@KAFKA ~/dev/OpenModelica/build/bin/BeatArnet/Tuples
  $ /c/OpenModelica1.4.4/bin/omc test.mos
  true
  record
    resultFile = "fCall_res.plt"
  end record
  3.0
  4.0
  12.0
  1.0
  2.0
  2.0
  }}}
  {{{
  // here you can see that during instantiation
  // OpenModelica makes a dll out of the function
  // and loads it into omc.exe and then calls it
  // if the input parameters are constant
  adrpo@KAFKA ~/dev/OpenModelica/build/bin/BeatArnet/Tuples
  $ /c/OpenModelica1.4.4/bin/omc test.mo
  fclass fCall
  Real x[1];
  Real x[2];
  Real x[3];
  Real a;
  Real b;
  Real c;
  equation
    a = 1.0;
    b = 2.0;
    c = 2.0;
    x[1] = 3.0;
    x[2] = 4.0;
    x[3] = 12.0;
  end fCall;}}}

  Cheers, \\Adrian Pop/


author: barnet
field: comment
oldvalue: 2
newvalue:
  Hello Adrian,

  I tried this code below with the latest nightly build (10/21), but I still get the same "fel i lowerWhenEqn-lower2 failed, -lower2 failed" errors.

  Note that when I comment out "{c,d} = f(a, b);" and uncomment the subsequent two lines, the code simulates.

  Regards,

  Beat

  {{{
   

  function f
    input Integer x;
    input Integer y;
    output Integer a[2];
  algorithm
    a[1] := x;
    a[2] := y;
  end f;  

  function fx
    input Integer x;
    input Integer y;
    output Integer a;
  algorithm
    a := x;
  end fx;

  function fy
    input Integer x;
    input Integer y;
    output Integer a;
  algorithm
    a := y;
  end fy;

  model fCall
    parameter Real Ts=0.1;
    Integer a,b,c,d;
  equation
    a = 1;
    b = 2;
    when sample(0,Ts) then
      {c,d} = f(a, b);
      //c = fx(a, b);
      //d = fy(a, b);
    end when;
  end fCall; 
  }}}


author: adrpo
field: comment
oldvalue: 1
newvalue:
  Hi,

  I know about this problem and I'm working on a fix. \\It will take a while to fix this as is a bit involved.

  Also, you posted the bugs in the MetaModelica project, which is wrong. \\Please post the bugs about OpenModelica in the OpenModelica project: \\[http://openmodelica.ida.liu.se:8080/cb/proj/tracker/browseTracker.do?tracker_id=1|browseTracker.do?tracker_id=1]

  Cheers, \\Adrian Pop/


author: adrpo
field: comment
oldvalue: 2
newvalue:
  This is fixed since a long time now:
  {{{
  adrpo@kafka ~/dev/OpenModelica/build/bin/BearArnet
  $ ../omc RecordConstructor.mos
  "1.5.0"0
  true
  "c:/bin/cygwin/home/adrpo/dev/OpenModelica/build/bin/BearArnet/bin"
  "function Person "Automatically generated record constructor for Person"
  input String name;
  input Integer age;
  output Person res;
  end Person;

  class CreatePerson
    Integer hisage;
    String john.name = "John";
    Integer john.age = 35;
  equation
    hisage = john.age;
  end CreatePerson;
  "
  record SimulationResult
      resultFile = "CreatePerson_res.plt",
      messages = "",
      timeFrontend = 0.00185778726988421,
      timeBackend = 0.000828035726796714,
      timeSimCode = 0.000679058587665925,
      timeTemplates = 0.00815794194434029,
      timeCompile = 2.38211827783967,
      timeSimulation = 0.0716784064758476,
      timeTotal = 2.46547849378338
  end SimulationResult;
  }}}


# report

title: Active Tickets
description:
  * List all active tickets by priority.
  * Color each row based on priority.

query:
  SELECT p.value AS __color__,
     id AS ticket, summary, component, version, milestone, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed'
    ORDER BY CAST(p.value AS integer), milestone, t.type, time


title: Active Tickets by Version
query:
  SELECT p.value AS __color__,
     version AS __group__,
     id AS ticket, summary, component, version, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed'
    ORDER BY (version IS NULL),version, CAST(p.value AS integer), t.type, time

description:
  This report shows how to color results by priority,
  while grouping results by version.

  Last modification time, description and reporter are included as hidden fields
  for useful RSS export.


title: Active Tickets by Milestone
query:
  SELECT p.value AS __color__,
     'Milestone '||milestone AS __group__,
     id AS ticket, summary, component, version, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed' 
    ORDER BY (milestone IS NULL),milestone, CAST(p.value AS integer), t.type, time

description:
  This report shows how to color results by priority,
  while grouping results by milestone.

  Last modification time, description and reporter are included as hidden fields
  for useful RSS export.


title: Accepted, Active Tickets by Owner
description: List accepted tickets, group by ticket owner, sorted by priority.
query:
  SELECT p.value AS __color__,
     owner AS __group__,
     id AS ticket, summary, component, milestone, t.type AS type, time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status = 'accepted'
    ORDER BY owner, CAST(p.value AS integer), t.type, time


title: Accepted, Active Tickets by Owner (Full Description)
query:
  SELECT p.value AS __color__,
     owner AS __group__,
     id AS ticket, summary, component, milestone, t.type AS type, time AS created,
     description AS _description_,
     changetime AS _changetime, reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status = 'accepted'
    ORDER BY owner, CAST(p.value AS integer), t.type, time

description:
  List tickets accepted, group by ticket owner.
  This report demonstrates the use of full-row display.


title: All Tickets By Milestone (Including closed)
description: A more complex example to show how to make advanced reports.
query:
  SELECT p.value AS __color__,
     t.milestone AS __group__,
     (CASE status 
        WHEN 'closed' THEN 'color: #777; background: #ddd; border-color: #ccc;'
        ELSE 
          (CASE owner WHEN $USER THEN 'font-weight: bold' END)
      END) AS __style__,
     id AS ticket, summary, component, status, 
     resolution,version, t.type AS type, priority, owner,
     changetime AS modified,
     time AS _time,reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    ORDER BY (milestone IS NULL), milestone DESC, (status = 'closed'), 
          (CASE status WHEN 'closed' THEN changetime ELSE (-1) * CAST(p.value AS integer) END) DESC


title: My Tickets
query:
  SELECT p.value AS __color__,
     (CASE status WHEN 'accepted' THEN 'Accepted' ELSE 'Owned' END) AS __group__,
     id AS ticket, summary, component, version, milestone,
     t.type AS type, priority, time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE t.status <> 'closed' AND owner = $USER
    ORDER BY (status = 'accepted') DESC, CAST(p.value AS integer), milestone, t.type, time

description:
  This report demonstrates the use of the automatically set 
  USER dynamic variable, replaced with the username of the
  logged in user when executed.


title: Active Tickets, Mine first
query:
  SELECT p.value AS __color__,
     (CASE owner 
       WHEN $USER THEN 'My Tickets' 
       ELSE 'Active Tickets' 
      END) AS __group__,
     id AS ticket, summary, component, version, milestone, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed' 
    ORDER BY (COALESCE(owner, '') = $USER) DESC, CAST(p.value AS integer), milestone, t.type, time

description:
   * List all active tickets by priority.
   * Show all tickets owned by the logged in user in a group first.


