Page 1 of 1

App Developer Runtime close with a command

Posted: Thu Mar 02, 2023 4:20 pm
by stefan.erni
Hi Ben

Is there a way to close the FC10 Runtime.exe with a command in the App?

Or is there a way to prevent the app from closing before data is saved or a stop command is sent to a machine?

In the simulation it's working with a while loop and a end switch

regards

Stefan

Re: App Developer Runtime close with a command

Posted: Thu Mar 02, 2023 5:51 pm
by Steve-Matrix
Hi Stefan,

There is no easy way to programmatically close a Flowcode App Developer app. I will add to my list to investigate.

But there is a way to prevent the app from closing (although the user can override this by pressing 'ignore' when the warning appears).

I have attached a simple app and project to show this behaviour. The Event you need is "Components.ProjectClosedown", and returning a non-zero value from this event will show the warning message.

Re: App Developer Runtime close with a command

Posted: Fri Mar 03, 2023 9:49 am
by stefan.erni
Hi Steve

Very good !

I will use this into my programs for now.
I would like to test later when you have new commands to close the app.

Just a little remark
Unfortunately, this small square stops immediately but the user should not use this.

regards

Stefan

Re: App Developer Runtime close with a command

Posted: Fri Mar 03, 2023 10:06 am
by BenR
Hi Stefan,

There is a Simulation Stop event that you could use to catch users clicking the stop button, In the event macro you could either restart the sim or close the app.

Re: App Developer Runtime close with a command

Posted: Fri Mar 03, 2023 4:21 pm
by stefan.erni
Hi Ben

Yes, I understood a little but not completely.
The input Message window opens but the program is already closed.

Does that have something to do with the error message? I choose yes then the input Message windows open

But there is no count/down or count/up

regards

Stefan
Snag_174b043.png
Snag_174b043.png (11.63 KiB) Viewed 1174 times
Snag_17521aa.png
Snag_17521aa.png (8.78 KiB) Viewed 1174 times

Re: App Developer Runtime close with a command

Posted: Fri Mar 03, 2023 4:44 pm
by BenR
Hello,

You can't really have blocking code inside the event macro but I have edited the stop macro so that now it just starts the sim running again. Hopefully helps to avoid the user clicking that pesky stop button.
FC10_post_stop1.fcsx
(11.22 KiB) Downloaded 49 times
You might need to check that variable values aren't reset and if they are then you might need to store them in the stop event and restore them after.

Re: App Developer Runtime close with a command

Posted: Fri Mar 03, 2023 6:11 pm
by Steve-Matrix
If you don't want the "stop" button in a deployed app, select ""no controls" or "start/pause" under "execution controls" when deploying it.