Migrating GunnShow Visio Drawings to GunnsDraw - nasa/gunns GitHub Wiki

We can convert legacy GunnShow Visio drawings into GunnsDraw drawings. We are eventually going to stop supporting GunnShow, so you’ll want to convert your drawings.

We have a Python script that does the conversion. It handles all the GUNNS shapes like links, nodes, spotters, and their shape data, as well as some text boxes and lines that you may have for comments. There are some limitations to note, listed below.

Procedure

To do the conversion on your GunnShow drawing, follow these steps:

  1. First make sure you have a custom link shape library for GunnsDraw for any custom links you may use in your GunnsShow drawing. See Custom User Shapes and Libraries.
  2. Open your GunnShow drawing in Visio. In Visio:
    1. Click the Update Drawing button in the GunnShow menu ribbon, and update all links with any shape data they are missing.
    2. Save the drawing as type ‘XML Drawing’. This will create a .vdx file.
  3. Run the gunns/draw/gsmigrate.py script. More details on how to run this script below. This will create the GunnsDraw .xml file in the same folder as the source .vdx file.
  4. Open the GunnsDraw .xml in Draw.io and perform any manual cleanup as required or desired.

Invoke the conversion script from the command line like so:

$ python gsmigrate.py -l path/to/your/custom/shape/library1.xml:path/to/custom/library2.xml YourDrawing.vdx

The -l argument is required if your drawing uses custom links that aren’t in gunns/. From Step 1, you will have created a custom shape library for your custom links. This argument provides such library files to the script. You may include multiple libraries, delimited by colons (:).

You may provide the path/filename for your .vdx file on the command line. If you don’t, the script will pop up a window for you to navigate to and select your .vdx file.

Other command line options are:

  • -z (value). This overrides the zoom level to the provided value. The default value of 85 is used if this option isn’t invoked. Larger values make the resulting GunnsDrawing larger and objects spaced further out, i.e. it looks more zoomed out compared to the GunnShow drawing.
  • -s. This switch turns off the snap-to-grid in the conversion. By default, the script will snap all geometries to the 10 pt grid in draw.io. Using this command option turns off the snap.

Note that although the the exported network code from GunnsDraw is functionally equivalent to GunnShow and should perform identically in run-time, the exported code is not identical. So unfortunately we can’t directly diff the two versions to test the conversion. These differences come from several improvements in the GunnsDraw export over GunnShow: cleaning up the exported code, making comments and architecture more consistent, properly scoping some class names such as socket lists, and others.

Limitations

Many of these will be overcome in the future:

  • We don’t copy style formatting such as color, fill, line style, fonts, etc.
  • Some connector line paths will be different near the link connection points.
  • We don’t copy the link name label orientation or its pin location relative to the link shape.
  • These links aren’t supported yet: IPS, Power Bus, Switch Card.
  • TS21’s sensor shapes aren’t supported yet.
  • We don’t yet support custom links from these legacy projects: TS21, HESTIA, Boeing.
  • We still need to implement Trace Compounds config & state objects
  • GunnShow controls link order in two ways: order of addition to the drawing, and each link has a ‘Initialization order for this shape’ priority value. We have implemented the former but not the latter.

Example

These pictures show an example GunnShow fluid network and it’s corresponding GunnsDraw migration. This is with the default zoom and snap options. The GunnShow drawing:

The GunnsDrawing after migration:

⚠️ **GitHub.com Fallback** ⚠️