Home AMX User Forum AMX Design Tools

How to control the UI from the AMX master?

Now my situation is.. I have 2 panels controlling 2 rooms (sharing). Both panels can control both room1 and room2.

But I just want to make sure that each room is controlled by 1 room only. So I want panel1 to show up a warning message when room1 is currently controlled by panel2. And allow panel2 to further control room1 (switch the UI to another page) once panel2 is not controlling room1.

Thanks for the help.

Comments

  • viningvining Posts: 4,368
    Just track a variable associated with the button push that brings you to the control page. One for each control page and unpon exit (exit button push) of a control page just reset that control page's tracking variable. If variable is set pop up warning, if not page flip.
  • winstonmawinstonma Posts: 45
    Thanks for the reply. But can you explain it more specific (I am a newbie on AMX)? Thanks
  • REBUILD_EVENTREBUILD_EVENT Posts: 127
    i have done similar things like this:

    dvMyTps is a dev Array containing your touchpanels,
    nMyRoomButtons an array containing your two Channel Codes of the buttons that lead you to the rooms.
    nMyExitButton as a button on the room page that is pushed when the user finishes controlling the room
    DEFINE_VARIABLE
    
    DEV dvTpControllingRoom[2]
    INTEGER nWhichRoom;
    
    DEFINE_EVENT
    
    BUTTON_EVENT[dvMyTps, nMyRoomButtons]
      {
      PUSH:
        {
        nWhichRoom=GET_LAST(nMyChannels)  // sets nWhichRoom to 1 or 2
        IF(dvTpControllingRoom[nWhichRoom]==0)
          {
          dvTpControllingRoom[nWhichRoom]=BUTTON.INPUT.CHANNEL
          // this is done when there is no conflict
    
          }
        ELSE 
          {
          // this is done when there is a conflict
          }
        }
      }
    
    BUTTON_EVENT[dvMyTps, nMyExitButton]
      {
      PUSH:
        {
        dvTpControllingRoom[nWhichRoom]=0;
        }
      }
        
    

    are things a little bit clearer?
  • winstonmawinstonma Posts: 45
    Yes thanks but I still have one more question. How can I control the UIs that I'm loading?

    For example if there is conflict I will load Page A... otherwise I'll load Page B. How can I do that on Netlinx Master?
  • SensivaSensiva Posts: 211
    It Depends

    It depends on how you did make this sharing?
  • winstonmawinstonma Posts: 45
    Would you state that with more details? Thanks
  • REBUILD_EVENTREBUILD_EVENT Posts: 127
    winstonma wrote:
    Would you state that with more details? Thanks

    a send_command to the touchpanel device, I don't know the command, as we use a Library with a function doing this. but it is in a tp programming manual... i can't tell more for the moment
  • yuriyuri Posts: 861
    i used REBUILD_EVENT' example for this:
    DEFINE_VARIABLE
    
    DEV dvTpControllingRoom[2]
    INTEGER nWhichRoom;
    
    DEFINE_EVENT
    
    BUTTON_EVENT[dvMyTps, nMyRoomButtons]
      {
      PUSH:
        {
        nWhichRoom=GET_LAST(nMyChannels)  // sets nWhichRoom to 1 or 2
        IF(dvTpControllingRoom[nWhichRoom]==0)
          {
          dvTpControllingRoom[nWhichRoom]=BUTTON.INPUT.CHANNEL
          // this is done when there is no conflict
          // to flip to DVD page for example
          SEND_COMMAND dvTPa, "'PAGE-DVD''
          }
        ELSE 
          {
          // this is done when there is a conflict
          // to flip to the error page
          SEND_COMMAND dvTPa, "'PAGE-ERROR'"
          }
        }
      }
    
    BUTTON_EVENT[dvMyTps, nMyExitButton]
      {
      PUSH:
        {
        dvTpControllingRoom[nWhichRoom]=0;
        }
      }
    
    
  • winstonmawinstonma Posts: 45
    But how do I name that on the User Interface of the DVD in order to get the page loaded?
  • REBUILD_EVENTREBUILD_EVENT Posts: 127
    winstonma wrote:
    But how do I name that on the User Interface of the DVD in order to get the page loaded?

    if you use the examplew with

    SEND_COMMAND dvTPa, "'PAGE-DVD'" (careful with " and ' !)
    in TP4Design you name one page "DVD" and the other page "ERROR". or wasn't that the question?
Sign In or Register to comment.