Можно ли в одну структуру AddListener добавить обработку нажатий для нескольких объектов?
// массив элементов var gRegisters = [ {item: IR.GetItem("Page 1").GetItem("1")}, {item: IR.GetItem("Page 1").GetItem("2")}, {item: IR.GetItem("Page 1").GetItem("3")}, ]; function OnPress() { // что-то делаем при нажатии на элемент массива, this. - указатель на item IR.Log("Pressed: " + this.Name); IR.Log(this.Name + " Value: " + this.Value); } // создание слушателей для всех элементов массива function RegisterButton() { for(var i = 0; i < gRegisters.length; i++) { var item = gRegisters[i].item; IR.AddListener(IR.EVENT_ITEM_PRESS, item, OnPress, item); } } // функция, выполняющаяся по старту function Start() { RegisterButton(); } // начинаем создание слушателей IR.AddListener(IR.EVENT_START,0, Start);Что бы получить доступ к данным графического элемента внутри функции OnPress, необходимо обратиться к нему по ссылке this. Например:
function OnPress() { var NameOfItem = this.Name; IR.Log( NameOfItem ); }
Возможность обращения к данным достигается путем передачи 4-го параметра в метод AddListener:
IR.AddListener(IR.EVENT_ITEM_PRESS, item, OnPress, item);
Вы можете узнать имя нажатого элемента или подписаться на нажатия всех элементов в проекте, используя следующие инструкции.
Помогите сделать "бегущую строку"
Change Item Opacity (Transparency)
If you want to set the transparency of Item when the Light changes, you can do it directly (send Light Value to Item.Opacity) or via the script.
The script would be needed if your light changes from 0 to 100 untill the Opacity changes from 0 to 255.
// items var Level = IR.GetItem("Main").GetItem("Light Level 1"); var Item = IR.GetItem("Main").GetItem("Light Item 1").GetState(0); // driver name var driver = IR.GetDevice("KNX Router (KNXnet/IP)"); //by Start Item.Opacity = 0; // change opacity manually (using ScriptCall function) function OpacityChange () { Item.Opacity = Level.Value*255/100; } // change opacity by Feedback from equipment IR.AddListener(IR.EVENT_TAG_CHANGE , driver, function(name,value) { Item.Opacity = Level.Value*255/100; });Opacity Change by Value.irpz
If you want to convert the feedback only use this script:
var FeedbackConvert;
IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetDevice("KNX"), function(name, value)
{
if (name == "Address 1")
{
FeedbackConvert = (value*255)/100
IR.GetItem("Page 1").GetItem("Item 1").GetState(0).Opacity = FeedbackConvert;
IR.Log("Value = "+ value)
}else{
IR.Log("unknown")
}
});
How i can save & load an array to project token?
Example Project
var Value_Buttons = [0,0]; function LoadData(){ Value_Buttons = IR.GetVariable("Global.Data").split(","); IR.Log(Value_Buttons) } function SaveData(){ IR.SetVariable("Global.Data", Value_Buttons); IR.Log(Value_Buttons); } SaveData(); LoadData();
2D Array
var Value_Buttons = [[0,0],[1,1]]; function LoadData(){ var data = IR.GetVariable("Global.Data"); data = data.split(";"); for(var i = 0; i < data.length; i++) Value_Buttons[i] = data[i].split(","); IR.Log(Value_Buttons) } function SaveData(){ var data = ""; for(var i = 0; i < Value_Buttons.length; i++) data += Value_Buttons[i] + ";"; IR.SetVariable("Global.Data", data); IR.Log(data); } SaveData(); LoadData();
var Value_Buttons = [[[0,0],[1,1]],[[2,2],[3,3]]]; function LoadData(){ var data_1 = IR.GetVariable("Global.Data"); var data_2 = []; data_1 = data_1.split(":"); for(var i = 0; i < data_1.length; i++){ data_2[i] = data_1[i].split(";"); for(var j = 0; j < data_2[i].length; j++) Value_Buttons[i][j] = data_2[i][j].split(","); } IR.Log(Value_Buttons); } function SaveData() { var data = ""; for(var i = 0; i < Value_Buttons.length; i++){ for(var j = 0; j < Value_Buttons[i].length; j++){ data += Value_Buttons[i][j]; if(j < Value_Buttons[i].length -1) data += ";" } if(i < Value_Buttons.length -1) data += ":"; } IR.SetVariable("Global.Data", data); IR.Log(data); } SaveData(); LoadData(); <br/>
HighCross - NetString
Dear everybody,
For fast and convenient adding the Highcross into your project we created an interface in the Metro style for iPad & iPhone for controlling Highcross.
We would appreciate if you test efficiency of this driver. If you find any bug please let us know.
Highcross_ECM-DTS16D_DemoProject.irpz
HighCross-NetString.zip
Highcross.db
Counting in Java
Test_Count__2_.irpz
Analog Clock
clock_light.jpg
Smart meter
1375317_402121366577896_716783109_n__2_.jpg
Yamaha
We developed the js driver for Yamaha devices.Test it please and write your feedback to us. We are havn't the Yamaha-device for testing it, but have the Denon-protocol. We are test it on the our DeviceEmulator.exe programm only. We attached the database with the driver and demo-project. If you will test it, first of all you must open the GUI and attach the database to your device base. After that add the driver to your project and then you will see the instructions how to use it. You must use following algoritm:
1. Use Macros Send Text
2. Input Action for Feedback InputAction
3. Input Zone for Feedback InputZone
4. Drag & Drop Command to item
Yours,iRidium Mobile Team.
Yamaha.zip
Marantz SR7007
Test it please and write your feedback to us. We attached the database with the driver. If you will test it, first of all you must open the GUI and attach the database to your device base. After that add the driver to your project and then you will see the instructions how to use it. You must use following algoritm:
1. Use Macros Send Text
2. Input Action for Feedback InputAction
3. Input Zone for Feedback InputZone
4. Drag & Drop Command to item
DOWNLOAD:
http://www.iridiummobile.ru/products/module/marantz/
PTN Matrix Switchers
Dear everybody,
We developed the driver to PTN Matrix Switcher. Test it please and write your feedback to us. We attached the database with the driver, and the example project. If you will test it, first of all you must open the GUI and attach the database to your device base. The manual you can find in script.
ptn.db
PTN.irpz
Boxee
Dear everybody,
We developed the js driver for Boxee media server.
Test it please and write your feedback to us. We attached the database with the driver and the demo-project.
Yours,
iRidium Mobile Team
Boxee.db
Boxee.irpz
xComfort Eaton
HI! The xComfot driver is available in beta-test now. It can send commands and receive feedback. But the driver may have some bugs: for example, it doesn't request the initial state of a device at its start. All comments to the driver are in Russian, but soon they'll be available in English. We wish you successful testing.
Release_2013.05.31_-_EN.zip
Dune HD
Dear everybody,
For fast and convenient adding the DuneHD Media Server into your project we created an interface in the Metro style for iPad & iPhone for controlling DuneHD Media Server.
We would appreciate if you test efficiency of this driver. If you find any bug please let us know.
Dune.db
DuneHD.zip
Kramer Switchers
Dear everybody,
For fast and convenient adding the Kramer 2000 / 3000 into your project we created an interface in the Metro style for iPad & iPhone for controlling Kramer 2000 / 3000.
We would appreciate if you test efficiency of this driver. If you find any bug please let us know.
Kramer.zip
Onkyo / Integra
Dear everybody,
For fast and convenient adding the Onkyo into your project we created an interface in the Metro style for iPad & iPhone for controlling Onkyo.
We would appreciate if you test efficiency of this driver. If you find any bug please let us know
Denon
We developed the js driver for Denon devices.
Test it please and write your feedback to us. We are havn't the Denon-device for testing it, but have the Denon-protocol. We are test it on the our DeviceEmulator.exe programm only. We attached the database with the driver and demo-project. If you will test it, first of all you must open the GUI and attach the database to your device base. After that add the driver to your project and then you will see the instructions how to use it. You must use following algoritm:
1. Use Macros Send Text
2. Input Action for Feedback InputAction
3. Input Zone for Feedback InputZone
4. Drag & Drop Command to item
Yours,iRidium Mobile Team.
Denon_v2.zip
Customer support service by UserEcho