Author Topic: Help with motion camera event commands  (Read 3288 times)

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Help with motion camera event commands
« on: October 05, 2012, 12:58:05 pm »
Hi Everyone

I've set up a fairly neat event set of commands to pop up my gate camera onto the screen of the TV Room MD whenever motion is detected on the camera. 

I use the "Goto Screen" command on the onscreen orbiter to pop up the camera (used the settings from the GateCAM scenario that is automatically set up when the camera is installed under motion wrapper). I used the interruption integer setting "3" which I think means don't interrupt any media or web browsing.

The camera stays up for 30s, after which I dispose of it with the "Go Back" command which I presume is meant to return to the previous screen. Thereafter a little banner message pops up and stays for 10s just to let the user know that motion was detected.

This was working rather well except for one annoying thing - if you're watching a movie or doing something that won't be interrupted by the camera pop-up as per the interruption setting, the "go back" portion of the command set still executes which can cause some undesirable behaviour. For example if the last thing I had done was to adjust volume, the "Go back" command would take the orbiter back to the "adjusting volume screen" which meant that suddenly the volume would shoot up to maximum if the remote (Wiimote) happened to be pointing to the right when the "Go Back" command was called.

So I noticed that the "Go Back" command has a nice feature "PK_DesignObj_CurrentScreen" which, according to the tooltip, will cause the orbiter to ignore the command unless the screen is the same as the one specified here. That seemed ideal- I set it to screen 15 (which seems to be the right thing because that is the screen you call to pop up the camera) and assumed that it would only fire this command if the current screen is 15 (the camera screen). Unfortunately, instead, the "Go Back" never seems to fire. I don't know if I've got the setting wrong or if it just hasn't been implemented in the device but the camera pops up on motion detection and never goes away unless I dismiss it purposefully.

Can anyone assist? Anyone know if the above feature was implemented and, if so, if I'm putting in the right setting?

Attached is a screenshot of my event commands.

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Help with motion camera event commands
« Reply #1 on: October 10, 2012, 01:53:15 pm »
Darn... really thought I had it after trying two more things:

Thing 1:

I was wondering if the field PK_DesignObj_CurrentScreen perhaps referred to some number other than the screen# (which I have confirmed as 15, but which doesn't fire the command). So I did some searching on the wiki and discovered that there is a table Screen_DesignObj in pluto_main which has the field PK_Screen_DesignObj! Well, that sounded a bit right so I checked the associated records with screen #15 as follows:
Code: [Select]
mysql> select * from Screen_DesignObj where FK_Screen=15;
+---------------------+-----------+--------------+-------+---------+-------------------+---------+---------+---------+--------+-----------+----------+------------+---------------------+--------------+
| PK_Screen_DesignObj | FK_Screen | FK_DesignObj | FK_UI | FK_Skin | FK_DeviceTemplate | AsPopup | Popup_X | Popup_Y | psc_id | psc_batch | psc_user | psc_frozen | psc_mod             | psc_restrict |
+---------------------+-----------+--------------+-------+---------+-------------------+---------+---------+---------+--------+-----------+----------+------------+---------------------+--------------+
|                  19 |        15 |         1405 |  NULL |    NULL |              NULL |       0 |    NULL |    NULL |     19 |       318 |    33129 |          0 | 0000-00-00 00:00:00 |         NULL |
|                 180 |        15 |         4541 |  NULL |       6 |              NULL |       0 |    NULL |    NULL |    180 |       324 |    33129 |          0 | 0000-00-00 00:00:00 |         NULL |
+---------------------+-----------+--------------+-------+---------+-------------------+---------+---------+---------+--------+-----------+----------+------------+---------------------+--------------+
And saw that there were two records that had the foreign key as 15. Specifically, PK_Screen_DesignObj 19 and 180. So I tried setting the "PK_DesignObj_CurrentScreen" parameter in the "Go Back" command to each of these individually, quick reload router, run outside to dance in front of camera, come back and count to 30 and .... darn... screen stays there. Just to confirm that the quick reload was changing the event setting I even then deleted the value completely from this parameter and redid the test and, yes, the screen disappears neatly as expected. Grrrr.

Thing 2:

Then I noticed that the initial "Goto Screen" command I used to bring up the camera has an "id" field at the beginning. When looking up the command in the Wizard->DCE->Commands section, the description against that command says that it is used to assign an ID to the screen you're bringing up, s.t. it can then be passed to the "Kill Screen" command. Yay, so all I have to do is set this to some arbitrary number, then call the "Kill Screen" command with the same number rather than the "Go Back" command. Only..... I can't find any "Kill Screen" command. Does that no longer exist? I tried, in any case, assigning an ID and then using that in the good old "PK_DesignObj_CurrentScreen" parameter above but no dice.

hmm...

Thing 3:

OK, haven't really tried this yet but this is where I am- I was thinking that I could tweak my logic a bit and, instead of using the "interruption" parameter to prevent the "Goto Screen" command firing during media and web-browsing I could rather try to put this logic into the event criteria themselves. That actually makes a bit more sense... then the whole sequence doesn't start if media or web-browsing is going on. However, I couldn't quite figure out how to check for either of these two things in the criteria section. Any advice?