asaikk Posted July 2, 2012 Share Posted July 2, 2012 Hi, In the project I am working on, I have a following requirement under the use conditions of 1) & 2). <Use conditions> 1)The PCs where DAQFactory are installed are shut down every day after the daily work is finished. 2)A specific sequence (such as calculating the daily total value etc) is required to run before the shut down of the PC. <Requirement> Is it possible to run a sequence automatically before closing the ctl document, or maybe present on a screen a dialogbox to ask to run the sequence ? If possible what would it be the script? Of course it is possible to make a manual sequence, but automatic sequence is more preferable, as the workers may forget to run the manual sequence. Thanks in advance. Link to comment Share on other sites More sharing options...
AzeoTech Posted July 9, 2012 Share Posted July 9, 2012 There is an OnQuit system event, but its usually better to simply make it so the customer can only quit DAQFactory by using a button you create. To do this: 1) run in full screen mode 2) do System.hideSystemMenu() to make the Windows close buttons disappear 3) create a button for them to quit the program. In it, run your closing script, then finally do System.Quit() to actually quit. Note that neither of these methods are fool proof. A customer could simply power the machine down, or shut DAQFactory down hard through Task Manager. Link to comment Share on other sites More sharing options...
asaikk Posted July 10, 2012 Author Share Posted July 10, 2012 Many thanks for the advice. I am afraid that the PCs we use can not be run in full screen mode, because programs other than DAQFactory are running on the same PCs. Of course it is possible to make other programs active even with DAQ under full screen mode, but I do not expect every worker, especially inexperienced one, to handle this. So would you please give an explanation on the "OnQuit system event" that you mentioned above? By the way I tried the full screen mode, and was not able to return to the normal mode by F4 key when individual channel is open. How should I do on this case? Thanks in advane. Link to comment Share on other sites More sharing options...
AzeoTech Posted July 11, 2012 Share Posted July 11, 2012 You can still use the hideSystemMenu() function to keep the program from quitting except through your button, though technically it can be shut down through task manager still. I was wrong about OnQuit. It's actually OnShutDown() and its talked about in section 5.28 of the user's guide. Note that any code there needs to be relatively fast and not require user interaction. Link to comment Share on other sites More sharing options...
asaikk Posted July 12, 2012 Author Share Posted July 12, 2012 I may have sent the message on a wrong place. So I am writing once again. The sequence incorporating hideSystemMenu() does not work. The script is; System.hideSystemMenu() (See the attached ctl file) What would be the problem? testhideSystemMenu.ctl Link to comment Share on other sites More sharing options...
AzeoTech Posted July 12, 2012 Share Posted July 12, 2012 Worked perfectly for me when I loaded your doc, at least once I took it out of full screen mode. The system menu is simply the icon at the top left corner and the three buttons at the top right corner of the DAQFactory window. The top bar that goes along the window is still there with "DAQFactory - testhideSystemMenu.ctl" Link to comment Share on other sites More sharing options...
asaikk Posted July 13, 2012 Author Share Posted July 13, 2012 Thank you for checking my doc. However I still do not see the situation. Would you please see the uploaded images of my PC screen before and after executing the sequence. It makes no changes at all! (Since the doc is set to open in full screen mode, I had changed the mode to normal mode and tried the sequence.) Link to comment Share on other sites More sharing options...
AzeoTech Posted July 13, 2012 Share Posted July 13, 2012 In both cases the system menu is already hid. Try alternating between system.hidesystemmenu() and system.showSystemMenu(), or simply restart DF to display the system menu, then run your sequence. If you have your sequence marked auto-start, its never going to show the system menu. Link to comment Share on other sites More sharing options...
asaikk Posted July 17, 2012 Author Share Posted July 17, 2012 Many thanks for the advice. I tried the "system.showSystemMenu()" sequence, and have learned what the system menu is like. Actually I was obsessed with the idea that the menu bar disappears too when the system.hidesystemmenu() is run. What led me think so is, as long as there is the menu bar on the screen, it would be very difficult to prevent anyone from closing ctl-doc through file/exit on the menu bar. This concern still remains with the system menu hidden. So the question I have now is, is there any command to hide the menu bar? Link to comment Share on other sites More sharing options...
AzeoTech Posted July 17, 2012 Share Posted July 17, 2012 Sure. Just run your app in runtime mode, either with a separate license (probably best) or put a document editing password on the doc to keep someone from opening the app in development mode. The password is set in File - Document Settings.... Or do both. Link to comment Share on other sites More sharing options...
asaikk Posted July 18, 2012 Author Share Posted July 18, 2012 >Just run your app in runtime mode, either with a separate license >(probably best) or put a document editing password on the doc >to keep someone from opening the app in development mode. So it seems that there is no way to hide the menu bar for DAQFactory Express. Is it right? Link to comment Share on other sites More sharing options...
AzeoTech Posted July 18, 2012 Share Posted July 18, 2012 Express? No. Express is designed for desktop use by the developer, not for generation of applications run by end-users. For that you would need at least Lite and possibly a Runtime license. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.