Updating from 2.x to 3.x

From SpinetiX Support Wiki

Jump to: navigation, search

When updating from firmware version 2.x to 3.X on the HMP, some backward compatibility issues may arise. This page lists the possible issues and how to overcome them.
If you are updating from a 2.1 firmware to 3.x., check the Updating from 2.1 to 2.2 page as well.

JavaScript

Element.textContent

Element.textContent now fully conforms to the DOM API and thus returns the white spaces and newlines from the SVG files if they are "significant" according to the XML specification.

When reading the content of a DOM Element from JavaScript, always use trim() on the result of .textContent to remove unneeded white spaces.

Example:

if ( node.textContent.trim() == "something" )
   ....

getURL()

The callback of the getURL() function is always executed asynchronously starting with 3.x firmware. In 2.x firmware it was executed synchronously in case of local files (but that was not following the SVG tiny 1.2 Specification).

Pull mode

Upload file names

Default file name for the pull action as been modified.

The default option now uses the time of the pull action "%n-%s-%d-%h.%x" (instead of the last modification date of the file, i.e. "%n-%s-%D-%H.%x").

To enforce backward compatibility naming, insert -format %n-%s-%D-%H.%x\n in front of your pull mode commands in the ICS file.

FSM, Serial I/O

  • USB I/O in FSM file is no longer supported, it has been replaced by the new JavaScript HID API.
  • <onUpdate> is no longer supported in FSM files, need to trigger FSM action using the Shared_variable and senComPort() from the JavaScript code.

Instead of the following in the fsm file:

<onUpdate name='sv@localhost' goto='SomeAction' />

You need to add the following in a <script/> element of your index.svg file:

createSharedVariable( 'sv@localhost' ).addUpdateListener( function( v ) {
   sendComPort( "monitor", "SomeAction", v.value );
}, false );

Note that if you were using the value of the shared variable ($VALUE) in the fsm file, you need to replace it by the $PARAM1.

This page was last modified on 29 August 2014, at 18:16.