556
OPUS Projektor Manual
JavaScript
including any painting operation. The programmer is advised to show a warning to the device
user when a blocking function is called.
If the script was triggered e.g. by a CAN stack (e.g. timeout or received event), it will also
block that thread and will e.g. not send cyclic messages during the block!
The time it takes to finish this function depends on the size of the moved data.
syncFilesystem - Forces finishing of all file operations
This function performs a "sync" command.
This is relevant if the device is shut down after a copy / move process. The OS finishes these
operations quite slowly in the background.
Prototype:
syncFilesystem();
Please note: This function blocks the execution until it is finished. Blocks means: The thread
that caused the execution of the script will block. Usually this is the PClient main thread
including any painting operation. The programmer is advised to show a warning to the device
user when a blocking function is called.
If the script was triggered e.g. by a CAN stack (e.g. timeout or received event), it will also
block that thread and will e.g. not send cyclic messages during the block!
The time it takes to finish this function depends on the size of the copied/moved data.
openPDFReader - Open the PDF Reader
This function opens the PDF reader , optionally with a PDF file and / or a "Open File"
button.
Prototype:
bool openPDFReader(optional:String pathToPDFtoOpen,
optional:bool showOpenButton);
Parameters:
·
pathToPDFtoOpen: String with full path to the PDF file to open. No restrictions. Can be
anywhere on the file system or e.g. USB stick.
·
showOpenButton: Flag to indicate if the open button shall be shown or not. Note that if no
path was provided, the open button is shown automatically.
Return value:
·
true if starting the PDF reader was successful (this is no indication if the provided PDF
could be loaded)
·
false if starting the PDF reader failed
Note that the PDF reader cannot be opened in the PClient simulation, only on the device.
runSystemCommand - run a Linux system command
With great power comes great responsibility!
442