This Community site is new! Please help us build a community around the JNIOR.
Sign up, and help share your knowledge. Please sign-up even if you do not plan to post as a sign of support.
If there is evidence of a demand we will continue to develop the content here.

Cinema Controller UI

You got ideas? Let's hear 'em. Here we can talk about your experiences programming on the JNIOR or items that you may wish to have INTEG assist you with.
bscloutier
Posts: 401
Joined: Thu Sep 14, 2017 12:55 pm

Cinema Controller UI

Post by bscloutier » Tue Nov 21, 2017 3:01 pm

We were thinking about using the Matrix Orbital HMI (ELK204-7T-GW-PL) to prototype a display and keypad UI for Cinema. I am referring to the device we used in developing a generic interface program in the "Display and Keyboard" thread (viewtopic.php?f=5&t=158).

At a minimum once you get past some splash screen the main menu could be simply a list of available macros. If you select a macro maybe you see some information about it (like status if it is running) and you have an option of starting it. Or, maybe it just starts and shows you its status? We have some brainstorming to do. This would integrate internally to the current CINEMA application.

This HMI is 1U in height and can be mounted on a tripod or to a 1U blank. It could be several feet from the JNIOR.

What do you think? Should we pursue this? Any comments or ideas? We can pull it together here if anyone is interested in participating.

kmcloutier
Posts: 31
Joined: Tue Sep 12, 2017 7:26 am

Re: Cinema Controller UI

Post by kmcloutier » Wed Nov 29, 2017 8:23 am

When thinking about an approach to the Cinema UI we will need to think about what features we want to have available and then we will think about the best implementation to incorporate the HMI.

In short we want to be able to execute a macro. To do this we will need to have a list of macros to choose from. Then we can think about what we might like to be able to see or do while a macro is running. It might be nice to be able to see the status of a macro. Most macros execute quickly but there are a few instances where a macro has many actions executing over several seconds to minutes. Seeing the status is nice for a macro that takes a while to execute is cool but what if that macro were to execute an action that we no longer want to occur. Maybe we should implement a way to abort the macro. Of course both of these actions should not easily be executed by mistake so we should prompt the user for confirmation for these actions. Of course some sort of splash screen is nice showing the Cinema version and maybe information like the last macro executed and the time that is was executed.

What are you thoughts.
I am a Senior Software Programmer at INTEG. You have questions and I have answers.

kmcloutier
Posts: 31
Joined: Tue Sep 12, 2017 7:26 am

Re: Cinema Controller UI

Post by kmcloutier » Wed Nov 29, 2017 8:32 am

Next we can think about the implementation. We have a few choices.
  • Use the message pump. This limits the UI application to execution on the same device.
  • New TCP server. This will allow the UI application to run on a different JNIOR. It will also allow for other applications to implement the protocol to be able to monitor and control macros. Security becomes an issue with this approach. Lets give that some thought.
Either method we choose I believe that the protocol format should be JSON oriented. JSON is a simple format that is both human readable and easy to implement complex structures.
I am a Senior Software Programmer at INTEG. You have questions and I have answers.

bscloutier
Posts: 401
Joined: Thu Sep 14, 2017 12:55 pm

Re: Cinema Controller UI

Post by bscloutier » Wed Nov 29, 2017 8:40 am

I like the concept of keeping the Cinema HMI interface separate from the current Cinema application. That way it can be run on the same JNIOR or on a different remote JNIOR provided that we use a TCP/IP connection for command and information transfer. That would even allow there to be multiple HMI monitoring and controlling a single auditorium. Or, it would create the ability to monitor and control multiple auditoriums from a single HMI. The concern that I have (as I always do) is security.

Usually we use a login for authentication but there is no (easy) way to enter that using this HMI. The passwords would have to be configured into the JNIOR running the HMI. How about if the Cinema application were to limit connections over this new communications port to specified IP addresses?

So you would enable remote HMI access by specifying the IP address (or addresses) for HMI allowed to connect? Connections from those IP addresses would not have to authenticate. You could still force a login for unknown IP addresses. That would let others use this protocol maybe from where they can easily enter usernames and passwords.

bscloutier
Posts: 401
Joined: Thu Sep 14, 2017 12:55 pm

Re: Cinema Controller UI

Post by bscloutier » Wed Nov 29, 2017 8:45 am

