Jump to content
Ms. chris papandreou

generic integration

Recommended Posts

Hello,

I would like to ask a question.

I want to integrate en external program to friendship called michlet(calculates the resistance of a given geometry). I tried it with a generic integration and it almost worked. But i am facing a problem. When you run michlet in order to calculate the resistance you have to press two buttons(R and T). If you dont press these buttons it does not calculate anything.So when i call michlet from friendship it opens and closes automatically.So no button is pressed and no resistance is written at the output file. Does anyone know how to solve this problem.

I want to thank you in advance.

Chris Papandreou

Share this post


Link to post
Share on other sites

Hi Chris,

 

I am Daehwan.

I know the problem you have.

Pressing the buttons (R and T) means issuing a kind of "KEY_PRESS_EVENT" or "MOUSE_CLICK_EVENT".

In this way the generic integration could not be constructed.

 

The external program must be executed just with the command files or batch files.

 

If the developer provides command files to run Mitchlet then the integration will be done easily.

 

This information could be helpful for you to understand the coupling better.

 

Daehwan.

Share this post


Link to post
Share on other sites

Hi Daehwan

 

Thank you very much for helping me with this problem but to be honest i did not fully understand what i am supposed to do.Do i have to create a batch file with the key sequence that has to be pressed when michlet is opened by friendship? And if i manage to create this how this is called from friendship ? As far as i know generic integration can call only one programme at time.

Thank you again for your time and assistance.

Best regards

Chris Papandreou

Share this post


Link to post
Share on other sites

Dear Chris,

 

We also tried to connect Michlet and the Framework in the past and encountered the exact same problems. With the current version of Michlet it will, unfortunately, simply not be possible to run it from the Framework.

 

A new version of Michlet will be necessary that can run in batch mode, without user interaction. We have been in contact with michlet's developer, Leo Lazauskas, about this, but until now there there is no update. You could contact Leo, too, and add a further request. It would show additional interest in the functionality and might help.

 

Best regards,

Mattia

Share this post


Link to post
Share on other sites

Dear Mattia

i want to thank you for your interest about my issue and to inform you about something i found yesterday searching a solution about all this.

http://www.boatdesign.net/forums/design-software/optimisation-michlet-24948.html

It is a forum about michlet and one person named volodim found an solution for the same problem(look at the end of the page). I did not manage to solve it , because i had problems with the .dll files but i think someone like you with such experience to these things could make it works.

Finally do you have any contact information with Leo in order to add further request as you told me to do so?

 

Best regards

Chris Papandreou

Share this post


Link to post
Share on other sites

Dear Chris,

 

in the old corresponce I found further information. Leo has written a small program to calculate the Michell integral for a monohull. This program runs in pure batch mode and could be an alternative to start with. See this link:

 

http://www.boatdesign.net/forums/design-software/ulimich-version-1-0-a-44546.html#post578409

 

Leo contact data can be found here at his company's website:

 

http://www.cyberiad.net/

 

Best regards,

Mattia

Share this post


Link to post
Share on other sites

Dear Mattia

 

Unfortunatelly i am trying to optimise a swath so ulimich cannot help( i wiil download it anyway because it must be very useful).

I found Leo's contact info and asked him.He answered that in a few weeks he will release Flotilla 5.0 which runs in batch mode.

Thank you very much one more time.

 

Best regards

Chris Papandreou

Share this post


Link to post
Share on other sites

Dear Daehwan

 

I tried Volodim's programme but unfortunately i could not open it even though i downloaded the .net Framework hia mentioned.

When i open it(having already installed .net Framework), it says that a .dll file was missing.I then downloaded and installed the particular .dll file and it told me that another .dll file was missing. So i resigned. Plus Volodim's programme runs for an older version of michlet.

Sorry for the bad news anyway..

 

Best regards

Chris Papandreou

Share this post


Link to post
Share on other sites

Hello Chris,

 

I did some tests and - depending on how Michlet handles the key presses - there might be a way to achieve this, afterall, if the two keys are always pressed in the same order (i.e. first 'r' then 't'):

 

I am assuming you use Windows (at least that's what I get from the info stored in your license).

Create a new text file called "callMichlet.bat". Open edit with a text editor (e.g. Notepad). Now enter this line:

(echo r && echo t) | <Path to Michlet executable>

(where you replace the <Path to Michlet executable> with the actual full path to the michlet executable). Save the file.

Inside the Framework set the callMichlet.bat file as the executable.

 

I don't have michlet to start a test myself, but for a simple test program I just wrote (which does nothing but read two characters from the keyboard) it worked.

 

Best regards

Arne

  • Upvote 1

Share this post


Link to post
Share on other sites

Just tested and this does not help, sorry.

 

Another option would be to take a look at autoit (http://www.autoitscr...om/site/autoit/).

 

[EDIT]

So, I did a quick test with autoIt and it seems to work quite well. So here's what I did:

  • install autoit
  • I created a file called michletControl.au3 (that's the script file used by autoIt). The path of the file does not matter but is needed later on.
  • It has the following content (I am using michlet 9.20, in the second line you may have to adjust the string to match the title string of the michlet window and you have to adjust the path to the michlet executable on the first line)

Run("D:\downloads\mlt920\michlet\mlt920w.exe")
WinWaitActive("Michlet version 9.20")
Send("R")
Send("t")
Sleep(100)
Send('{ESC}')
Sleep(100)
Send('{ESC}')
Sleep(100)
Send('{ESC}')
Sleep(100)
Send("y")
Sleep(100)
Exit

  • Now, inside the Framework I set the autoit3.exe file as the executable for my LocalApplication (if you chose the default installation path, it should be C:/Program Files (x86)/AutoIt3/AutoIt3.exe)
  • As arguments for the generic integration I set the path to the michletControl.au3 file (e.g. "D:\downloads\mlt920\michletControl.au3")
  • Run the computation

I don't have a michlet integration set up so I had to manually copy one of the example .mlt files into my computation's working directory, but if you have an integration that should happen automatically.

 

Hope this helps

Edited by Mr. Arne Bergmann
results of test with AutoIt

Share this post


Link to post
Share on other sites

Hi Daehwan

 

I did not mention in the beginning.My name is Chris Papandreou and i am a student in the school of naval architecture and marine engineering at NTUA in Greece.My diploma thesis is in ship design and optimisation with Mr A. Papanikolaou. Yes you are right. Flotilla is the alternative.

Chris

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...