ResponsiveMigration
If you have existing Px graphics, running this program object will make them mobile friendly.
Properties
Available in Niagara, this programObject can process a folder full of existing Px files (or a single existing Px file), and apply responsive rules to the graphics. This process optimizes the display when the graphics are viewed on mobile devices using HxPx.
This programObject is available in the pxEditor palette.
| Name | Value | Description |
|---|---|---|
| filePath | file:^px | Indicates the folder of Px files (or an individual Px file) to be optimized. |
| filePathRegex | \.px$ | Filters all but the Px files for indicated folders |
| preserveIdentities | true (default), false | Enable/disable this property. Equivalent to the Preserve Identities setting under the Px Editor section in Workbench Options. If true, the names of the widgets in your Px pages will be preserved in the Px file. If false, they will be left out. In general, this should be set to the same value with which the Px pages were originally saved. Note that any pages that include Px Properties will automatically have identities preserved. If unsure, leave set to true. |
| wrapRootInScrollPane | true (default), false | Enable/disable this property. Ensures that the root element of your Px page is a ScrollPane, which will allow the CanvasPane root to resize down to a smaller form factor, but still scroll to allow the entire graphic to be viewed without shrinking the graphic down beyond a reasonable limit. |
| processCanvasPanes | true (default), false | Enable/disable this property. Sets the min and max scale factors of the main CanvasPane, which defines how small or large the CanvasPane may scale in order to fit different screen sizes. |
| minScale | 0.50 (default) | Range is 0.0–1.0. Typically between 0 (allow it to shrink to nothing) and 1 (do not allow it to shrink at all). |
| maxScale | 1.0 (default) | Range is 1.0-2.0, although the upper limit is not enforced. Use a value of 1.0 (do not allow it to grow at all) or up to some reasonable upper limit (for example, 2.0 would allow it to grow up to twice its defined size). |
| scaleMode | None, Fit, Fit Ratio (default), Fit Width, Fit Height | Defines how the aspect ratio of the Px graphic will change as it grows or shrinks. This would most commonly be Fit Ratio, which will preserve the graphic's aspect ratio. Another option is Fit, which would cause the graphics to fill the entire available screen space, at the cost of some stretching. |
Actions
Execute
Executes the programObject.
Dry Run
list out all the matching files in the target directory and describe exactly what changes will be made. This information will be logged to the com.tridium.px.editor.util log, so use the Logger Configuration view for the DebugService to add log and adjust the log level, if needed. Execute the programObject a second time with Dry Run turned Off to commit the changes to the file system.
Command-line Interface
Migration can also be performed from the command line, to avoid having to do an unsafe migration against a running station. Enter the following command to invoke it (line breaks added for clarity):
nre.exe Workbench:com.tridium.Workbench.px.PxFileMigrationUtil
-preserve-identities -process-canvas-panes -wrap-in-scroll-pane
-file-path:c:/myDevDirectory/myPxFiles -max-scale:1.5 -min-scale:0.5
-scale:fitRatio "-regex:\.px$"To commit changes, add
the -overwrite-files flag; otherwise, it defaults
to a Dry Run.
All the command-line flags correspond to the different parameters that can be configured on this program object; for the boolean parameters, omitting them entirely will correspond to false.