Action for Reload Theme?

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
TonyG
Member
Posts: 94
Joined: Wed Jul 22, 2009 7:35 am

Action for Reload Theme?

Post 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
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Action for Reload Theme?

Post 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
TonyG
Member
Posts: 94
Joined: Wed Jul 22, 2009 7:35 am

Re: Action for Reload Theme?

Post 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
TonyG
Member
Posts: 94
Joined: Wed Jul 22, 2009 7:35 am

Re: Action for Reload Theme?

Post 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...
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Action for Reload Theme?

Post by Richard Naninck »

Concur
+1
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: Action for Reload Theme?

Post 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).
Scott
Post Reply