ArtiSynth User Interface Guide

8 Saving and Loading Probes

8.1 Saving and loading probe data

Each ArtiSynth probe can be associated with an attached file to (or from) which its data can be saved (or loaded). The attached file is specified by the probe’s attachedFile property, which is a string giving the file’s path name. An absolute path locates the file relative to the system root folder, while a relative path locates it relative to the current value of ArtiSynth’s working folder (Section 2.10). If the attachedFile property is null, then the probe does not have an attached file.

For numeric probes, the file format used to save and load data is described in the “Data file format” subsection of the “Simulation Control” chapter of the ArtiSynth Modeling Guide.

Data for an individual probe can be saved or loaded by first selecting it (either within the navigation panel or by left-clicking on its timeline display bar), and then right-clicking and choosing one of the following options from the resulting pull-down menu:

Save data

If the probe has an attached file, saves its data to that file.

Save data as ...

Brings up a file chooser allowing the user to specify an attached file for the probe. Clicking the Save As button then sets the attached file and saves the probe’s data in it. The probe’s attachedFile property will be set to a relative path name if the file is located beneath the current ArtiSynth working folder (Section 2.10), and an absolute path name otherwise.

Load data

If the probe has an attached file, loads its data from that file.

Load data from ...

Brings up a file chooser allowing the user to specify an attached file for the probe. Clicking the Load button then sets the attached file and loads the probe’s data from it. The probe’s attachedFile property will be set to a relative path name if the file is located beneath the current ArtiSynth working folder, and an absolute path name otherwise.

In addition, data can be saved for all output probes that have attached files by either selecting “Save output probe data” from the ArtiSynth File menu, or by clicking on the timeline’s save button (C in Figure 29).

8.2 Exporting numeric probe data

The data associated with a numeric probe can also be exported to either a CSV file (*.csv) or a regular text file (*.txt).

Each line in the file describes the numeric data associated with one of the probe’s knot points, and consists simply of a sequence of n numbers, where n is the probe’s vector size. For CSV files, the numbers are separated by commas, while for text files they are separated by spaces. If “include time data” is selected in the export dialog (see below), then the knot’s time value is also included at the beginning of the line, so that the complete sequence includes n+1 numbers.

The time values exported with a probe are probe relative, so that t=0 corresponds to the probe’s start time and any scaling is ignored.

To export a probe’s data, first select the probe (either within the navigation panel or by left-clicking on its timeline display bar), and then right-click and choose “Export data as ...” from the resulting pull-down menu.

Figure 42: The export probe data dialog.

This brings up a dialog (Figure 42) that allows the user to specify the file name and output file type (CSV or text). It also allows the user to specify export-specific properties, such as:

numeric format

A printf-style format string specifying the formatting for floating point data. The default value is %g, which means all numbers will be written to full precision with a variable length and using scientific notation if needed. Other allowed formats are described in the documentation for maspack.util.NumberFormat.

include time data

A Boolean value which if true indicates that time data should be included along with the numeric values. Not including time data may be appropriate when the data is spaced at a known time interval.

8.3 Saving and loading all probes

The model’s entire configuration of input and output probes can be saved to (or loaded from) a single file. This file stores, in an ASCII text format, complete information about each probe, including its start and stop times, location within the timeline, which model properties it connects to, the name of its attached file (if any), and its current data. The file also stores the current waypoint locations, but does not store waypoint data.

Once saved, a probe file can be later loaded to reset the entire probe configuration.

Probes can be saved or loaded by either opening the ArtiSynth File menu, or by right-clicking on the timeline’s waypoint track, and selecting one of the following:

Save probes as ...

Brings up a file chooser that allows the user to specify a file for saving the current probe configuration. Clicking Save As completes the operation.

Save probes

If a probe file has already been specified using either “Save probes as ...” or “Load probes ...”, then the current probe configuration is saved to that file.

Load probes ...

Brings up a file chooser that allows the user to specify a file from which the probe configuration will be loaded. Clicking Load completes the operation.