FRAC-3 Script Editor

Feature Spec and Test Procedures

 

 

Explore

Known Bugs

Failing Tests

Other Findings

Requirements

Interface/Functional Spec

Overview

Description

Active script

GUI/script synchronization

Edit window

Find and Replace

File controls

Save status indicator

Test Procedures

Assumptions

Existing Tests

Recommended Additional Tests

 

Explore

This section is current as of 07/31/2012. It is no longer being updated.

Known Bugs

 

JIRA ID

Description

Rec.

GMT-2878

GUI flakiness with long strings

P2

GMT-2843

Save/Sync/Run Doesn't Save Script and Runs Old Version of Script

P1

GMT-2800

Save in script editor for new script doesn't save the script

P1

GMT-2678

Save/Sync with maximized editor window causes window to un-maximize

P1 P2

GMT-2578

warnings loading Architectural Spec *.gmf files within the GMAT editor

P3

GMT-2520

Menubar-Edit is missing Delete

P3

GMT-2518

Menubar Edit Find and Replace does not work

P1

GMT-2515

Find, Find Next, Replace will not work with partial words

P1

GMT-1855

Script Editor Cntl + L, Cntl + E, Cntl + R and Cntl + J Short Cut Keys do not work

P3

GMT-1854

Script Editor Tab Key does nothing

P3 P1

GMT-1846

On Linux, STC Editor crashes GMAT on Close

P3

GMT-1831

Mission Sequence Script Event Tab key becomes stuck in the text box

P3

GMT-1625

Script Editor with short cut keys disabled

P1

GMT-575

Tab doesn't work in the script editor

P2

Dupe of 1854

 

Failing Tests

The script editor has no script tests.

Other Findings

 

JIRA ID

Description

Rec.

GMT-2972

Open a script in the script editor. Make a change to both the GUI and script, so the indicator says “Unsynchronized”. Close the script editor without saving changes. The indicator stays at “Unsynchronized” until the script editor is opened again.

P2

GMT-2973

Undoing all changes does not reset the modified state. You must close and reopen the script editor to reset it.

P2

GMT-2974

In the GUI Modified state, syncing the script with the GUI does not display a warning, even though modifications are lost.

P1

GMT-2975

Insert an invalid line into the script editor, then click Save,Sync or Save,Sync,Run. The error message dialog box appears twice.

P1

GMT-2976

Syntax highlighting is incomplete

P1

GMT-2977

Right-click an inactive script name and click “Build”. This does not result in the same confirmation message as clicking “Save,Sync”. Same for “Build and Run”/”Save,Sync,Run”

P2

GMT-2977

Naming inconsistency: “Build” on script right-click menu, “Save,Sync” on script editor

P2

GMT-2978

Horizontal scroll bar extends beyond actual script margin

P2

GMT-2979

Edit menu Comment/Uncomment commands work only on the current selection, not on the active lines themselves.

P1

GMT-2978

Shrink the script editor window so it has a window-level scroll bar. Move the scroll bar to the far left, then start the Find/Replace utility. The scroll bar will move.

P2

GMT-2978

With a script with long lines, the horizontal scroll bar doesn’t extend to the end of the longest line.

P1

GMT-2980

Edit>Find and Replace menu item doesn’t work

P1

N/A

Edit>Find Next always proceeds in downward direction, not in direction of last search

Not a bug

GMT-2984

“Find Next” to the end of the file. Then click back at the beginning of the file. “Find Next” doesn’t start highlighting from the cursor position anymore.

P2

GMT-2985

“Replace All” in the Find/Replace utility doesn’t work unless a match is already highlighted, then it only works below the match, not for the whole file

P1

GMT-2979

“Indent More”/”Indent Less” work at cursor location, not for entire line

P1

GMT-2979

Indent Less” moves cursor back, but does not delete indents

P1

GMT-2986

Remove CTRL-L shortcut

P2

GMT-2987

Add CTRL-S to save script

Improvement

GMT-2981

Open GMAT and save the default mission to a file. Open the file in the script editor. GMAT keywords won’t be colored in blue.

P2

GMT-2988

Close GMAT when script editor is maximized. When you open GMAT again and load a script, the script editor will be full-size, but not maximized.

P2

 

Requirements

These are working requirements.  They are included here for review and convenience purposes.  After review, requirements are maintained in the formal SRS located at SourceForge in /trunk/doc/SystemDocs/Requirements.  Send final requirements to CCB lead (SPH).

ID

Requirements

FRAC-3.1.0

The editor shall support the following text editing functionality:

FRAC-3.1.1

1)                Undo typing

FRAC-3.1.2

2)                Redo typing

FRAC-3.1.3

3)                Select a block of text

FRAC-3.1.4

4)                Select all text

FRAC-3.1.5

5)                Cut selected text

FRAC-3.1.6

6)                Copy selected text

FRAC-3.1.7

7)                Paste text

FRAC-3.1.8

8)                Comment a block of text

FRAC-3.1.9

9)                Uncomment a block of text

FRAC-3.1.10

10)                Increase the indent of a block of text

FRAC-3.1.11

11)                Decrease the indent of a block of text

FRAC-3.2.0

