IRidium Script API

From iRidium Mobile Wiki
Jump to: navigation, search

Contents


iRidium Script (iRidium Script API и iRidium DDK) are powerful tools for your automation. They can complete any automation task. Now you can control any equipment from any control panel.

iRidium Script is based on Java Script. To have access to iRidium objects iRidium API. To create drivers use iRidium DDK.

All these tools are multiplatform. Once created the script or driver operate similarly on any iRidium supported OS (iOS, Android, Mac OS and Windows)


Characteristics of iRidium Script

Characteristics of iRidium Script:


Ways of Creating and Launching Scripts

Ways of Creating and Launching Scripts:


iRidium API

iRidium API is a set of classes, methods, functions and events which enable the access from iRidium JavaScript to the interface items and driver system.


GUI API

GUI API is a set of functions and events for working with graphic items (buttons, sliders, popups, etc.)

Functions
IR.CreateItem Creating an item
IR.DeleteItem Deleting an item
IR.GetItem Changing item properties
IR.PagesCount Counting project pages
IR.PopupsCount Counting project popups
IR.CurrentPage Receiving an identifier of the open page
IR.GetPage Reffering to a page
IR.GetPopup Referring to a popup
IR.ShowPage Opening a page
IR.ShowPopup Opening a popup
IR.HidePage Closing a page
IR.HidePopup Closing a popup
IR.HideAllPopups Closing all popups
ItemsCount Counting items
GetState Referring to a state
Events
EVENT_ITEM_PRESS Event is activated when pressing on the item
EVENT_ITEM_RELEASE Event is activated when releasing the item
EVENT_ITEM_CHANGE Event is activated when changing the EditBox item
EVENT_MOUSE_DOWN Event is activated when the mouse button is pressed down
EVENT_MOUSE_UP Event is activated when the mouse button is released
EVENT_MOUSE_MOVE Event is activated when the mouse button is pressed down and moved
EVENT_TOUCH_DOWN Event is activated when the item on the screen is pressed down by a finger
EVENT_TOUCH_UP Event is activated when the item on the screen is released by a finger
EVENT_TOUCH_MOVE Event is activated when the item on the screen is pressed down by a finger and moved

List API

List API is a set of functions and events for working with lists

Functions
IR.CreateItem Creating a list
List_Name.Template Assigning a template
List_Name.CreateItem Filling a list
List_Name.Clear() Clearing a list
List_Name.DeleteItem Deleting list items
List_Name.SetPosition Setting up list position
Events
IR.EVENT_ITEM_SELECT Pressing on the list item


Gestures API

Functions
IR.AddRecognizer Adding a gesture
IR.RemoveRecognizer Deleting a gesture
Events
IR.EVENT_GESTURE_BEGIN Processing of gestures


Sound API

Functions
IR.PlaySound Playing a sound file
IR.StopSound Stop playing a sound file
IR.StopSlot Stop playing a sound file in the indicated slot
IR.StopAllSounds Stop playing all sounds


Drivers API

Functions
IR.CreateDevice Creating a driver
Connect Connecting to a device
Disconnect Disconnecting from a device
IR.GetDevice Referring to a device
Set Setting up a value in the device channel
Send Sending a command to a device
InvokeAction Sending a command to an UPNP device
Subscribe Subscribing to UPNP events
UnSubscribe Unsubscribing from UPNP events
HtmlDecode Substitution of reserved Html symbols
JSON.Stringify Converting a JSON object to a string
JSON.Parse Converting a string to a JSON object
new XML Creating an XML object
XML.ToString Converting an XML object to a string
Events
EVENT_RECEIVE_DATA Receiving data from a device in the bite format
EVENT_RECEIVE_TEXT Receiving a string from a device
EVENT_RECEIVE_EVENT Receiving an event (UPNP Event)from a device
EVENT_ONLINE Connection with a device is established
EVENT_OFFLINE Connection with a device is lost
EVENT_TAG_CHANGE Changing a tag value
EVENT_DEVICE_FOUND Finding an UPnP device


Tokens API

Systems API