If we do support authentication you can use the NONCE approach to encrypt credentials as we have with other protocols. Note that the NONCE should be single use and valid for only a short time. Beyond that maybe support a STARTTLS capability to upgrade to a secure SSL/TLSv1.2 connection. These things shouldn't be too hard to implement at the application level. We can augment JANOS if we need.

kmcloutier
Posts: 31
Joined: Tue Sep 12, 2017 7:26 am

Re: Cinema Controller UI

Post by kmcloutier » Wed Nov 29, 2017 11:29 am

For now, authentication aside, I implemented a protocol over TCP on port 9610. We will get to authentication before the changes get released. The simple commands along with their responses are as follows. The commands are prefixed by a 2 byte short indicating the length of the JSON message.

To get information for the splash screen along with the response
{
  "Message":"GetInfo"
}

{
  "Message":"GetInfoResponse",
  "Information":"Cinema v2.4.0.471"  // String containing the information to display
}

Getting a list of configured macros. The list will be returned in the order that it was defined in the Macro Editor in the Support Tool
{
  "Message":"GetMacroList"
}

{
  "Message":"GetMacroListResponse",
  "MacroList":[
    "Preshow Start","Preshow End","Flat Start Trailers","Scope Start Trailers",
    "Feature Start","Feature Credits","Feature End"
  ] // A string array of macro names
}
To execute a macro. The response will indicate whether the macro was started or not. An example of a failure is below.
{
  "Message":"RunMacro",
  "MacroName":"Flat Start Trailers"
}

{
  "Message":"RunMacroResponse",
  "Result":true,
  "Reason":"executing"
}

{
  "Message":"RunMacroResponse",
  "Result":false,
  "Reason":"no_such_macro flat start"
}
While a macro is executing update commands can be sent from Cinema alerting when actions are executed.
{
  "Message":"MacroUpdate",
  "Macro":"Flat Start Trailers",
  "Update":"device_CINEMA_MANAGER send status = Trailers"
}
To abort a currently executing macro. A response will be sent alerting you that the abort was received. A macro update will then be issued when the macro actually aborts. The abort flag is ONLY checked when an action is going to execute. For example if an action doesnt occur until one minute after the macro starts and the abort is sent after 45 seconds, the macro update will be sent 15 seconds after it was received.
{
  "Message":"MacroAbort",
  "MacroName":"Flat Start Trailers"
}

{
  "Message":"MacroAbortResponse",
  "Result":"Aborting"
}

{
  "Message":"MacroUpdate",
  "Macro":"Flat Start Trailers",
  "Update":"User Aborted"
}
I am a Senior Software Programmer at INTEG. You have questions and I have answers.

bscloutier
Posts: 401
Joined: Thu Sep 14, 2017 12:55 pm

Re: Cinema Controller UI

Post by bscloutier » Thu Nov 30, 2017 9:28 am

Can we add some JNIOR identification to the "GetInfo" response? If we are going to support access to multiple auditoriums I'll need to itemize the connected JNIORs somehow.

bscloutier
Posts: 401
Joined: Thu Sep 14, 2017 12:55 pm

Re: Cinema Controller UI

Post by bscloutier » Thu Nov 30, 2017 12:17 pm

Isn't "Reason" and "Update" the same thing? Could they just both be "Status"?

kmcloutier
Posts: 31
Joined: Tue Sep 12, 2017 7:26 am

Re: Cinema Controller UI

Post by kmcloutier » Thu Nov 30, 2017 12:33 pm

I guess my reasoning for reason in the RunMacroResponse was more geared towards an explanation if the Macro couldn't execute. The MacroUpdate was meant for after the Macro started executing. executing. Or am I not understanding the question. It can change.
I am a Senior Software Programmer at INTEG. You have questions and I have answers.

bscloutier
Posts: 401
Joined: Thu Sep 14, 2017 12:55 pm

Re: Cinema Controller UI

Post by bscloutier » Thu Nov 30, 2017 12:43 pm

Just thinking that I would process both the "RunMacroResponse" and "MacroUpdate" messages the same way. I will just update the "Status" with the most recent reason or update. It adds complexity to wait for the RunMacroResponse.

So when you run a macro (however that gets done) I was thinking on just going to the status page and showing dynamically whatever I have there.

There is an issue in getting messages out of sync given that there can be some spontaneously supplied. Maybe you still need the macro name in the RunMacroResponse? I was heading toward processing the RunMacroResponse in the asynchronous loop and I wouldn't know what it was in response to.

Maybe combine the two into a singe "MacroStatus" message containing the macro name, an error flag (true or false), and the status string (reason or update)?

Post Reply