CLData Viewer's main window
CLData viewer
CLData Viewer is a window program, specially designed by the SprutCAM developers for the purpose of debugging postprocessors. It allows to view the toolpath from the CAM project in the form of a list of CLData commands and their parameters. Right during debugging the code of a postprocessors in VS Code, CLData viewer tracks the output files in a real time. It allows to jump from command to line in the resulting output file and back. It supports CLData breakpoints, helps to create new postprocessors and edit their settings.
The main window of the CLData viewer contains the following items.
- Main menu. It contain the main actions you can do in the CLData viewer like opening the projects and postprocessors.
- CLData tab - the list with the CLData commands of the currently opened CAM system's project. Use popup menu to operate with projects and breakpoints on CLData commands.
- CLD command parameters panel shows the list of main parameters of the CLData command which is selected on the CLData tab. Using the popup menu of this panel, you can easily get the name of the parameter by which you can access it from the program code of the postprocessor.
- Postprocessors tab - the list of postprocessors opened in CLData viewer. Here, the postprocessor that was debugged last in VS Code is highlighted in bold. Use popup menu of this panel to perform actions on the postprocessors.
- Properties inspector shows the properties of the postprocessor which is selected on the postprocessors tab. Here you can define some values which will be the input for the postprocessor to generate the G-code output files. For example, it can be the name of the output file, program number, etc.
- Output file tab - shows the content of output file (G-code).
- Messages tab - displays a list of messages (errors, warnings, infos) that the postprocessor generates during work.
- Progress bar - shows the progress of the postprocessing (what percentage of the total number of CLData commands has already been handled).
Main menu
The main menu of CLData viewer looks like shown on the picture below.
- Open project... - allows to open the CAM system project (*.stc file) with a CLData which will be used to debug postprocessors. Standard file open dialog will be shown.
- Close project - closes the opened CAM system project.
- Reopen project - shows the list of recently loaded CAM system projects to open them quickly.
- Create new postprocessor - helps to create a new postprocessor based on the selected template.
- Open postprocessor dll.. - allows to open an existing postprocessor in the CLData viewer by choosing a *.dll file of this postprocessor. Standard file open dialog will be shown.
- Open postprocessor folder.. - allows to open an existing postprocessor in the CLData viewer by choosing a folder of this postprocessor. Standard folder open dialog will be shown.
- Save postprocessor as... - here you can save selected postprocessor with another name.
- Close postprocessor - removes the current selected postprocessor from the list of postprocessors opened in CLData viewer.
- Documentation - opens online documentation of postprocessing.
CLData tab
The CLData tab shows a tree with the CLData commands of the currently opened CAM system's project.
Top level items are so called "CLData files" which can represent technological operations of the CAM system or CLD-subroutines.
The nested nodes are CLData commands which represent a toolpath of each operation, calculated by the CAM system. The color of node denotes the command type. The current postprocessed command when debug is in progress shown in bold. Detailed list of parameters for the selected command is shown on a separate panel from the right of CLData list. Using the popup menu of this panel, you can easily get the name of the parameter by which you can access it from the program code of the postprocessor. Also you can copy to clipboard the value of any parameter.
Double click on a CLData command will show you the lines inside output file which were generated by this command.
There is a concept of so called "CLData breakpoints". By clicking on a gutter (free space from the left of CLData commands) next to the desired command you can activate a special kind of breakpoint. It will be shown as bold red point there. It means that the postprocessing should be paused before handling of this command and you can explore the process of program execution for this command more detailed. This works in conjunction with "Function breakpoint" feature of Visual Studio Code only. On the breakpoints panel ("Run and debug" tab) of Visual Studio Code you can add a new breakpoint and specify the name of function you want to stop on. Here you should specify the special function name "StopOnCLData". In this case the postprocessing system will go into the function with such name each time when it reaches the CLData command that is marked with a CLData breakpoint. Of course the program code of your postprocessor should have (override) the function with this name. By default any postprocessor already have it if you created it using standard templates.
The popup menu of CLData tab looks like this one.
- Expand all - expands all CLData nodes in the tree.
- Collapse all - collapses all CLData nodes in the tree.
- Clear breakpoints - deletes all CLData breakpoints from CLData viewer.
- Disable breakpoint - temporary deactivates CLData breakpoint on selected command until you enable it again.
- Open project... - allows to open the CAM system project (*.stc file) with a CLData which will be used to debug postprocessors. Standard file open dialog will be shown.
- Close project - closes the opened CAM system project.
- Reopen project - shows the list of recently loaded CAM system projects to open them quickly.
Postprocessors tab
The postprocessors tab allows you to view and edit parameters of several postprocessors opened in the CLData viewer. The left part shows the list of postprocessors, the right part shows an inspector with parameters of selected postprocessor. The postprocessor that was debugged last in Visual Studio Code is highlighted in bold in the list.
You should use popup menu to perform actions on the postprocessors.
- Edit registers - opens the window to edit the registers list of selected postprocessor.
- Edit postprocessor XML settings - opens the window to edit the list of settings of selected postprocessor.
- Reset postprocessor settings to default - restores default value for each parameter of selected postprocessor which is defined in "settings.xml" file of it. When you typing some values in inspector of properties (for example an output file name) it affects to the debug process only and is not saved inside the postprocessor itself. To change the default values use the window to edit the list of settings or edit the file manually.
- Reveal binary file in Windows explorer - opens the Windows explorer in the folder where the resulting binary *.dll file of the postprocessor is placed and selects it.
- Reveal source in Windows explorer - opens the Windows explorer in the folder where the source code Postprocessor.cs file of the postprocessor is placed and selects it.
- Copy postprocessor's dll path to clipboard - copies to clipboard the path to the resulting binary *.dll file of selected postprocessor.
- Launch postprocessor project in VSCode - starts the Visual Studio Code (or activates an existing window) and opens the folder of selected postprocessor in it. After that you can run and debug it. Or alternatively you can just double click on the postprocessor to do the same.
- Open postprocessor source in VSCode - starts the Visual Studio Code (or activates an existing window) and opens the source code file Postprocessor.cs of selected postprocessor in it as an auxiliary additional file tab exactly. It does not close the project currently opened in VS Code, so it will not allow you to run and debug this postprocessor (because you should open it as folder to be possible to debug), but you can view it. It can be useful when you want to compare source code of several postprocessors and copy it from one to another.
- Create new postprocessor - helps to create a new postprocessor based on the selected template.
- Open postprocessor dll.. - allows to open an existing postprocessor in the CLData viewer by choosing a *.dll file of this postprocessor. Standard file open dialog will be shown.
- Open postprocessor folder.. - allows to open an existing postprocessor in the CLData viewer by choosing a folder of this postprocessor. Standard folder open dialog will be shown.
- Save postprocessor as... - here you can save selected postprocessor with another name.
- Rename postprocessor - allows you to easily and safely rename the selected postprocessor.
- Close postprocessor - removes the current selected postprocessor from the list of postprocessors opened in CLData viewer.
Output files and messages tabs
These tabs can show you the results of work after the run of postprocessor in Visual Studio Code.
- Output file tab - shows the content of output file (G-code). There may be several file tabs if the postprocessor generates many files at the same time. It updates dynamically while postprocessor is running and debugging. Double click on a line in the file will show you the CLData command which generated this line.
- Messages tab - displays a list of messages (errors, warnings, infos) that the postprocessor generates during work.
The popup menu of this panel contains the following items.
- Reveal nc file in Windows explorer - opens the Windows explorer in the folder where the resulting output file is placed and selects it.
- Open nc file in VSCode - starts the Visual Studio Code (or activates an existing window) and opens the resulting output file in it as an auxiliary additional file tab. It does not close the project currently opened in VS Code.
- Copy file name to clipboard copies the name of selected file with full path to clipboard.