Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • METER_COUNTER_STATUS_IND (Message type: Monitoring) – this message is sent from client to server to update meter counter value when meter counter’s value on client side has changed.  

    • Payload:  

      • value – <float> meter counter value in specified unit – meter or feet 

      • unit – <text> unit of value - "meter" or "feet" 

      • isLateral - <bool> is meter counter lateral (Since Api: V2) 

    • Example message (json):  

      • {\"header\":{\"messageId\":102,\"messageName\":\"METER_COUNTER_STATUS_IND\",\"messageType\":\"MONITORING\"},\"payload\":{\"value\":320, \"unit\":\"meter\"}}  

  • TOTAL_METER_COUNTER_STATUS_IND (Message type: Monitoring) - same purpose as METER_COUNTER_STATUS_IND, but for total meter counter.

    • Payload:

      • value – <float> meter counter value in specified unit – meter or feet 

      • unit – <text> unit of value - "meter" or "feet" 

  • INCLINATION_VALUE_STATUS_IND (Message type: Monitoring) (Required Api: V2) - this message is sent to update value of inclination in ProTouch. 

    • Payload: 

      • value - <float> 

      • unit - <string> possible units: “rad”, “deg”, “percent” 

...

Dynamic UI is orthogonal to ProTouch API, however it is required to define controls for CONTROL part of ProTouch API. It uses two ZMQ sockets: 

  1. Configuration, ROUTER, TCP, port 52943.

It is used to define controls, using the following JSON shape:

Code Block
type Joystick = { 
    id: string, 
    type: "Joystick" 
} 

type Button = { 
    id: string, 
    type: "Button", 
    properties: { 
        text: string 
    } 
} 

type Label = { 
    id: string 
    type: "Label" 
    properties: { 
        text: string 
    } 
} 

type SpinBox = { 
    id: string 
    type: "SpinBox" 
    properties: { 
        value: number 
        stepSize: number //"step" can be also used
        suffix: string //default: %
        from: number
        to: number
    } 
} 

type LevelIndicator = { 
    id: string 
    type: "LevelIndicator" 
    properties: { 
        chargeLevel: number //"value" can be also used
        from: number //default: 0
        to: number //default: 100
        redYellowThreshold:
        yellowGreenThreshold: 
        suffix: string //default: %
    } 
} 

type Switch = { 
    id: string 
    type: "Switch" 
    properties: { 
        status: boolean
        on: string //default: "ON"
        off: string //default: "OFF"
    } 
} 

type MeterCounter = { 
    id: "meterCounter1" 
    type: "MeterCounter"
    properties: {
        title: string //default: "Distance:"
    }
}

type Slider = {
    id: string
    type: "Slider"
    properties: {
        from: number //default: 0
        to: number //default: 100
        value: number //default: 50
        step: number //default: 5
    }
}

type Dropdown = {
    id: string
    type: "Dropdown"
    properties: {
        index: number
        model: array //ex. ["Apple", "Orange"]
    }
}

type PanelConfig = array<Joystick | Button | Label | SpinBox | LevelIndicator | Switch | MeterCounter | Slider | Dropdown> 

type DynamicUiSetupMsg = { 
    leftPanel: PanelConfig 
    rightPanel: PanelConfig 
    bottomPanel: PanelConfig 
} 
  1. Events (from controls) PUB, TCP, port 52944.

Events from that socket are also forwarded in ProTouch API in CONTROL messages.

...

This is a very simple application that allows you to connect with ProTouch and control it with a help of ProTouch API. Windows executable and the entire source code is available on our GitHub. The application contains 4 main parts: 

  1. First one which is: “Connection box”. In there you can connect to server. By default, the connection parameters are: localhost (127.0.0.1) on port 8095 (if they are not changed there is no need to provide them).  After a click on the “Connect to server” button the application will attempt to connect into ProTouch and the status on status information bar will update. 

  2. The second box is for MONITORING messages.

  3. The third box is for CONTROL, SETTING and SETUP messages.

    1. “Control message’s response” is responsible for simulating response messages such as:  

      1. CHANGE_OBJECT_VALUE_RESP,   

      2. MOVE_OBJECT_RESP,  

      3. ACTION_OBJECT_TRIGGER_RESP, 

      4. CHANGE_METER_COUNTER_VALUE_RESP.

        You can create payload for these messages by providing status, errorCode and error. You can also ignore messages by clicking “Ignore messages” for example to test error handling timeout, etc.

    2. “Setting” is responsible for SETTING_INFO_REQ. Response can be found in “Messages received” box

    3. “Setup” is for  PING and FORCE_CHOOSING_UNIT.

  4. The fourth box is "Video Message" for simulating START_VIDEO_STREAMING_REQ with port as parameter.  

  5. There is a box "Create free text" where you can send CREATE_FREE_TEXT message to OSD on server.  

  6. On the bottom there is text area where client can see messages, which are sent from server.

  

To test if video streaming by UDP is correct you can use ProTouch’s GStreamer libraries via UDP Video tab in simulator or call gstreamer command (below), where IP should be the same as in START_VIDEO_STREAMING_RESP and port from START_VIDEO_STREAMING_REQ: 

...