Page 1 of 1

Action for Reload Theme?

Posted: Sat Apr 02, 2016 4:53 am
by TonyG
Just checking I'm not missing something. Is there an action for "reload theme" for a local software remote?

Reloading the theme fixes an issue I have with my 3-screen setup on resume from sleep. Girder 6 does a set of actions on resume, and currently has to close and then reopen the software remote in order for everything to be working on 3 screens. If I could send a task command from Girder to reload theme using external HTTP control, it would do away with the requirement to close and reopen the remote - and that is a useful time saving when I start the campervan.

Cheers,

Tony

Re: Action for Reload Theme?

Posted: Sat Apr 02, 2016 6:14 am
by Richard Naninck
Yes there is but through a button.
Add a Menu Button to your theme. If you press it, you will get the same menu as a Right Click on a theme background. I disabled the Right Click option and added a menu button to be able to reload the theme.

As for an automated restart of the theme, you can script that.
PowerSehll simply kills the current SWRemote and starts a new one which than gets the full affinity because any program started through HouseBot inherits only core 0 on a Multi core cpu.
The script lines below get called by a Task that runs @ 6 AM each day.

Code: Select all

Call Execute_Program("Get-Process SWRemote* | Stop-Process", "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe", "Yes")
			Call Execute_Program("", "C:\Program Files (x86)\SWRemote\SWRemote.exe", "No")
			Call Execute_Program("$SWRemote = Get-Process SWRemote*; $SWRemote.ProcessorAffinity=15", "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe", "No")
I use an Execute Program Device in HouseBot which is addressed from script.

Code: Select all

'-------------------------------------------------------
'- Execute Program -------------------------------------
'-------------------------------------------------------
Sub Execute_Program(Arguments, ProgName, Wait)
	
	SetPropertyValue "Execute Program Server PC.Arguments", Arguments
	SetPropertyValue "Execute Program Server PC.Path and Name of Program", ProgName
	SetPropertyValue "Execute Program Server PC.Wait for program to complete", Wait
	SetPropertyValue "Execute Program Server PC.Execute Program", "Yes"
End Sub

Re: Action for Reload Theme?

Posted: Sat Apr 02, 2016 7:52 am
by TonyG
Hi Richard,

Thanks for your post - very much appreciated.

I've completely missed the menu button, and whilst it won't work for my resume from sleep reload, it will feature in my "system panel" as a very useful feature - always times when a reload theme fixes a few things...

The script is interesting to see, and thanks for sharing. I do something similar within Girder 6, which works well, but it is a restart of the software remote which given the number of panels, takes 5-6 seconds, hence the desire to use reload theme.

Thanks again,


Tony

Re: Action for Reload Theme?

Posted: Mon Apr 04, 2016 3:50 am
by TonyG
Having a Menu button is a step forwards, and useful for ad-hoc resets of the theme.

Having an Action for "Reload Theme" which can be incorporated into a task would still be the one...

Re: Action for Reload Theme?

Posted: Mon Apr 04, 2016 4:02 am
by Richard Naninck
Concur
+1

Re: Action for Reload Theme?

Posted: Tue Dec 06, 2016 1:02 pm
by ScottBot
Tony,

As we discussed in email, a reload theme would not help your situation, since the server doesn't have a connection to the remote to actually send the command.

In version 3.41 (just released), I've improved the remotes ability to detect a wakeup event to more quickly reconnect to the server. If this doesn't help, I've also added a Windows Message that you can send (via girder) to the remote to try and wake it up. I didn't document the Windows message, but here's the info.

Message ID = 1024
wParam = 1
lParam = 0 (doesn't matter actually).