Cyclmotion Intelligent Technology Co., Ltd.
CNC Development Manual

首页>Support>CNC Development Manual

CNC Development Manual

How the three tabs on the Program page work

发布时间:2026-10-16 点击次数:1010

Download the bilingual offline manual (ZIP, 8.7 MB; original-resolution screenshots included)

Contents · 中文版

Open Program in the software. You will see three tabs: Toolpath Preview, File Management, and Machining Wizard. Clicking a tab changes the content below it.

This chapter explains this existing feature. By the end, you should be able to follow the page settings to the relevant script and explain what you clicked, which value changed, why a particular page appeared, and which file supplied its content.

You do not need to add parameters, buttons, or pages, or compile the software. The code below comes from the standard env. We will look at how the three pages switch, without going into file operations or the machining calculations inside the wizard.

1. Find the feature in the familiar interface

Click Program on the main screen. The next row contains the three tabs. Select Toolpath Preview first. The selected tab is light blue. Below it are the toolpath drawing area on the left, program text and G/M status on the right, and the machining file list underneath.

The standard Program page with Toolpath Preview selected and a circular pocket toolpath visible on the left

Click the screenshot to enlarge it. Full-resolution screenshots are included in the offline package.

Figure 1. Program → Toolpath Preview. The example file is circular-pocket.nc. The left area shows the circular toolpath from above; the right area shows the same file's program text, and the file appears in the list below. Line 10 is selected in blue, with its circle highlighted in alternating red and magenta. The red status label at the upper right reads Simulation. This is an offline preview; machine machining has not been started.

Next, click File Management. This tab turns light blue, and the area below changes to the drive and file lists. The coordinates and function buttons on the right, and the function keys at the bottom, stay in place.

The standard Program page with File Management selected

Click the screenshot to enlarge it. Full-resolution screenshots are included in the offline package.

Figure 2. Open Program, then select File Management in the next row. The programs-en folder belongs to the software copy used for these images. Your file folder may be different.

Now click Machining Wizard in the same row. The highlight moves to that tab, and the area below shows Cut Rectangle, Cut Circle, Carving Rectangle, and Carving Circle.

The standard Program page with Machining Wizard selected

Click the screenshot to enlarge it. Full-resolution screenshots are included in the offline package.

Figure 3. The page after clicking Machining Wizard. This chapter explains how the page appears; do not operate its Load File or Execute buttons for this exercise. The displayed dimensions and other values come from the existing configuration. They are not machining settings to enter for this lesson.

When comparing these images, focus on two changes: which tab is highlighted and which content area is visible below it. The existing configuration uses the same value to decide both.

Coordinates and values in the screenshots are examples. Follow the configuration of your software and machine.

2. Use one value to remember which page is selected

In a macro program, you may use a variable to record the current step. This page uses a similar method: #810 records the selected child page.

Value of #810 Selected tab Content to show
0 Toolpath Preview Toolpath preview area
1 File Management File management page
2 Machining Wizard Machining wizard page

When you click File Management, the first change is:

#810=1

When you click Machining Wizard, it is:

#810=2

Both assignments are already in the existing tab settings. The operator does not type them. The standard configuration assigns the meanings 0, 1, and 2 to these three pages.

There is another form that is easy to confuse with this: #810.permission. In this example, it records which main page is selected in the row above; for example, 0 means Program. The value #810 records which child page is selected under Program. They are different fields of the same parameter. Here, the configuration uses the permission field to select a main page; it does not represent the login role.

3. Find the files, then the names used inside the page

Open env in the software's working folder. This chapter mainly uses the following files:

File What to look for
env/dmec-app-black.ui The outer main interface, which loads the standard main interface content
env/maininterface/maininterface.ui The Program entry, the three tabs, and the areas where their content appears
env/file/filepage The script run when File Management is clicked
env/file/file.ui The layout of the file management page
env/program/advancedpage The script run when Machining Wizard is clicked
env/program/advanced.ui The layout of the machining wizard page
env/main Startup preparation of the page selection value and first-entry flags

A .ui file describes the page's controls, layout, and settings. Files such as filepage and advancedpage, which have no extension, are configuration scripts that you can read in a text editor.

If you open maininterface.ui in Qt Designer, find the following names in its object list. The objectName is the control's name inside the file, allowing a script to find that control precisely. The name shown on screen can be different.

Position on screen Name in the file (objectName)
Program entry label_39
Toolpath Preview tab label_44
File Management tab label_45
Machining Wizard tab label_46
Toolpath preview content area frame_17
File management content area fileFrame
Machining wizard content area advancedFrame

These tabs use QLabel label controls in the UI file. The configuration gives them click actions, so they work like buttons. The three content areas use QFrame. Think of a frame here as a reserved area of the page into which content can be placed.

Next, look mainly at the accessibleDescription property. This is its actual name in the editor. The system uses it to store settings such as what to display, what to do when clicked, and when the control should be visible. If you read the XML file directly, < and > are XML escapes. The code blocks below use the text as shown in the property editor.

4. Why clicking File Management runs that script

