SnlEditor - ControlSystemStudio/cs-studio GitHub Wiki
SNL Editor
Purpose: Editor for the State Notation Language (SNL)
The State Notation Language is a superset of the C language, used for programming EPICS-based IOCs. The SNL perspective aids in editing through syntax highlighting, display of problems, code completion and outline-based navigation in the source code.
A brief introduction for using the SNL Development perspective follows
SNL Development Perspective
Open the SNL Development perspective. Press the button in the toolbar for selecting perspectives
SnlEditor/00_SNL_Open_Perspective.png
click Other ...
and chose the SNL perspective
SnlEditor/01_SNL_Select_Perspective.png
If you already have worked with it, it may have a different layout. Reset it then, so your display has a layout similar to this one:
SnlEditor/SNL_Developer_Perspective.png
Install Samples
Install the samples via CSS menu:
SnlEditor/SNL_Menu_Install_Sample_Projects.png
Then you will find the SNL Demo Project in the Navigator View.
Import existing source files
You may as well import your own source files. If you want to do so, first create an SNL Project with the help of its wizard
SnlEditor/SNL_Create_Project.png
and import your files using the Import menu of the navigator
SnlEditor/SNL_Navigator_Import.png
followed by the selection of the Import Wizard
SnlEditor/SNL_Navigator_Import_from_File_System.png
and eventually chosing your files and the newly created project as the destination.
Editing
Now double click a file containing source code from the navigator. The editor will open. Positoning of the cursor is now reflected in the outline. You may navigate using the outline as well.
SnlEditor/SNL_Editor_And_Outline_With_Selection.png
Code Completion (triggered by Ctrl-Space as usual) helps in editing:
SnlEditor/SNL_Editor_Code_Completion.png
Problem View
Now let us have a look at the problem view. You may want to filter its output to stay focused:
SnlEditor/SNL_Problem_View_Filter.png
The problem view shows warnings or errors which can be determined through syntactical analysis. Update occurs after saving the source file. Double-clicking an entry in the problem view navigates to the location in the source file.
SnlEditor/SNL_Problem_View_Error.png
Editing history
Even though you are not connected to a source code repository, a limited amount of version management is available. Each time you save a file it is stored in the local history maintained by CSS. This is by no means a replacement for backup nor for a repository, just a hint for working in CSS.
SnlEditor/SNL_Editor_Show_History.png
The History View will open, giving you access to previous versions. For example, select the versions you want to compare and start a comparison:
SnlEditor/SNL_Editor_Select_For_Comparison.png
Now you can review your changes:
SnlEditor/SNL_Editor_Differ.png
The actual amount of source code which is stored in the local history is a matter of preferences.
Compilation (not yet available)
Finally your source code will be ready to be compiled. However, this is currently not supported (for non-DESY versions).
Documentation
Documentation for the State Notation Language is available from the Argonne National Laboratory at the EPICS Home http://www.aps.anl.gov/epics/