Skip to main content
FluidEarth Portal Header version 3

FluidEarth Portal

Go Search
  
FluidEarth Portal > FluidEarth Discussions > Using Windows Forms  

FluidEarth Discussions

Modify settings and columns
Discussions board for FluidEarth Users
  
View: 
Post
Started: 29/03/2011 10:49
Picture Placeholder: ABarkwith
ABarkwith
Using Windows Forms
I am wrapping an existing model and am having trouble compiling the code. The model has a GUI built using windows forms and the engine is in the format below. Although all brackets are correct i am getting the following errors:
 
} - expected after 1st {
=, +, ; - invalid tokens in class struct, or interface member decleration - called on the advancing of timestep
 

void Compute()

{

    public class Form1 : System.Windows.Forms.Form

    {

         GUI Code and model equations

    }

   _time_current = _time_current + _time_delta;

}

Posted: 29/03/2011 11:32
Picture: Adrian Harper
Adrian Harper
The code in invalid C#, try ...
 

    public class Form1 : System.Windows.Forms.Form

    {

         GUI Code and model equations

    }

 

void Compute()

{

     Form f1 = new Form1();

etc...

   _time_current = _time_current + _time_delta;

}

 

I hope that the UI is being added to compute() function for debug purposes only. As requiring user interaction every timestep does defeat the object of OpenMI.

Posted: 30/03/2011 09:30
Picture Placeholder: ABarkwith
ABarkwith

Thanks Adrian,

That has allowed the code to compile, but i am now not getting any output exchange items when i load the model into Pipistrelle - i'll double check the xml and omi files.

The GUI was part of the original model, however it has been setup so that it now requires no user interaction.