Class CommonFuncs
Common functions
Inheritance
Namespace: SprutCAMTech.SCPostprocessor
Assembly: SprutCAMTech.SCPostprocessor.dll
Syntax
public static class CommonFuncs : Object
Properties
InputBoxFactory
Externally assigning object that can create InputBox inctances. Do not use it directly, use InputBox() and CreateInputBox() methods instead.
Declaration
public static IInputBoxFactory InputBoxFactory { get; set; }
Property Value
Type | Description |
---|---|
IInputBoxFactory |
IsReverseInterpretation
Returns True if now we are in the Reverse interpretation mode (for example, automatic G-code generation for G-code based simulation)
Declaration
public static bool IsReverseInterpretation { get; }
Property Value
Type | Description |
---|---|
bool |
IsTestsMode
Returns True if now we are in the Tests running mode. In this mode we should prevent to ask user something or show message box.
Declaration
public static bool IsTestsMode { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
CreateInputBox()
Create empty InputBox window. For this window, you can:
- Set caption of window
- Create groups of parameters
- Create parameters
Declaration
public static IInputBox CreateInputBox()
Returns
Type | Description |
---|---|
IInputBox |
CurDate()
Get current local date
Declaration
public static string CurDate()
Returns
Type | Description |
---|---|
string | Current local date in the format: dd.MM.yyyy |
CurISODate()
Get current local date (ISO)
Declaration
public static string CurISODate()
Returns
Type | Description |
---|---|
string | Current local date in the format: yyyy-MM-ddTHH:mm:ss.fffZ |
CurTime()
Get current local time
Declaration
public static string CurTime()
Returns
Type | Description |
---|---|
string | Get current local time in the format: HH:mm:ss |
InputBox(string, ref bool, params bool[])
Create InputBox window with possible values for selection. If passed value is not in the list of possible values then adds it to the list.
Declaration
public static void InputBox(string caption, ref bool value, params bool[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Name of parameter. |
bool | value | Passed boolean parameter that takes the entered value from the window. |
bool[] | possibleValues | Passed possible boolean values for selection. The maximum number of values passed is 2, the rest are ignored. |
InputBox(string, ref bool)
Create InputBox window.
Declaration
public static void InputBox(string caption, ref bool value)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Name of parameter. |
bool | value | Passed boolean parameter that takes the entered value from the window. |
InputBox(string, ref double, params double[])
Create InputBox window with possible values for selection. If passed value is not in the list of possible values then adds it to the list.
Declaration
public static void InputBox(string caption, ref double value, params double[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Name of parameter. |
double | value | Passed double parameter that takes the entered value from the window. |
double[] | possibleValues | Passed possible double values for selection. |
InputBox(string, ref double)
Create InputBox window.
Declaration
public static void InputBox(string caption, ref double value)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Name of parameter. |
double | value | Passed double parameter that takes the entered value from the window. |
InputBox(string, ref int, params int[])
Create InputBox window with possible values for selection. If passed value is not in the list of possible values then adds it to the list.
Declaration
public static void InputBox(string caption, ref int value, params int[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Name of parameter. |
int | value | Passed integer parameter that takes the entered value from the window. |
int[] | possibleValues | Passed possible integer values for selection. |
InputBox(string, ref int)
Create InputBox window.
Declaration
public static void InputBox(string caption, ref int value)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Name of parameter. |
int | value | Passed integer parameter that takes the entered value from the window. |
InputBox(string, ref string, params string[])
Create InputBox window with possible values for selection. If passed value is not in the list of possible values then adds it to the list.
Declaration
public static void InputBox(string caption, ref string value, params string[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Name of parameter. |
string | value | Passed string parameter that takes the entered value from the window. |
string[] | possibleValues | Passed possible string values for selection. |
InputBox(string, ref string)
Create InputBox window
Declaration
public static void InputBox(string caption, ref string value)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Name of parameter. |
string | value | Passed string parameter that takes the entered value from the window. |
Num(string)
String to numeric converter
Declaration
public static InpNumber Num(string str)
Parameters
Type | Name | Description |
---|---|---|
string | str | The string to be converted |
Returns
Type | Description |
---|---|
InpNumber | Numeric value after conversion |
Print(params object?[])
Outputting passed values to the console
Declaration
public static void Print(params object?[] args)
Parameters
Type | Name | Description |
---|---|---|
object[] | args | Values to output |