Add your idea or search for answers in existing topics. The most popular ideas will be implemented faster!

We have moved our support service to a new technical support system. Since 17.01.2022, we have disabled the ability to create appeals through the userecho personal account. Now all requests are processed via mail to support@iridi.com .

Thank you for your understanding and have a nice day.

0
Answered

Page resize from script

miro suchanek 9 years ago in iRidium Script updated by iRidiumNikita 9 years ago 2
Hello,
is it possible to change the page (or project) size from Script?

Thank you
0
Answered

GetCommandAtPos/GetCommandAtName

Jackie Roos 8 years ago in iRidium Script updated by Dmitry - support (expert) 8 years ago 3

Hi

I am working with a driver written in AV&Custom systems, not a core driver.


http://wiki2.iridiummobile.net/Drivers_API#GetCommandAtName


I can see how I can get the command as described in the wiki:

[11-02-2016 17:25:19.359] INFO Name: NameCommand = id:5 name:AC Fan UP COOL data:


But can how can I then use this information to send the command to the driver from JavaScript?


Let's assume I cannot access the driver script.


Possible solutions:

1. Send the driver's command from javascript - eg I want to send a command to the driver from JavaScript so I can using all the programming that has already been done in the driver before it sends the command, eg bounds checking - is this possible? how?

2. Is there any way to set a driver command to an item's press event from JavaScript, like I can access the state information.

3. anything else you can think of?


thanks


0
Answered

Image size

Jan Hein Liebregts 11 years ago in iRidium Script / Interface scripts updated by Oksana (expert) 9 years ago 2
Hello,
When I have an javascript with:
[font=courier]IR.GetItem("Page 1").GetItem("Button").GetState(0).Image = "pict.jpg";
It ads an image to the button.
When I ad:
IR.GetItem("Page 1").GetItem("Button").Width = 500;
IR.GetItem("Page 1").GetItem("Button").Height = 100;
It changes the button size, but not the image size.
How can I change the image size in the javascript?
Jan Hein
0
Not a bug

IR.SetTimeout executes too quickly.

rocfusion 9 years ago in iRidium Script updated by Oksana (expert) 9 years ago 4
Hi,

Create a new project
Add the following script
function hello(){
IR.Log("hello again")
}
IR.AddListener(IR.EVENT_START,0,function()
{
IR.Log("Hello");
IR.SetTimeout(600, hello)
});

Run the project,  I would expect the function hello to execute anytime after 600 milliseconds.  This is not the case.  It always executes before.

Thanks,


Roger
0
Completed

Building graphs

evg 9 years ago in iRidium Script / Interface scripts updated by Ekaterina (head of support) 9 years ago 1
Project with example of building graphs.
Graph.irpz

All suggestions on optimization and improvement are welcome.
0
Completed

current timezone and other time functions

r riksma 9 years ago in iRidium Script updated by Olga (expert) 9 years ago 2
As a workaround for the problem of cached requests I want to include the current device time in my http request.
http://support.iridiummobile.net/topic/671754-cache-of-command-in-offline-mode/
This way when a request is made that is older than a few minutes it will be blocked by the server.
It works fine for now but i am afraid i will run into problems when requests are made from a different time zone.
Could you add a command to get the current timezone, or one that always returns the current time in UTC? It would be even better to have a bunch of helper functions, like the ruby time object has for instance: http://ruby-doc.org/core-1.9.3/Time.html

Answer
Olga (expert) 9 years ago
Dear Sir,

Here is the string which gives full date with time and time zone (GMT).

var now = new Date();

Time can be converted from UTC to GMT using the script (please see the example in the attachment).

testUTC.irpz
0
Under review

Project crash because of script created joystick item

r riksma 9 years ago in iRidium Script / Interface scripts updated by Ekaterina (head of support) 9 years ago 1
If you create a joystick item to use as a color picker by using a script, the project crashes when you click on the joystick. This is only in windows, on an iPad it works fine.
To reproduce:
-download your demo project:
https://s3.amazonaws.com/iRidiumWiki2.0/i2Scripts/JS_Iridium_demo_EditItem.irpz
-make sure you can click on the joystick by placing the code last or removing the other items.
-click and watch it crash.

Tested Editor versions:
V2.1.2.16841
V2.2.1.17647

Answer
Yes, you are right, the Joystic created via the script doesn't work for now.
It happens because the default value of MaxX and MaxY is zero, when you create it via the script, and you cannot change it. Now you cannot use CreateItem function for the Joystic, but we'll find a solution. Thank you.
0
Voting

Temperature Measurement Token in Android

Artyom Syomushkin 9 years ago in iRidium Script / Interface scripts updated by Oksana (expert) 8 years ago 2
A lot of Android devices feature Battery or CPU Temperature Sensor.
It would be useful to add them to System Tokens. With some correction such sensor can be used as ambient temperature sensor in the place where panel is installed.
System Tokens Android
0
Answered

Http request

Sorokin 8 years ago in iRidium Script updated 8 years ago 2

Пытаюсь разобраться с механизмом обработки HTTP запросов. Правильно ли я понимаю что стандартным скриптом нет возможности подключится к удалённому серверу для отправки HTTP запроса используя стандартный метод GET, а исключительно через создание драйвера?


Вопрос в том что стандартный драйвер погоды YahooWeather судя по параметрам выдаёт только текущие значения и значения на следующий день.


Мне бы хотелось используя стандартный запрос "http://weather.yahooapis.com/forecastrss?w=2122265&u=c" получать значения на следующие 4 дня...

0
Answered

missing standard ECMAscript functions

r riksma 9 years ago in iRidium Script / AV and Driver scripts updated by Oksana (expert) 9 years ago 6
I think it is always a good idea not to copy and paste code too much.
that's why i would like to create a function and use it many times over.

The problem with this is that the variable scope is defined when creating the function, not when running it.
for example:

var a = 456;
var func_b = function() {
IR.Log(a);
}
function func_a(param_a) {
var a = 123;
param_a();
}
func_a(func_b);

This returns 456 but i want it to return 123

To fix this there should be methods like call, apply and bind but they do not seem to exist in iRidium.

I also noticed Splice() does not work. (used to remove items from an array)

What is the current level of compatibility with the ECMA standard?
Is it at least possible to add the functions that are missing?

(extra resources:)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice
http://javascriptissexy.com/javascript-apply-call-and-bind-methods-are-essential-for-javascript-professionals/