Find label_45. Its complete accessibleDescription is:

-T(#1100itemtitle6)
-A:(clickedEvent:/env/file/filepage[0](#810=1))
-C1(#810==1)
-C0(1)
-C(#929item5==1)
-V2
-D

Start with the second line. You do not need to memorize every setting at once:

-A:(clickedEvent:/env/file/filepage[0](#810=1))

This one setting combines three things:

Part Meaning in this example
clickedEvent Run the action when this tab is clicked
(#810=1) First record File Management as the selected child page
/env/file/filepage[0] Then call env/file/filepage; [0] selects the script execution channel

Here, /env/... is resolved from the software's working folder. [0] does not mean page 0. This click selects File Management, which is #810=1. Reading the assignment and the path together takes you from the interface to the script you need to examine.

The remaining lines control the text, highlight, and whether the entry is visible:

Existing setting What it does
-T(#1100itemtitle6) Gets the tab text from #1100.itemtitle[6]. The English language pack supplies File Management
-C1(#810==1) Uses appearance 1 when #810 is 1: the selected highlight shown in the images
-C0(1) Uses normal appearance 0 when the preceding selected condition is not met
-C(#929item5==1) and -V2 Uses the third condition to decide whether the entry is visible; it appears when the file management feature switch is 1
-D Continues checking and updating this control during operation, so its text and state follow parameter changes

The 2 in -V2 is a condition index, counted from 0. The three -C… lines above have indices 0, 1, and 2, in order. This number is not a page number either. Read the condition and the visibility setting that refers to it together.

The highlight colors themselves are not written in the script. frame_16, the area containing all three tabs, already defines appearances 0 and 1. Each tab only needs to state when to use each appearance.

5. Why the content changes when a tab is highlighted

In the same maininterface.ui, find fileFrame. Its settings are:

-T(811)
-C(#810==1)
-V0
-D

Look first at the last three lines. There is only one condition here, so its index is 0:

-C(#810==1)
-V0
-D

These lines mean: check #810==1; show this area when the condition is true, hide it when false, and keep updating during operation.

The other two content areas check #810==0 and #810==2. Changing #810 during normal page switching therefore shows one area and hides the other two.

Value after the click Why the tab is highlighted Why the content appears
#810=0 Toolpath Preview meets -C1(#810==0) The visibility condition of frame_17 is true
#810=1 File Management meets -C1(#810==1) The visibility condition of fileFrame is true
#810=2 Machining Wizard meets -C1(#810==2) The visibility condition of advancedFrame is true

The tab and its content area have separate settings, but both check the same page selection value. This keeps them in agreement. It describes the result after updating; it does not promise that every drawing operation happens at exactly the same instant.

Ordinary showing and hiding when switching pages does not reload the UI file. How, then, is the File Management page placed into fileFrame the first time? Continue with the script called by the click.

6. Understand the seven lines of filepage

The complete effective content of env/file/filepage is:

widgetFunc["disk","","",803]
IF#811.version==1GOTO1
#811.version=1
widgetFunc["dir",#802,"",802]
#811.itemdesc[0]="/env/file/file.ui"
widgetFunc["QFrame","fileFrame","refresh",""]
N1

If you know IF/GOTO, start with the condition on line 2: if this page has already been prepared, jump directly to N1; otherwise, prepare it once.

The first time you click the tab

Startup has set #811.version to 0. The first entry therefore continues through the following lines instead of jumping to N1.

Order Code Purpose in this example
1 widgetFunc["disk","","",803] Places available drive information in #803 for the drive list on the left
2 IF#811.version==1GOTO1 Checks whether the initial preparation has already been performed
3 #811.version=1 Sets an already-prepared flag
4 widgetFunc["dir",#802,"",802] Reads the folder specified by #802 and fills the file-list data in #802
5 #811.itemdesc[0]="/env/file/file.ui" Records which UI file this area should load
6 widgetFunc["QFrame","fileFrame","refresh",""] Finds the area named fileFrame and reloads its content according to its settings
7 N1 Provides the jump label; the file ends after this

widgetFunc[...] is how a configuration script calls existing interface functions. This example uses only three: list drives, list a folder, and load page content. You do not need to learn all of its commands first.

How the filename reaches the page

Read these three parts together:

fileFrame setting:       -T(811)
Script stores the path:  #811.itemdesc[0]="/env/file/file.ui"
Script requests loading: widgetFunc["QFrame","fileFrame","refresh",""]

-T(811) tells this area to find its content description in parameter 811. That parameter's .itemdesc[0] supplies the UI path. refresh then asks the software to load the page according to that description. The standard configuration has already prepared the required items in #811.

The last argument to refresh, "", is an empty string. The file path is stored in .itemdesc[0] on the preceding line. Do not assume that the fourth argument is a UI filename simply because the call has four arguments.

Also distinguish the tab's -T(#1100itemtitle6) from the area's -T(811). The former supplies text for a label; the latter identifies the content description parameter for a QFrame. Read the setting together with the type of control that uses it.

Leave the page, then come back

Now #811.version is 1. The script still updates the drive list first. At line 2 it jumps directly to N1, skipping the initial folder read, the UI path assignment, and refresh.

This explains the flag's purpose: switching a page makes existing content visible; first-entry preparation puts that content there. Loading it again on every switch would rebuild the page controls. The existing configuration avoids doing that.

Here, .version is a field used by the standard configuration to store a flag. It is not the software version number. The script sets it to 1 before loading the UI, so the value does not prove that loading succeeded. If a file is missing or its name is wrong, check the path and the file rather than relying on the flag alone.

7. What the other two pages share, and how they differ

Machining Wizard loads another UI in the same way

The click setting for Machining Wizard is:

-A:(clickedEvent:/env/program/advancedpage[0](#810=2))

It selects page 2, then runs advancedpage. The first four lines of that script are:

IF#812.version==1GOTO1
#812.version=1
#812.itemdesc[0]="/env/program/advanced.ui"
widgetFunc["QFrame","advancedFrame","refresh",""]

This is an excerpt from the start of the original file. Further wizard preparation and N1 follow it. Do not use these four lines as a complete replacement file.

Compare the two pages to see the shared method:

Decision File Management Machining Wizard
Which page to select #810=1 #810=2
Which area holds it fileFrame advancedFrame
Which parameter describes the UI -T(811) -T(812)
Where to store the UI filename #811.itemdesc[0] #812.itemdesc[0]
Which field records prior preparation #811.version #812.version

Inside the wizard, the value of #812 also selects the wizard category. Do not confuse that with selection among the three pages discussed here. These three pages are always selected by #810.

Toolpath Preview is already in the main UI

The click setting for Toolpath Preview is:

-A:(clickedEvent:/env/null[1](#810=0))

env/null is an existing empty script. This setting mainly uses the assignment attached to the click to return #810 to 0. The preview content is already in frame_17 inside maininterface.ui. Unlike the other two pages, it does not need a separate UI file to be read on first entry.

Again, [1] selects the script execution channel. It does not select page 1.

8. Why startup returns to Toolpath Preview

The following existing assignments can be found in env/main. They are grouped here by purpose:

#810.permission=0
#810=0

#811.version=0
#811.itemdesc[0]=""

#812.version=0
#812.itemdesc[0]=""

The first two lines select Program → Toolpath Preview. The remaining lines clear the first-entry flags and UI paths for the file and wizard pages.

The main interface therefore starts with the preview. When File Management or Machining Wizard is first opened, its own script supplies the path and loads its content. Hiding an area alone does not prevent the software from reading a UI path that is already set when the main interface is created. This is why startup clears the paths as well.

Switching from Program to another main page and then back is different. The env/programpage script called by the Program entry does not reset #810. Provided no other script changes the selection, the previously selected child page can remain selected. Language changes and parameter load or restore operations have their own reset handling. Preserving the selection across a page switch does not make it permanent storage.

9. Follow one click through the whole design

You can now explain a click on File Management in this order:

  1. In maininterface.ui, label_45 is the File Management entry.
  2. Its click setting first executes #810=1, then runs env/file/filepage.
  3. Because #810==1, the tab uses the highlighted appearance, fileFrame is shown, and the other two content areas are hidden.
  4. If #811.version is not yet 1, the script writes the UI path and asks fileFrame to load file.ui.
  5. On a later entry, it keeps the page already created and skips the initial preparation.

The existing design answers five questions: which value selects the page; how a click changes it; which area is shown; which file supplies the content; and when preparation is needed. Together, these explain the complete three-page design.

Check it in a software copy

Only switch tabs for this check. You do not need to run a machining program or change any files.

Action What to observe
Open Program and click File Management File Management is highlighted; drive and file lists appear
Click Machining Wizard Machining Wizard is highlighted; wizard categories, size inputs, and the MDI area appear
Click Toolpath Preview Both the highlight and content return to the preview
Click File Management again The file page returns; use the IF/GOTO condition to understand why initial preparation is skipped this time

You cannot determine from appearance alone whether the page was rebuilt. First use these operations to check the visible result, then read the script condition to understand the difference between the first and subsequent entries.

Where to look if the display is wrong

Symptom or misunderstanding What to check
File Management is missing Check the #929.item[5] condition on label_45; this existing feature switch controls the entry
The tab is highlighted but the wrong content appears Check that the tab and content area both test the same value of #810
The file page is empty Check fileFrame's -T(811), #811.itemdesc[0], whether the UI file exists, and whether the name in refresh is fileFrame
Assuming .version=1 means loading succeeded The script sets this field in advance; check the file and the actual page too
Treating [0] or -V2 as page numbers This example stores the page number in #810; the other numbers select a script channel and a condition
Assuming every page switch needs refresh Normal switching uses visibility conditions; the original design runs refresh when it needs to create the content

You can now trace these familiar clicks to the parameters, page settings, and scripts that make them work.

Next: Text, values and status · Reading guide

Copyright © 2018-2023 Cyclmotion Intelligent Technology Co., Ltd. All Rights Reserved.

在线咨询