The editor shall support the following find and replace functionality:

FRAC-3.2.1

1)                Find a block of text (w/o case sensitivity)

FRAC-3.2.2

2)                Find next

FRAC-3.2.3

3)                Replace a block of text

FRAC-3.2.4

4)                Find and replace

FRAC-3.2.5

5)                Go to requested script line number

FRAC-3.3.0

The editor shall support the following miscellaneous functionality:

FRAC-3.3.1

1)                Optionally show line numbers in the editor

FRAC-3.3.2

2)                Display GMAT keywords and command in colored text

Interface/Functional Spec

Overview

The GUI script editor

Description

A GMAT mission can be created in either the graphical user interface (GUI), or in a text script language. When a mission is loaded into the GUI from a script, or when it is saved from the GUI, there is a script file that can be accessed from the Scripts folder in the resources tree. When you open this script, it opens in a dedicated editor window called the Script Editor .

While a GMAT script can be edited in any text editor, the GMAT script editor offers more features, such as:

      GUI/script synchronization

      Mission execution from from the editor

      Syntax highlighting

      Comment/uncomment or indent blocks of text

      Standard features like copy/paste, line numbering, find-and-replace, etc.

The following figure shows a basic script editor session with the major features labeled.

Figure 1

Active script

When you load a script into the GMAT GUI, it is added to the script list in the resources tree. GMAT can have many scripts loaded at any one time, but only one can be synchronized with the GUI. This script is called the active script , and is distinguished by a bolded name in the script list. The editor status indicator in the script editor for the active script shows “Active Script” as well. All other scripts are inactive , but can be viewed and edited in the script editor.

 

 

To synchronize with the GUI, you must make an inactive script active by clicking either of the synchronization buttons (described in the next section). This will change the current script to active, synchronize the GUI, and change the the previously active script to inactive. Alternately, you can right-click the script name in the resources tree and click Build .

GUI/script synchronization

GMAT provides two separate representations of a mission: a script file and the GUI resources and mission trees. As shown in Figure 1, you can have both representations open and active at the same time, and can make changes in both places. The GUI/Script Sync Status indicator shows the current status of the two representations relative to each other. The following states are possible:

The GUI and script representations are synchronized (they contain the same data).

The mission has been modified in the script representation, but has not been synchronized to the GUI. Use the synchronization buttons in the script editor to perform this synchronization. To revert the modifications, close the script editor without saving your changes.

The mission has been modified in the GUI, but has not been synchronized to the script. To perform this synchronization, click the Save button in the GMAT toolbar. To revert the modifications, use the synchronization buttons in the script editor, or restart GMAT itself.

The mission has been modified both in the GUI and in the script. The changes cannot be merged; you have a choice of whether to save the modifications in either representations, or whether to revert either of them. See the notes above for instructions for either case.

There is an error in the script. This puts the GUI in a minimal safe state. The error must be corrected before continuing.

 

Caution: Saving modifications performed in the GUI will overwrite the associated script. The data will be saved as intended, but with full detail, including fields and settings that were not explicitly listed in the original script. A copy of the original script with the extension “.bak” will be saved alongside the new version.

 

The script editor provides two buttons that perform synchronization from the script to the GUI. Both the Save,Sync and the Save,Sync,Run buttons behave identically, except that the Save,Sync,Run button runs the mission after synchronization is complete. The following paragraphs describe the behavior of the Save,Sync button only, but the description applies to both buttons. If you right-click the name of a script in the resources tree, a context menu is displayed with the items Build and Build and Run . These are identical to the Save,Sync and Save,Sync,Run buttons in the script editor.

When pressed, the Save,Sync button performs the following steps:

1         Saves any modifications to the script

2         Closes all open windows (except the script editor itself)

3         Validates the script file

4         Refreshes the GUI by loading the saved script

5         Sets GUI/Script Sync Status to Synchronized .

If the GUI has existing modifications, a confirmation prompt will be displayed. If confirmed, the GUI modifications will be overwritten.

 

Open Issue: 

      T he error message on the GUI overwriting dialog box should read: “You will lose changes made in the GUI if the script is saved. Do you want to save the script, discard old GUI changes, and load the GUI with the saved script?”

      There should be no cancel button on the panel .

 

If the script is not active, a confirmation prompt will be displayed. If confirmed, the script will be made active before the steps above are performed.

 

Open Issue:   The script activation dialog box should read “The script file "ScriptFileName" is not the active script. Would you like to make it the active script and load it into the GUI?”

 

If the script has errors, the GUI will revert to an empty base state until all errors are corrected and the script is synchronized successfully.

 

Open Issue: The state of GUI when a script fails to validate can be unstable.  This is in part due to the fact that required coordinate systems do not exist.  We need to decide what the behavior is in the GUI when an invalid script is parsed.  Currently the entire GUI is empty.  We have not tested this state.  Should we test it or preclude ever getting to that state?

 

