542
OPUS Projektor Manual
JavaScript
//reading successful, myLog is now an array
//print contents to console:
print("Alarm log:");
for (var i = 0; i < myLog.length; i++)
{
print(myLog[i]);
}
}
Note: The returned array can be easily passed to a table object so it can be shown on screen
( setProperty(IDofTableObject, "Table Data", arrayWithLogContent); )
Note 2: If the formatting of the date and time is not what is desired, the timestring can be used
to create a JavaScript Date object which provides easy access to each part of the date and
time:
//assume that we already have an array filled with log data and
that the timestamp is the first part of each entry
var i = 0;
//extract the timestamp from the log entry
var timestampAsString = myLog[i].substr(0,
myLog[i].indexOf(";"));
Var timestamp = parseInt(timestampAsString);
var myDate = new Date(timestamp * 1000);
//now each part of the date/time can be accessed separately:
//e.g. myDate.getDate() <-- day of month
//or myDate.getSeconds() <-- seconds and so on...
deleteAlarmLogRingBufferContent - clear an alarm log ring buffer
Simply use the following function to delete the complete alarm log ring buffer:
deleteAlarmLogRingBufferContent();
moveDDO - move an object on the screen
The moveDDO function can be used to move an object to a new position. Please use this
function with care, this can lead to a very high system load if this function is abused to e.g.
create complex animations.
Prototype:
var result = moveDDO(number ParentObjectID, number
ObjectIDtoBeMoved, number newX, number newY);
The first parameter is the object ID of the parent of the object that shall be moved (check
project tree to find the parent). The second parameter is the ID of the object that shall be
moved. The third and fourth parameters are the new coordinates inside the parent.
Example:
//Move the picture graphic DDO 42. The parent of this ddo is
frame 21
var pictureDDO = 42;
var frameDDO = 21;
//now move to position 84/36:
var movingWorked = moveDDO(frameDDO, pictureDDO, 84, 36);
if (movingWorked)