Functions
IR.Log Outputting data into a console
IR.AddListener Activating Listener
IR.RemoveListener Remove Listener
IR.ClearInterval Remove delay function
IR.GetSystemInfo Receiving the volume of the allocated memory
IR.Exit Exiting the application
IR.SetInterval Run a function when the time delay
IR.SetTimeout Cycle with a given recurrence interval
IR.Execute Start of programs
IR.StartAction Starting a macros
IR.HWID Get HWID(UDID) device
Events
IR.EVENT_START Preset commands are performed at the application launch
IR.EVENT_WORK Commands are performed while the application is running
IR.EVENT_EXIT Commands are performed when exiting the application
IR.EVENT_ORIENTATION Commands are performed when the device changes its orientation
IR.EVENT_KEYBOARD_SHOW Commands are performed when a keyboard is opened


iRidium DDK

iRidium DDK - detailed instructions for creating a driver on the example of the Marantz SR7007 device.


Ways of Script Debugging

Windows

For debugging scripts created on Windows use Emulator of GUI Editor, which has its own logging system. To open Emulator, press on F4.


iOS, OS X, Android

It is not possible to launch logging on devices with installed iRidium App but there is a method of Remote Debugging which can be activated through the settings of iRidium App.

To launch Remote Debugging launch iRidium App on your control panel and go to its settings. The launch of Remote Debugging is made in the Update section of the application settings.

'Update'
Indicate the local IP-address of the PC (Host) where the server is launched and the port of the listener (Port) - 514 in the App settings on the control panel. Press the Apply button and restart iRidium App on the panel.


Settings of the Syslog server:

Remote debugging is performed with the help of the Syslog server which is installed on your PC and receives data from remote iOS or Android devices. With the help of this tool you can see the log of your control panel on your PC.

To start work install and set up any Syslog server for Windows on your PC, for example, Ipswitch Syslog Server. In the settings indicate the UDP port the server will receive data from: 514 and set the Syslog Server for the service mode:

Syslog Settings.png

At the next launch iRidium App will send information to the Syslog server on your PC.


Examples of Using iRidium Script

Examples of Using iRidium Script


Information about JavaScript

Web Sites on JavaScript


Books on JavaScript

Knowledge level: intermediate
Detailed review of JavaScript outlook through analysis of integrated objects and nuances.

Knowledge level: beginner
Introductory book on JavaScript and programming on the whole.

Knowledge level: advanced
Selected articles from the cyclus «Let’s Make a Framework».

Knowledge level: advanced
This book helps to learn how to write a web server with highly competitive connections.

Knowledge level: intermediate
Introduction to CoffeScript with focus on clarity, abstraction and verification.

Knowledge level: intermediate
The goal of the book is to give the starting point in development of applications in Node.js and at the same time to teach «advanced» programming on JavaScript.

Knowledge level: beginner
The book on JavaScript and jquery.

Knowledge level: beginner
This book examines conventional and contemporary patterns of programming in JavaScript.

Knowledge level: intermediate
The book examines the theory of MVC(Model-View-Controller) and shows how to develop applications using models, views, collections and routing in Backbone.js

Knowledge level: advanced
This book is written to help to study CoffeeScript, understand the best practical aspects and start creating incredible applications.


Demo Projects

Pages and Popups Creating and deleting pages/popups. Changing properties of pages/popups. Working with device orientation, etc.
Graphic Items Creating and deleting items. Changing item properties. Counting the number of items and item properties.
Gestures Activating, deactivating and processing gestures.
Tokens Data writing and reading from tokens.
Sounds Turning sounds on/off using iRidiumScript
System Tokens Referring to system tokens.
Drivers Creation of drivers, performing data sending.
Lists Creating and deleting lists. Changing list properties, etc.
Keyboards and EditBox Types of keyboards, receiving data from keyboards.
Color Schemes Working with colors in iRidiumScript.
Xml-objects Working with xml-objects in iRidiumScript.
Json-objects Working with json-objects in iRidiumScript.
Personal tools
Namespaces

Variants
Actions
Navigation
Downloads
Components
Instructions
Licensing
iRidium Script
Toolbox
Print/export