Introducing HDevelopEVOπ
The First Activity Bar is located on the left side of the window and gives you quick access to different views, such as the Explorer, Search, and Debug View. It is the core navigation surface. When clicking an item in the Activity Bar, the Primary Sidebar opens to the right where you can see and manage the contents of the corresponding Activity Bar item.
On the top is the Menu Bar.
In the Central Space you can find the Welcome Page which shows you several direct links like Open Folder > Open Example Folder when first starting up HDevelopEVO. It also is the space where your Editor tabs will be opened.
On the right is the Secondary Activity Bar, which acts just like the Activity Bar itself, and clicking it opens the Secondary Panel.
In the Graphics View your graphics will be displayed, it is also part of the secondary activity bar.
You can inspect your iconic variables in the Iconic Variables View, it is also part of the secondary activity bar.
The Bottom Panel shows the Output, Debug Console, and Problems.
The Status Bar is located at the bottom of the window and shows information about the file you are editing, used version of HALCON, and the workspace you have open.
Overviewπ
Preview Restrictions
As youβre using a preview version of HDevelopEVO, keep in mind that not all language features have been implemented yet:
par_start
and vectors have not been implemented yet.- Several details of the language may also still be incomplete, or are not 100% compatible with the previous behavior.
- Libraries and external procedures cannot be used yet.
- Several commands you may be familiar with from the old HDevelop have not been implemented yet.
Explorer and Editorπ
The editor displays the entire content of your loaded file, including the procedures. Procedures can be used directly in your editor. To simplify working with your code, weβve integrated code snippets into HDevelopEVO.
Tip
When youβre using more than one editor tab, you can use the split view to display the tabs side by side. This makes it easier to compare code, for example. To view your editor tabs in split view, simply drag the editors side by side.
Fileformat .hscriptπ
Before you open or load a new folder, you need to know that we use a new fileformat for HDevelopEVO.
It is called HALCON Script, .hscript, which means that βoldβ HDevelop .hdev files will only work in HDevelopEVO when their code content is copied and saved as a .hscript
file.
For information on migrating to HDevelopEVO, see Migrating to HDevelopEVO From HDevelop.
HSCRIPT is a simple plain text format, unlike the βoldβ .hdev files, which were an XML format. This makes it a lot easier to use in any editor you want.
Workspaceπ
A workspace is a virtual environment where you can organize and manage your development projects, in one session. It consists of a collection of one or more folders. By adding a folder, everything within the folder becomes part of your workspace. When a folder is loaded, the explorer activity bar shows the options resembling your folder contents.
If you want to do a backup or delete your settings, the settings folder is located at %APPDATA%\MVTEC\HDevelopEVO
or ~/.local/shared/MVTec/HDevelopEVO
.
If you have already worked with HDevelopEVO, you can also load your workspace by clicking Recent workspace.
Using Resources From Your Workspaceπ
When executing .hscript files, it may be necessary to load resources such as images or deep learning models from the workspace. To simplify this process, the current working directory is automatically set to the root folder of your workspace, ensuring smooth access to your resources.
Follow these steps:
-
Copy an image example.png into the root folder of the workspace. You can verify that the image was added by examining the explorer.
-
Add read_image
(Image, 'example.png')
to your script. The image will be loaded from the workspace.
When adding images to subfolders of the workspace, the subfolder needs to be specified in the operator, independently of where the HALCON Script file is located.
Note
Previously in HDevelop the current working directory always was set to the location of the .hdev-file. In HDevelopEVO it is set to location of the workspace.
Example Programsπ
A direct link on the welcome page opens up the example programs explorer. Additionally, you can find the examples under File > Open Example Folder. This folder will open up as a whole new separate workspace containing the examples.
Upon the initial launch of a workspace, the example explorer view is automatically displayed in the Activity Bar by default.
When HDevelopEVO is closed the workspace layout is stored, and it is reused when opening the example folder again. Then, the explorer may not be visible any more. To reset the workspace layout, use the command View: Reset Workbench Layout.
Opening a Folder and Creating a Fileπ
You can open a folder with an existing .hscript file, or you can create a new file:
- Click Open Folder, and then browse to the folder.
or
- Click Create New File, choose New HALCON Script File (.hscript), and save the new file.
Tip
You can open any file by its name with the shortcut Ctrl+P.
Procedure Syntaxπ
The general syntax of procedure is as follows.
A procedure must start with proc
and end with endproc
.
You can choose any proc_name
.
proc proc_name (object InputImage, tuple InputParam, out object OutputImage, out tuple OutputParam) #(1)!
...
endproc
- You can add zero to n parameters in your parameter list as long as they are separated by a comma.
Example
Your local procedures can always be used. For more information, see HSCRIPT File Format > Declaring and Calling Procedures.
Using Code Snippetsπ
To insert a control flow operators, start by typing in the code you want to use. The corresponding suggestion of a code snippet pops up and is marked by a icon. Select the entry or press Tab and it gets inserted into your code.
Example
If you want to add a for
loop in a script, type for
and select for
.
You can customize the inserted snippet as you need within your code.
Autocompletionπ
As soon as you start typing, the autocompletion is indicated by .
The HDevelopEVO autocompletion suggests code snippets, your previously defined variables, parameters, and operators.
Variables are indicated by a Note that the autocompletion always suggests possible completions depending on the scope of your procedures.
The suggestions for code snippets are shown with an at the beginning.
When operators are listed, they are indicated by . Further, a short help description of the corresponding operator is shown when an operator is selected. By pressing Ctrl+Space, you get a preview of the corresponding documentation of the operator.
The signature help for operators can be opened with Ctrl+Shift+Space.
Editing Codeπ
To edit all occurring code instances at once, set your cursor to the instance you want to change, press Ctrl+D, and type in your changes. Now all corresponding instances are changed in one go.
Line breaks no longer cause invalid lines, which means you can add line breaks as you see fit into your script.
Code wrapping allows you to selectively fold code blocks as parts of your code. This helps you to manage large amounts of code while viewing only those subsections that are currently of interest.
Command Paletteπ
The commands are available through the Command Palette. Open it by pressing Ctrl+Shift+P.
Alternatively, open the search bar with Ctrl+P and then type >
to search all available commands.
Shortcutsπ
HDevelopEVO has a rich set of default keyboard shortcuts. You can find an overview of the keyboard shortcuts by pressing Ctrl+Alt+,.
Outline Viewπ
The Outline view is a separate section at the left of the Explorer view. Choose the file on which you want to work and the outline view shows all procedures and variables used in the selected file. Selecting a listed procedure or variable will jump to and highlight the corresponding line in your code.
Menu Goπ
Assuming your script is pretty long, and you want to check the definition of your procedure or variable, which was defined in the beginning of your code you can use Go > Go to Definition in your Menu Bar or right-click Go to Definition to jump to the corresponding definition. The definition will be highlighted.
Tip
You can jump to the definition with Ctrl, and clicking on the parameter you want the definition for, or open the definition to the side with Ctrl+Alt and click.
Note that HALCON Script doesnβt support Go to type definition, declaration, implementation, and symbol separately, they will all act like Go to Definition.
Running and Debuggingπ
Note
To start debugging, a configuration has to be loaded. Loading a configuration is only possible when a project folder was opened beforehand.
Warning
You can only run a new program or use autocompletion if you have saved the HSCRIPT file before. If the file path of the document is already defined, it will be automatically be saved when the debugger starts.
Place the cursor on the corresponding code line and press F9, or click on the beginning of the line next to the line numbers, to set a breakpoint. With a breakpoint, you can pause the execution of your program at a specific line of code. A red dot appears in the left margin of the editor, indicating that a breakpoint is set.
To start debugging:
-
Open the Debug View by clicking in the First Activity Bar.
-
Choose Launch HALCON Script (HALCONEngine) as your configuration.
-
Choose your the HALCON Script File you want to debug.
-
Click the button.
-
You can now either click to execute the whole script until you hit a breakpoint, or you can click to execute line after line.
Itβs also possible to debug more than one file. To debug one file after another, just click through them in your thread view.
Variablesπ
To inspect variables, you have the following options:
-
When you expand the drop-down within the variables view, you can display all the parameters contained in the handles of your script. The control variables and the iconic variables are shown in a tree structure. By expanding it, you get more information about the variables.
-
Iconic variables will additionally be shown in the iconic variables view as thumbnails, and can also be inspected in the graphics window inside the graphics view.
-
Double-click an iconic variable in the variables view to display it in the graphics window. If not open already, the graphics window opens. Alternatively, you can right-click the variable and use the corresponding entry in the context menu.
Graphics Windowπ
HDevelopEVOβs graphics window behaves similarly to the one you may be used to from HDevelop.
Preview Restrictions
- β
dev_*
β operators are now executed via the engine directly, and visualization in the graphics windows of the IDE viadev_*
operators, such asdev_display
ordev_disp_text
, is not possible. - Instead, you can display the visualization in a native HALCON graphics window, which can be opened using
dev_open_window
.
A typical operator to visualize images in HDevelopEVO is read_image
.
While debugging your script step-by-step , the corresponding images can be displayed in the graphics window.
They can be viewed in the active graphics window automatically or by double-clicking each iconic variable in the iconic variables view.
By using the small toolbar within your graphics window, you can zoom into the images, move them around, fit them back to the screen, and clear the window.
Using Git Source Controlπ
HDevelopEVO has integrated source control management with Git.
Note
Make sure that Git is installed on your machine beforehand. For information on which version of Git you need, check your built-in extension.
When an existing Git repository is not detected, the Git Source Control view will give you the option to Initialize Repository. This creates the necessary Git repository metadata files and shows your workspace files as untracked changes ready to be staged.
When your repository is initialized, you can start working with Git. For more information on how to work with your repository, see VS Code Source Control Documentation .
More information on how to use the Git Source Control in HDevelopEVO will follow soon.