ZOSAPI.Tools.ISystemTool Interface Reference
Last update: 17.07.2025Base interface for all system tools. See IOpticalSystemTools for access to specific tools. More...

Public Member Functions | |
| bool | Run () |
| Start the tool. Note that for synchronous tools (see IsAsynchronous), this call will block until completion. If it is asynchronous it will start running but return immediately. | |
| bool | RunAndWaitForCompletion () |
| Sames as calling Run followed by WaitForCompletion. | |
| bool | WaitForCompletion () |
| Waits for the asynchronous tool to complete. | |
| bool | Cancel () |
| Cancels the currently running asynchronous tool. | |
| bool | Close () |
| Closes this tool and frees up and associated resources. | |
| RunStatus | WaitWithTimeout (double timeOutSeconds) |
| Waits for the currently running tool to complete, with a specified time out value. Note that if the timeout is exceeded this method will return, however the tool will continue to run. Also note that this method will not start the tool running if it is not already. | |
| RunStatus | RunAndWaitWithTimeout (double timeOutSeconds) |
| Starts the tool running, and waits for it to complete with the specified timeout value. Note that if the timeout is exceeded this method will return, however the tool will continue to run. | |
Properties | |
| int | Progress [get] |
| Gets the progress of the current tool, if supported. | |
| string | Status [get] |
| Gets the status of the current tool, if supporoted. | |
| bool | IsRunning [get] |
| Gets a value indicating whether the tool is currently running asynchronously. | |
| bool | CanCancel [get] |
| Gets a value indicating whether the tool can be cancelled. | |
| bool | IsAsynchronous [get] |
| Gets a value indicating whether the tool runs asynchronously (i.e. on a thread). | |
| bool | IsFiniteDuration [get] |
| Gets a value indicating whether this tool will complete on its own. | |
| bool | IsValid [get] |
| Gets a value indicating whether the input settings are valid. | |
| bool | Succeeded [get] |
| Gets a value indicating whether the tool execution succeeded. | |
| string | ErrorMessage [get] |
If Succeeded is false, get the error messages; otherwise, null. | |
Detailed Description
Base interface for all system tools. See IOpticalSystemTools for access to specific tools.
Member Function Documentation
◆ Cancel()
| bool ZOSAPI.Tools.ISystemTool.Cancel | ( | ) |
Cancels the currently running asynchronous tool.
Usage (see Example 03 for a full sample)
C#
C++
Matlab
Python
- Returns
trueif the tool is asynchronous and is currently running; otherwise,false
◆ Close()
| bool ZOSAPI.Tools.ISystemTool.Close | ( | ) |
Closes this tool and frees up and associated resources.
Usage (see Example 15 for a full sample)
C#
C++
Matlab
Python
- Returns
trueif the tool is not currently running; otherwise,false.
- Examples
- CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_02_NSC_ray_trace.cs, CSharpStandalone_03_open_file_and_optimise.cs, CSharpStandalone_05_Read_ZRD_File.cs, CSharpStandalone_06_nsc_phase.cs, CSharpStandalone_07_TiltDecenterAndMFOperand.cs, CSharpStandalone_10_NSC_ZRD_filter_string.cs, CSharpStandalone_11_Basic_Seq.cs, CSharpStandalone_14_Seq_Tolerance.cs, CSharpStandalone_15_Seq_Optimization.cs, CSharpStandalone_17_NSC_BulkScatter.cs, CSharpStandalone_20_export_CAD_File.cs, CSharpStandalone_21_White_LED_Phosphor.cs, CSharpStandalone_24_nsc_detectors.cs, and CSharpStandalone_25_source_spectrum_diffraction_grating.cs.
◆ Run()
| bool ZOSAPI.Tools.ISystemTool.Run | ( | ) |
Start the tool. Note that for synchronous tools (see IsAsynchronous), this call will block until completion. If it is asynchronous it will start running but return immediately.
Usage (see Example 20 for a full sample)
C#
C++
Matlab
Python
- Returns
trueif the tool successfully started (and, for synchronous tools, completed); otherwise,false.Note that if the tool is already running this will return
false
.
◆ RunAndWaitForCompletion()
| bool ZOSAPI.Tools.ISystemTool.RunAndWaitForCompletion | ( | ) |
Sames as calling Run followed by WaitForCompletion.
Usage (see Example 15 for a full sample)
C#
C++
Matlab
Python
- Returns
trueif the call to Run succeeded, IsAsynchronous istrue, and IsFiniteDuration isfalse; otherwise,false
- Examples
- CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_02_NSC_ray_trace.cs, CSharpStandalone_03_open_file_and_optimise.cs, CSharpStandalone_05_Read_ZRD_File.cs, CSharpStandalone_06_nsc_phase.cs, CSharpStandalone_07_TiltDecenterAndMFOperand.cs, CSharpStandalone_10_NSC_ZRD_filter_string.cs, CSharpStandalone_11_Basic_Seq.cs, CSharpStandalone_14_Seq_Tolerance.cs, CSharpStandalone_15_Seq_Optimization.cs, CSharpStandalone_17_NSC_BulkScatter.cs, CSharpStandalone_18_SetMulticonfiguration.cs, CSharpStandalone_22_seq_spot_diagram.cs, CSharpStandalone_23_ray_fan_native_manual_comparison.cs, CSharpStandalone_24_nsc_detectors.cs, and CSharpStandalone_25_source_spectrum_diffraction_grating.cs.
◆ RunAndWaitWithTimeout()
| RunStatus ZOSAPI.Tools.ISystemTool.RunAndWaitWithTimeout | ( | double | timeOutSeconds | ) |
Starts the tool running, and waits for it to complete with the specified timeout value. Note that if the timeout is exceeded this method will return, however the tool will continue to run.
- Parameters
-
timeOutSeconds The time out value (seconds). Note that this value must be greater than zero, else a RunStatus.InvalidTimeout value will be returned.
- Returns
- A RunStatus value indicating the tool state.///
◆ WaitForCompletion()
| bool ZOSAPI.Tools.ISystemTool.WaitForCompletion | ( | ) |
Waits for the asynchronous tool to complete.
- Returns
trueif the tool is running, it is asynchronous, and it has a finite run duration; otherwise, false.
◆ WaitWithTimeout()
| RunStatus ZOSAPI.Tools.ISystemTool.WaitWithTimeout | ( | double | timeOutSeconds | ) |
Waits for the currently running tool to complete, with a specified time out value. Note that if the timeout is exceeded this method will return, however the tool will continue to run. Also note that this method will not start the tool running if it is not already.
- Parameters
-
timeOutSeconds The time out value (seconds). Note that this value must be greater than zero, else a RunStatus.InvalidTimeout value will be returned.
- Returns
- A RunStatus value indicating the tool state.///
Property Documentation
◆ CanCancel
|
get |
Gets a value indicating whether the tool can be cancelled.
true if this tool is asynchronous and can be cancelled; otherwise, false.
◆ ErrorMessage
|
get |
If Succeeded is false, get the error messages; otherwise, null.
The error message.
- Examples
- CSharpStandalone_05_Read_ZRD_File.cs.
◆ IsAsynchronous
|
get |
Gets a value indicating whether the tool runs asynchronously (i.e. on a thread).
true if this the tool is asynchronous; otherwise, false.
◆ IsFiniteDuration
|
get |
Gets a value indicating whether this tool will complete on its own.
true if the tool is synchronous, or if it is asynchronous and will terminate on its own; otherwise, false.
◆ IsRunning
|
get |
Gets a value indicating whether the tool is currently running asynchronously.
true if the tool is currently running; otherwise, false.
◆ IsValid
|
get |
Gets a value indicating whether the input settings are valid.
true if the settings are valid; otherwise, false.
◆ Progress
|
get |
Gets the progress of the current tool, if supported.
The progress (0-100)
◆ Status
|
get |
Gets the status of the current tool, if supporoted.
The status message;
◆ Succeeded
|
get |
Gets a value indicating whether the tool execution succeeded.
true if the last execution of the tool succeeded; otherwise, false.
- Examples
- CSharpStandalone_05_Read_ZRD_File.cs.