We need to define in the spec a minimum mission.  The minimium mission is the required minimum set of objects that always must exist.  For example Solar System and Coordinate Systems (EarthMJ2000Eq, EarthMJ2000Ec, and EarthFixed (more soon).  TGG suggest making objects that are part of the minimum mission as italic and clearly define which object are part of the minimum mission. Then, even when an invalid script is parsed, the GUI will be populated with those basic objects.

 

Another issue is if the script doesn’t validate, and the minimum mission loads, what happens if the user clicks save in the toolbar.  If the script is still active, we need to make sure they don’t lose the script.

Edit window

The edit window displays the text of the loaded script and provides tools to edit it. The edit window provides the following features:

      Line numbering: Line numbers along the left side of the window

      Syntax highlighting: Certain elements of the GMAT script language are colored for immediate recognition.

      Folding: Script blocks (like For loops, Target sequences, etc.) can be collapsed by clicking the black downward-pointing triangle to the left of the command that begins the block.

If you right-click anywhere in the edit window, GMAT will display a context menu with the following options:

      Undo/Redo : Undo or redo any number of changes since the last time the script was saved

      Cut/Copy/Paste : Cut, copy, or paste over the current selection, or paste the current clipboard contents at the location of the cursor

      Delete : Delete the current selection

      Select All : Select the entire script contents

When the script editor is active in the GMAT GUI, the Edit menu is also available with the following options:

      Undo/Redo : Undo or redo any number of changes since the last time the script was saved

      Cut/Copy/Paste : Cut, copy, or paste over the current selection, or paste the current clipboard contents at the location of the cursor

      Comment/Uncomment : Add or remove a comment symbol (%)  at the beginning of the current selection

      Select All : Select the entire script contents

      Find/Replace : Starts the Find & Replace utility (see below)

      Show line numbers : When selected (default), the editor window displays line numbering to the left of the script contents.

      Goto : Place the cursor on a specific line number

      Indent more/less : Adds or removes an indentation from the current line or selection. The default indentation is three space characters.

The following keyboard shortcuts are available when working in the script editor:

F3

Find next (when using Find & Replace)

Ctrl+A

Select all

Ctrl+C

Copy

Ctrl+F

Open Find & Replace utility

Ctrl+G

Goto

Ctrl+H

Open Find & Replace utility

Ctrl+I

Indent more

Ctrl+Shift+I

Indent less

Ctrl+R

Comment

Ctrl+T

Uncomment

Ctrl+V

Paste

Ctrl+X

Cut

Ctrl+Y

Redo

Ctrl+Z

Undo

Ctrl+mouse wheel

Increase or decrease script editor font size

Find and Replace

On the Edit menu,  if you click Find or Replace (or press CTRL-F or CTRL-H), GMAT displays the Find & Replace utility, which can be used to find text in the active script and optionally replace it with different text. The utility looks like the following figure.

To find text within the active script, type the text you wish to find in the Find What box and click Find Next or Find Previous . Find Next (F3) will start searching forward (below) the current cursor position, while Find Previous will start searching backward (above). If a match is found, the match will be highlighted. You can continue clicking Find Next or Find Previous to continue searching. The search text (in the Find What box) can be literal text only; wildcards are not supported.

To replace found instances with different text, type the replacement text in the Replace With box. Click Replace to replace the currently-highlighted match and highlight the next match, or click Replace All to replace all matches in the file at once.

The Find & Replace utility saves a history of text previously entered in the Find What and Replace With boxes in the current session. Click the down arrow in each box to choose a previously-entered value.

 

Open issue: How many history values does the F&R window save?

 

File controls

The Save button saves the current script without checking syntax or synchronizing with the GUI, and without switching the active script. The Save As button is identical, but allows you to save to a different file.

The Close button closes the script editor, and prompts you to save any unsaved changes.

 

Open Issue :  The Save button does not appear on the active script editor window.  Why is this?  It seems to me that the Save button should be on the Script editor at all times.  However, I believe this was a conscious decision so we need to see if there is “ good” reason for this behavior.

 

Open Issue: the text in the image above should say “There were changes made to ”path/filename” panel which will be lost on Close. Do you want to close anyway?”  I working on mac right now and can’t take a screenshot in style with the rest in this doc. I will change the image later when I have time. -SPH

 

Save status indicator

When the contents of the script have been modified, the script editor displays “**modified**” in the save status indicator. This is a visual indicator that there are unsaved changes in the script. Once the changes are saved or reverted, the indicator turns blank.

Test Procedures

Assumptions

 

If you are making assumptions about how tests will be performed or that other test areas will cover some of this functionality, describe that here.

Existing Tests

Describe existing test types using a row for each class of test. 

 

 

Priority

Status

Summary

 

 

 

 

 

 

 

 

 

Recommended Additional Tests

 

Nominal Tests

 

Priority

Status

Summary

 

 

 

 

 

 

 

 

 

 

 

Edge/Corner/Stres

 

Priority

Status

Summary

 

 

 

 

 

 

 

 

 

 

Unique Validation

 

Priority

Status

Summary

 

 

 

 

 

 

 

 

 

 

Unique Mode Tests

 

Priority

Status

Summary

 

 

 

 

 

 

 

 

 

 

 

Unique GUI Tests

 

These are tests that are unique to the GUI interface for this feature that are not covered by the standard GUI test template and procedures.

 

 

Priority

Status

Summary