Documentation ¶
Overview ¶
displaycloud provides basic functionality to interact with the DisplayCloud "middleware".
The displaycloud package is used by mrclean to interact with the DislpayCloud middleware. It provides the basic functionalities to marshal and unmarshal the JSONRPC messages to be sent via websocket. It connects to DisplayCloud and do handle all the calls to adding, soerting and grouping new visuals. There is a stub for the handling of events coming from other sources, e.g. if someone move a visual from another client we got a event but we ignore it so far.
Index ¶
- type Client
- type Display
- type Event
- type MessIn
- type RpcErr
- type RpcReq
- func AddVisual(v *Visual) RpcReq
- func DisplayGroupInfo() RpcReq
- func DisplaysInfo() RpcReq
- func MoveVisuals(vids, dids, gids []int) RpcReq
- func SetOrigin(vid int, x, y float64) RpcReq
- func SetScale(vid int, x, y float64) RpcReq
- func SetVisualOrigin(vid int, norigin []float64) RpcReq
- func VisualInfo(vid int) RpcReq
- func VisualsInfo() RpcReq
- type RpcRes
- type Visual
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Display ¶
type Display struct { Origin []float64 `json:"origin,omitempty"` Description string `json:"description,omitempty"` Name string `json:"name,omitempty"` DPI []float64 `json:"dpi,omitempty"` ID int `json:"id,omitempty"` SizeDiscrete []int `json:"sizeDiscret,omitempty"` Size []float64 `json:"size,omitempty"` HostName string `json:"hostname,omitempty"` Visible bool `json:"visible,omitempty"` }
{"origin": [0.0, 0.0], "description": "7x4 tiled 1024x768 displays", "hostname": "rocksvv.local", "visible": true, "dpi": [35.28756407422915, 35.28756407422915], "size": [5.1595287115033655, 2.2112265906442996], "id": 29, "sizeDiscrete": [7168, 3072], "name": "IfI display wall"}
type Event ¶
type Event struct { Type string `json:"event_type"` Version string `json:"dc_event"` Data map[string]interface{} `json:"event_data"` }
{"event_type": "object_property_changed", "dc_event": "1.0", "event_data": {"new_value": [0.05526591049184404, 0.018044854873855876], "obj_type": "visual", "property_name": "origin", "obj_id": 38}}
type RpcReq ¶
type RpcReq struct { Version string `json:"jsonrpc"` Method string `json:"method"` ID int `json:"id"` Params interface{} `json:"params"` }
JSON RPC Request
func AddVisual ¶
/json_rpc_call('add_visual', [{ 'name' : 'saturn', 'origin' : [0.0, 0.0], 'size_discrete' : [3536,1399], 'dpi_hint' : [70.0,70.0], 'type' : 'pic', 'pic_url' : 'http://tellus-demo.local/td-pics/saturn2.jpg', 'pic_geometry' : [3536,1399] }]) """Adds a visual to the cloud display.
@param info dictionary with info about the visual. Keys: name: name of visual (optional, default '') description: descriptive text (optional, default '') origin: (x,y) initial center point of the visual in the cloud display size: (w,h) initial width and height, in m (optional) size_discrete: (w,h) initial width and height, in pixels (optional) dpi_hint: (x,y) initial pixel density, in dpi (optional) type: 'null', 'vnc', or 'pic'. Either size, or size_discrete and dpi_hint must be given. Depending on the type, there are more keys. For null, there are none. For vnc: vnc_server: vnc server url (str) enc_passwd: encrypted password (str) vnc_geometry: (w,h) width and height of framebuffer, in pixels For pic: pic_url: http url for picture pic_geometry: (w,h) width and height of pic, in pixels @return nothing. An event is issued when the visual has been added. """
func MoveVisuals ¶
/json_rpc_call('move_selected_visuals', [[42, 39], [], [29]])
"""moves the visuals onto either one display or one displaygroup. @param visual_ids list of visual ids (length > 0) @param display_ids list of display ids (length <= 1) @param displaygroup_ids list of displaygroup ids (length <= 1) """
func SetVisualOrigin ¶
def visual_set_origin(self, vid, new_origin) :
with self._lock : visual = self._visuals[vid].space_tree_node origin_vec = Vec2D(new_origin[0], new_origin[1]) acked(visual.setOrigin, origin_vec)
type RpcRes ¶
type RpcRes struct { Version string `json:"jsonrpc"` ID int `json:"id"` //Result interface{} `json:"result"` Result json.RawMessage `json:"result"` Error *RpcErr `json:"error"` }
JSON RPC Result
type Visual ¶
type Visual struct { Origin []float64 `json:"origin,omitempty"` Description string `json:"description,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` ID int `json:"id,omitempty"` DPI []float64 `json:"dpi,omitempty"` SizeDiscreteBug []int `json:"sizeDiscrete,omitempty"` SizeDiscrete []int `json:"size_discrete,omitempty"` Size []float64 `json:"size,omitempty"` VNCServer string `json:"vnc_server,omitempty"` DPIHint []float64 `json:"dpi_hint,omitempty"` PicGeometry []float64 `json:"pic_geometry,omitempty"` URL string `json:"pic_url,omitempty"` //rect Rectangle `json:"-"` mrclean.MetaData `json:"-"` }