MoniTool
OCCT package MoniTool: MoniTool_AttrList, MoniTool_CaseData, MoniTool_DataInfo, MoniTool_Element, and 10 more bound classes.
MoniTool_AttrList
a AttrList allows to record a list of attributes as Transients which can be edited, changed ... Each one is identified by a name
Constructors(2)
Creates an AttrList, empty.
Creates an AttrList from another one, definitions are shared (calls SameAttributes).
Parameters (1)other
Instance methods(16)
- SetAttribute(name: string, val: Standard_Transient): void
Adds an attribute with a given name (replaces the former one with the same name if already exists).
Parameters (2)nameval
- RemoveAttribute(name: string): boolean
Removes an attribute Returns True when done, False if this attribute did not exist.
Parameters (1)name
- GetAttribute(name: string, type_: Standard_Type): { returnValue: boolean; val: Standard_Transient; [Symbol.dispose](): void }
Returns an attribute from its name, filtered by a type If no attribute has this name, or if it is not kind of this type, <val> is Null and returned value is False Else, it is True.
Parameters (2)nametype_
ReturnsA result object with fields:
returnValue: the C++ return valueval: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- Attribute(name: string): Standard_Transient
Returns an attribute from its name. Null Handle if not recorded (whatever Transient, Integer, Real ...) Integer is recorded as IntVal Real is recorded as RealVal Text is recorded as HAsciiString.
Parameters (1)name
- AttributeType(name: string): MoniTool_ValueType
Returns the type of an attribute: ValueInt, ValueReal, ValueText (String), ValueIdent (any) or ValueVoid (not recorded).
Parameters (1)name
- SetIntegerAttribute(name: string, val: number): void
Adds an integer value for an attribute.
Parameters (2)nameval
- GetIntegerAttribute(name: string, val: number): { returnValue: boolean; val: number }
Returns an attribute from its name, as integer If no attribute has this name, or not an integer, <val> is 0 and returned value is False Else, it is True.
Parameters (2)nameval
ReturnsA result object with fields:
returnValue: the C++ return valueval: updated value from the call.
- IntegerAttribute(name: string): number
Returns an integer attribute from its name. 0 if not recorded.
Parameters (1)name
- SetRealAttribute(name: string, val: number): void
Adds a real value for an attribute.
Parameters (2)nameval
- GetRealAttribute(name: string, val: number): { returnValue: boolean; val: number }
Returns an attribute from its name, as real If no attribute has this name, or not a real <val> is 0.0 and returned value is False Else, it is True.
Parameters (2)nameval
ReturnsA result object with fields:
returnValue: the C++ return valueval: updated value from the call.
- RealAttribute(name: string): number
Returns a real attribute from its name. 0.0 if not recorded.
Parameters (1)name
- SetStringAttribute(name: string, val: string): void
Adds a String value for an attribute.
Parameters (2)nameval
- StringAttribute(name: string): string
Returns a String attribute from its name. "" if not recorded.
Parameters (1)name
Returns the exhaustive list of attributes.
- SameAttributes(other: MoniTool_AttrList): void
Gets the list of attributes from <other>, as such, i.e. not copied : attributes are shared, any attribute edited, added, or removed in <other> is also in <me> and vice versa The former list of attributes of <me> is dropped.
Parameters (1)other
- GetAttributes(other: MoniTool_AttrList, fromname?: string, copied?: boolean): void
Gets the list of attributes from <other>, by copying it By default, considers all the attributes from <other> If <fromname> is given, considers only the attributes with name beginning by <fromname>.
For each attribute, if <copied> is True (D), its value is also copied if it is a basic type (Integer,Real,String), else it remains shared between <other> and <me>
These new attributes are added to the existing ones in <me>, in case of same name, they replace the existing onesParameters (3)otherfromnamecopied
MoniTool_CaseData
This class is intended to record data attached to a case to be exploited. Cases can be :
- internal, i.e. for immediate debug for instance, on an abnormal exception, fill a CaseData in a DB (see class DB) then look at its content by XSDRAW
- to record abnormal situation, which cause a warning or fail message, for instance during a transfer This will allow, firstly to build a more comprehensive message (with associated data), secondly to help seeing "what happened"
- to record data in order to fix a problem If a CASE is well defined and its fix is well known too, recording a CaseData which identifies the CASE will allow to furstherly call the appropriate fix routine
A CaseData is defined by - an optional CASE identifier If it is defined, this will allow systematic exploitation such as calling a fix routine
- an optional Check Status, Warning or Fail, else it is Info
- a NAME : it just allows to identify where this CaseData was created (help to debug)
- a LIST OF DATA
Each Data has a type (integer, real etc...) and can have a name Hence, each data may be identified by : - its absolute rank (from 1 to NbData)
- its name if it has one (exact matching)
- else, an interpreted identifier, which gives the type and the rank in the type (for instance, first integer; etc) (See NameRank)
Constructors(1)
- constructor(caseid?: string, name?: string): MoniTool_CaseData
Creates a CaseData with a CaseId and a Name (by default not defined).
Parameters (2)caseidname
Static methods(7)
- SetDefWarning(acode: string): void
Sets a Code to give a Warning.
Parameters (1)acode
- SetDefFail(acode: string): void
Sets a Code to give a Fail.
Parameters (1)acode
- DefCheck(acode: string): number
Returns Check Status for a Code : 0 non/info (default), 1 warning, 2 fail.
Remark : DefCheck is used to set the check status of a CaseData when it is attached to a case code, it can be changed later (by SetFail, SetWarning, ResetCheck)Parameters (1)acode
- SetDefMsg(casecode: string, mesdef: string): void
Attaches a message definition to a case code This definition includes the message code plus designation of items of the CaseData to be added to the message (this part not yet implemented).
Parameters (2)casecodemesdef
- DefMsg(casecode: string): string
Returns the message definition for a case code Empty if no message attached.
Parameters (1)casecode
- get_type_name(): string
Instance methods(42)
- SetCaseId(caseid: string): void
Sets a CaseId.
Parameters (1)caseid
- SetName(name: string): void
Sets a Name.
Parameters (1)name
- CaseId(): string
Returns the CaseId.
- Name(): string
Returns the Name.
- Name(nd: number): TCollection_AsciiString
Returns the name of a data. If it has no name, the string is empty (length = 0).
Parameters (1)nd
- IsCheck(): boolean
Tells if <me> is Check (Warning or Fail), else it is Info.
- IsWarning(): boolean
Tells if <me> is Warning.
- IsFail(): boolean
Tells if <me> is Fail.
- ResetCheck(): void
Resets Check Status, i.e. sets <me> as Info.
- SetWarning(): void
Sets <me> as Warning.
- SetFail(): void
Sets <me> as Fail.
- SetChange(): void
Sets the next Add... not to add but to change the data item designated by its name. If next Add... is not called with a name, SetChange is ignored Reset by next Add... , whatever <num> is correct or not.
- SetReplace(num: number): void
Sets the next Add... not to add but to replace the data item <num>, if <num> is between 1 and NbData. Reset by next Add... , whatever <num> is correct or not.
Parameters (1)num
- AddData(val: Standard_Transient, kind: number, name?: string): void
Unitary adding a data; rather internal.
Parameters (3)valkindname
- AddRaised(theException: Standard_Failure, name?: string): void
Adds the currently caught exception.
Parameters (2)theExceptionname
- AddShape(sh: TopoDS_Shape, name?: string): void
Adds a Shape (recorded as a HShape).
Parameters (2)shname
Adds a XYZ.
Parameters (2)aXYZname
Adds a XY.
Parameters (2)aXYname
- AddReal(val: number, name?: string): void
Adds a Real.
Parameters (2)valname
- AddReals(v1: number, v2: number, name?: string): void
Adds two reals (for instance, two parameters).
Parameters (3)v1v2name
- AddCPU(lastCPU: number, curCPU?: number, name?: string): void
Adds the CPU time between lastCPU and now if <curCPU> is given, the CPU amount is curCPU-lastCPU else it is currently measured CPU - lastCPU lastCPU has been read by call to GetCPU See GetCPU to get amount, and LargeCPU to test large amount.
Parameters (3)lastCPUcurCPUname
- GetCPU(): number
Returns the current amount of CPU This allows to laterly test and record CPU amount Its value has to be given to LargeCPU and AddCPU.
- LargeCPU(maxCPU: number, lastCPU: number, curCPU?: number): boolean
Tells if a CPU time amount is large <maxCPU> gives the amount over which an amount is large <lastCPU> gives the start CPU amount if <curCPU> is given, the tested CPU amount is curCPU-lastCPU else it is currently measured CPU - lastCPU.
Parameters (3)maxCPUlastCPUcurCPU
- AddGeom(geom: Standard_Transient, name?: string): void
Adds a Geometric as a Transient (Curve, Surface ...).
Parameters (2)geomname
- AddEntity(ent: Standard_Transient, name?: string): void
Adds a Transient, as an Entity from an InterfaceModel for instance : it will then be printed with the help of a DBPE.
Parameters (2)entname
- AddText(text: string, name?: string): void
Adds a Text (as HAsciiString).
Parameters (2)textname
- AddInteger(val: number, name?: string): void
Adds an Integer.
Parameters (2)valname
- AddAny(val: Standard_Transient, name?: string): void
Adds a Transient, with no more meaning.
Parameters (2)valname
- RemoveData(num: number): void
Removes a Data from its rank. Does nothing if out of range.
Parameters (1)num
- NbData(): number
Returns the count of data recorded to a set.
- Data(nd: number): Standard_Transient
Returns a data item (n0 <nd> in the set <num>).
Parameters (1)nd
- GetData(nd: number, type_: Standard_Type): { returnValue: boolean; val: Standard_Transient; [Symbol.dispose](): void }
Returns a data item, under control of a Type If the data item is kind of this type, it is returned in <val> and the returned value is True Else, <val> is unchanged and the returned value is False.
Parameters (2)ndtype_
ReturnsA result object with fields:
returnValue: the C++ return valueval: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- Kind(nd: number): number
Returns the kind of a data : KIND TYPE MEANING 0 ANY any (not one of the following) 1 EX raised exception 2 EN entity 3 G geom 4 SH shape 5 XYZ XYZ 6 XY or UV XY 7 RR 2 reals 8 R 1 real 9 CPU CPU (1 real) 10 T text 11 I integer.
For NameNum, these codes for TYPE must be given exact i.e. SH for a Shape, not S nor SHAPE nor SOLID etcParameters (1)nd
- NameNum(name: string): number
Returns the first suitable data rank for a given name Exact matching (exact case, no completion) is required Firstly checks the recorded names If not found, considers the name as follows : Name = "TYPE" : search for the first item with this TYPE Name = "TYPE:nn" : search for the nn.th item with this TYPE See allowed values in method Kind.
Parameters (1)name
- Shape(nd: number): TopoDS_Shape
Returns a data as a shape, Null if not a shape.
Parameters (1)nd
Returns a data as a XYZ (i.e.
Geom_CartesianPoint) Returns False if not the good type.Parameters (2)ndval—Mutated in place; read the updated value from this argument after the call.
Returns a data as a XY (i.e.
Geom2d_CartesianPoint) Returns False if not the good type.Parameters (2)ndval—Mutated in place; read the updated value from this argument after the call.
- Reals(nd: number, v1: number, v2: number): { returnValue: boolean; v1: number; v2: number }
Returns a couple of reals (stored in
Geom2d_CartesianPoint).Parameters (3)ndv1v2
ReturnsA result object with fields:
returnValue: the C++ return valuev1: updated value from the call.v2: updated value from the call.
- Real(nd: number, val: number): { returnValue: boolean; val: number }
Returns a real or CPU amount (stored in
Geom2d_CartesianPoint) (allows an Integer converted to a Real).Parameters (2)ndval
ReturnsA result object with fields:
returnValue: the C++ return valueval: updated value from the call.
- Integer(nd: number, val: number): { returnValue: boolean; val: number }
Returns an Integer.
Parameters (2)ndval
ReturnsA result object with fields:
returnValue: the C++ return valueval: updated value from the call.
- Msg(): Message_Msg
Returns a Msg from a CaseData : it is build from DefMsg, which gives the message code plus the designation of items of the CaseData to be added to the Msg Empty if no message attached.
Remains to be implemented
MoniTool_DataInfo
Gives information on an object Used as template to instantiate Elem, etc This class is for Transient.
Constructors(1)
Static methods(2)
- Type(ent: Standard_Transient): Standard_Type
Returns the Type attached to an object Here, the Dynamic Type of a Transient. Null Type if unknown.
Parameters (1)ent
- TypeName(ent: Standard_Transient): string
Returns Type Name (string) Allows to name type of non-handled objects.
Parameters (1)ent
MoniTool_Element
a Element allows to map any kind of object as a Key for a Map. This works by defining, for a Hash Code, that of the real Key, not of the Element which acts only as an intermediate. When a Map asks for the HashCode of a Element, this one returns the code it has determined at creation time
Static methods(2)
- get_type_name(): string
Instance methods(7)
- GetHashCode(): number
Returns the HashCode which has been stored by SetHashCode (remark that HashCode could be deferred then be defined by sub-classes, the result is the same).
- Equates(other: MoniTool_Element): boolean
Specific testof equality : to be defined by each sub-class, must be False if Elements have not the same true Type, else their contents must be compared.
Parameters (1)other
Returns the Type of the Value. By default, returns the DynamicType of <me>, but can be redefined.
- ValueTypeName(): string
Returns the name of the Type of the Value. Default is name of ValueType, unless it is for a non-handled object.
Returns (readonly) the Attribute List.
Returns (modifiable) the Attribute List.
MoniTool_IntVal
An Integer through a Handle (i.e. managed as TShared).
Constructors(1)
- constructor(val?: number): MoniTool_IntValParameters (1)
val
Static methods(2)
- get_type_name(): string
Instance methods(3)
MoniTool_RealVal
A Real through a Handle (i.e. managed as TShared).
Constructors(1)
- constructor(val?: number): MoniTool_RealValParameters (1)
val
Static methods(2)
- get_type_name(): string
Instance methods(3)
MoniTool_SignShape
Signs HShape according to its real content (type of Shape) Context is not used.
Constructors(1)
Static methods(2)
- get_type_name(): string
Instance methods(3)
- Name(): string
Returns "SHAPE".
- Text(ent: Standard_Transient, context: Standard_Transient): TCollection_AsciiString
Returns for a HShape, the string of its ShapeEnum The Model is absolutely useless (may be null).
Parameters (2)entcontext
MoniTool_SignText
Provides the basic service to get a text which identifies an object in a context It can be used for other classes (general signatures ...) It can also be used to build a message in which an object is to be identified.
Static methods(2)
- get_type_name(): string
Instance methods(4)
- Name(): string
Returns an identification of the Signature (a word), given at initialization time.
Gives a text as a signature for a transient object alone, i.e. without defined context. By default, calls Text with undefined context (Null Handle) and if empty, then returns DynamicType.
Parameters (1)ent
- Text(ent: Standard_Transient, context: Standard_Transient): TCollection_AsciiString
Gives a text as a signature for a transient object in a context If the context is senseless, it can be given as Null Handle empty result if nothing to give (at least the DynamicType could be sent ?).
Parameters (2)entcontext
MoniTool_Stat
This class manages Statistics to be queried asynchronously.
It is organized as a stack of counters, identified by their levels, from one to ... . Each one has a total account of items to be counted, a count of already passed items, plus a count of "current items". The counters of higher level play on these current items. For instance, if a counter has been opened for 100 items, 40 already passed, 20 current, its own percent is 40, but there is the contribution of higher level counters, rated for 20 % of this counter.
Hence, a counter is opened, items are added. Also items can be add for sub-counter (of higher level), they will be added definitively when the sub-counter will be closed. When the count has ended, this counter is closed, the counter of lower level cumulates it and goes on. As follows :
Way of use : Open(nbitems); Add(..) : direct adding Add(..) AddSub (nsub) : for sub-counter Open (nbsubs) : nbsubs for this sub-counter Add (..) Close : the sub-counter AddEnd() etc... Close : the starting counter
This means that a counter can be opened in a Stat, regardless to the already opened ones :: this will be cumulated
A Current Stat is available, but it is possible to have others
Constructors(2)
- constructor(title?: string): MoniTool_Stat
Creates a Stat form. At start, one default phase is defined, with one default step. Then, it suffises to start with a count of items (and cycles if several) then record items, to have a queryable report.
Parameters (1)title
- constructor(other: MoniTool_Stat): MoniTool_Stat
used when starting
Parameters (1)other
Static methods(1)
Instance methods(8)
- Open(nb?: number): number
Opens a new counter with a starting count of items.
Parameters (1)nb
- OpenMore(id: number, nb: number): void
Adds more items to be counted by Add... on current level.
Parameters (2)idnb
- Add(nb?: number): void
Directly adds items.
Parameters (1)nb
- AddSub(nb?: number): void
Declares a count of items to be added later. If a sub-counter is opened, its percentage multiplies this sub-count to compute the percent of current level.
Parameters (1)nb
- AddEnd(): void
Ends the AddSub and cumulates the sub-count to current level.
- Close(id: number): voidParameters (1)
id
- Level(): number
- Percent(fromlev?: number): numberParameters (1)
fromlev
MoniTool_Timer
Provides convenient service on global timers accessed by string name, mostly aimed for debugging purposes.
As an instance, envelopes the OSD_Timer to have it as Handle
As a tool, supports static dictionary of timers and provides static methods to easily access them
Constructors(1)
Create timer in empty state.
Static methods(9)
- Start(name: string): voidParameters (1)
name
- Stop(name: string): void
Inline methods to conveniently start/stop timer by name Shortcut to Timer(name)->Start/Stop().
Parameters (1)name
- Timer(name: string): MoniTool_Timer
Returns a timer from a dictionary by its name If timer not existed, creates a new one.
Parameters (1)name
- Dictionary(): any
Returns map of timers.
- ClearTimers(): void
Clears map of timers.
- ComputeAmendments(): void
Computes and remembers amendments for times to access, start, and stop of timer, and estimates second-order error measured by 10 nested timers.
- GetAmendments(Access: number, Internal: number, External: number, Error10: number): { Access: number; Internal: number; External: number; Error10: number }
The computed amendmens are returned (for information only).
Parameters (4)AccessInternalExternalError10
ReturnsA result object with fields:
Access: updated value from the call.Internal: updated value from the call.External: updated value from the call.Error10: updated value from the call.
- get_type_name(): string
Instance methods(7)
- Stop(): void
- Reset(): void
Start, Stop and reset the timer In addition to doing that to embedded
OSD_Timer, manage also counter of hits. - Count(): number
Return value of hits counter (count of Start/Stop pairs).
- IsRunning(): number
Returns value of nesting counter.
- CPU(): number
Return value of CPU time minus accumulated amendment.
- Amend(): number
Return value of accumulated amendment on CPU time.
MoniTool_TimerSentry
A tool to facilitate using MoniTool_Timer functionality by automatically ensuring consistency of start/stop actions.
When instance of TimerSentry is created, a timer with corresponding name is started When instance is deleted, timer stops
Constructors(2)
- constructor(cname: string): MoniTool_TimerSentry
Constructor creates an instance and runs the corresponding timer.
Parameters (1)cname
Constructor creates an instance and runs the corresponding timer.
Parameters (1)timer
Instance methods(2)
- Stop(): void
Manually stops the timer.
MoniTool_TransientElem
an TransientElem defines an Element for a specific input class its definition includes the value of the Key to be mapped, and the HashCoder associated to the class of the Key
Transient from Standard defines the class to be keyed MapTransientHasher from TColStd is the associated Hasher DataInfo from MoniTool is an additional class which helps to provide information on the value (template : see DataInfo)
Constructors(1)
Creates a TransientElem with a Value. This Value can then not be changed. It is used by the Hasher to compute the HashCode, which will then be stored for an immediate reading.
Parameters (1)akey
Static methods(2)
- get_type_name(): string
Instance methods(5)
Returns the contained value.
- Equates(other: MoniTool_Element): boolean
Specific testof equality : defined as False if <other> has not the same true Type, else contents are compared (by C++ operator ==).
Parameters (1)other
Returns the Type of the Value. By default, returns the DynamicType of <me>, but can be redefined.
- ValueTypeName(): string
Returns the name of the Type of the Value. Default is name of ValueType, unless it is for a non-handled object.
MoniTool_TypedValue
This class allows to dynamically manage .. typed values, i.e. values which have an alphanumeric expression, but with controls. Such as "must be an Integer" or "Enumerative Text" etc.
Hence, a TypedValue brings a specification (type + constraints if any) and a value. Its basic form is a string, it can be specified as integer or real or enumerative string, then queried as such. Its string content, which is a occ::handle<HAsciiString> can be shared by other data structures, hence gives a direct on line access to its value.
Constructors(2)
Creates a TypedValue from another one, by duplication.
Parameters (1)other
- constructor(name: string, type_?: MoniTool_ValueType, init?: string): MoniTool_TypedValue
Creates a TypedValue, with a name.
type gives the type of the parameter, default is free text Also available : Integer, Real, Enum, Entity (i.e. Object) More precise specifications, titles, can be given to the TypedValue once created
init gives an initial value. If it is not given, the TypedValue begins as "not set", its value is emptyParameters (3)nametype_init
Static methods(7)
- AddLib(tv: MoniTool_TypedValue, def?: string): boolean
Adds a TypedValue in the library. It is recorded then will be accessed by its Name Its Definition may be imposed, else it is computed as usual By default it will be accessed by its Definition (string) Returns True if done, False if tv is Null or brings no Definition or <def> not defined.
If a TypedValue was already recorded under this name, it is replacedParameters (2)tvdef
- Lib(def: string): MoniTool_TypedValue
Returns the TypedValue bound with a given Name Null Handle if none recorded Warning: it is the original, not duplicated.
Parameters (1)def
- FromLib(def: string): MoniTool_TypedValue
Returns a COPY of the TypedValue bound with a given Name Null Handle if none recorded.
Parameters (1)def
Returns the list of names of items of the Library of Types Library of TypedValue as Valued Parameters, accessed by parameter name for use by management of Static Parameters.
- StaticValue(name: string): MoniTool_TypedValue
Returns a static value from its name, null if unknown.
Parameters (1)name
- get_type_name(): string
Instance methods(44)
- Name(): string
Returns the name.
Returns the type of the value.
Returns the Definition By priority, the enforced one, else an automatic one, computed from the specification.
- SetDefinition(deftext: string): void
Enforces a Definition.
Parameters (1)deftext
- AddDef(initext: string): boolean
Completes the definition of a TypedValue by command <initext>, once created with its type Returns True if done, False if could not be interpreted <initext> may be : imin ival : minimum value for an integer imax ival : maximum value for an integer rmin rval : minimum value for a real rmax rval : maximum value for a real unit name : name of unit ematch i : enum from integer value i, match required enum i : enum from integer value i, match not required eval text : add an enumerative value (increments max by 1) eval ?? : add a non-authorised enum value (to be skipped) tmax l : maximum length for a text.
Parameters (1)initext
- SetLabel(label: string): void
Sets a label, which can then be displayed.
Parameters (1)label
- Label(): string
Returns the label, if set; else returns an empty string.
- SetMaxLength(max: number): void
Sets a maximum length for a text (active only for a free text).
Parameters (1)max
- MaxLength(): number
Returns the maximum length, 0 if not set.
- SetIntegerLimit(max: boolean, val: number): void
Sets an Integer limit (included) to <val>, the upper limit if <max> is True, the lower limit if <max> is False.
Parameters (2)maxval
- IntegerLimit(max: boolean, val: number): { returnValue: boolean; val: number }
Gives an Integer Limit (upper if <max> True, lower if <max> False). Returns True if this limit is defined, False else (in that case, gives the natural limit for Integer).
Parameters (2)maxval
ReturnsA result object with fields:
returnValue: the C++ return valueval: updated value from the call.
- SetRealLimit(max: boolean, val: number): void
Sets a Real limit (included) to <val>, the upper limit if <max> is True, the lower limit if <max> is False.
Parameters (2)maxval
- RealLimit(max: boolean, val: number): { returnValue: boolean; val: number }
Gives an Real Limit (upper if <max> True, lower if <max> False). Returns True if this limit is defined, False else (in that case, gives the natural limit for Real).
Parameters (2)maxval
ReturnsA result object with fields:
returnValue: the C++ return valueval: updated value from the call.
- SetUnitDef(def: string): void
Sets (Clears if <def> empty) a unit definition, as an equation of dimensions. TypedValue just records this definition, does not exploit it, to be done as required by user applications.
Parameters (1)def
- UnitDef(): string
Returns the recorded unit definition, empty if not set.
- StartEnum(start?: number, match?: boolean): void
For an enumeration, precises the starting value (default 0) and the match condition : if True (D), the string value must match the definition, else it may take another value : in that case, the Integer Value will be Start - 1. (empty value remains allowed).
Parameters (2)startmatch
- AddEnum(v1?: string, v2?: string, v3?: string, v4?: string, v5?: string, v6?: string, v7?: string, v8?: string, v9?: string, v10?: string): void
Adds enumerative definitions. For more than 10, several calls.
Parameters (10)v1v2v3v4v5v6v7v8v9v10
- AddEnumValue(val: string, num: number): void
Adds an enumeration definition, by its string and numeric values. If it is the first setting for this value, it is recorded as main value. Else, it is recognized as alternate string for this numeric value.
Parameters (2)valnum
- EnumDef(startcase: number, endcase: number, match: boolean): { returnValue: boolean; startcase: number; endcase: number; match: boolean }
Gives the Enum definitions : start value, end value, match status. Returns True for an Enum, False else.
Parameters (3)startcaseendcasematch
ReturnsA result object with fields:
returnValue: the C++ return valuestartcase: updated value from the call.endcase: updated value from the call.match: updated value from the call.
- EnumVal(num: number): string
Returns the value of an enumerative definition, from its rank Empty string if out of range or not an Enum.
Parameters (1)num
- EnumCase(val: string): number
Returns the case number which corresponds to a string value Works with main and additional values Returns (StartEnum - 1) if not OK, -1 if not an Enum.
Parameters (1)val
- SetObjectType(typ: Standard_Type): void
Sets type of which an Object TypedValue must be kind of Error for a TypedValue not an Object (Entity).
Parameters (1)typ
Returns the type of which an Object TypedValue must be kind of Default is
Standard_TransientNull for a TypedValue not an Object.- SetInterpret(func: ((arg0: MoniTool_TypedValue, arg1: TCollection_HAsciiString, arg2: boolean)): void
Sets a specific Interpret function.
Parameters (1)func
- HasInterpret(): boolean
Tells if a TypedValue has an Interpret.
- SetSatisfies(func: ((arg0: TCollection_HAsciiString), name: string): void
Sets a specific Satisfies function : it is added to the already defined criteria It must match the form : satisfies (val : HAsciiString) returns Boolean.
Parameters (2)funcname
- SatisfiesName(): string
Returns name of specific satisfy, empty string if none.
- IsSetValue(): boolean
Returns True if the value is set (not empty/not null object).
- CStringValue(): string
Returns the value, as a cstring. Empty if not set.
Returns the value, as a Handle (can then be shared) Null if not defined.
- Interpret(hval: TCollection_HAsciiString, native: boolean): TCollection_HAsciiString
Interprets a value. <native> True : returns a native value <native> False : returns a coded value If the Interpret function is set, calls it Else, for an Enum, Native returns the Text, Coded returns the number STANDARD RETURNS : = hval means no specific interpretation Null means senseless Can also be redefined.
Parameters (2)hvalnative
- Satisfies(hval: TCollection_HAsciiString): boolean
Returns True if a value statifies the specification (remark : does not apply to Entity : see ObjectType, for this type, the string is just a comment).
Parameters (1)hval
- ClearValue(): void
Clears the recorded Value : it is now unset.
- SetCStringValue(val: string): boolean
Changes the value. The new one must satisfy the specification Returns False (and did not set) if the new value does not satisfy the specification Can be redefined to be managed (in a subclass).
Parameters (1)val
- SetHStringValue(hval: TCollection_HAsciiString): boolean
Forces a new Handle for the Value It can be empty, else (if Type is not free Text), it must satisfy the specification. Not only the value is changed, but also the way it is shared Remark : for Type=Object, this value is not controlled, it can be set as a comment Returns False (and did not set) if the new value does not satisfy the specification Can be redefined to be managed (in a subclass).
Parameters (1)hval
- IntegerValue(): number
Returns the value as integer, i.e. : For type = Integer, the integer itself; 0 if not set For type = Enum, the designated rank (see Enum definition) StartEnum - 1 if not set or not in the definition Else, returns 0.
- SetIntegerValue(ival: number): boolean
Changes the value as an integer, only for Integer or Enum.
Parameters (1)ival
- RealValue(): number
Returns the value as real, for a Real type TypedValue Else, returns 0.
- SetRealValue(rval: number): boolean
Changes the value as a real, only for Real.
Parameters (1)rval
Returns the value as Transient Object, only for Object/Entity Remark that the "HString value" is IGNORED here Null if not set; remains to be casted.
- GetObjectValue(): { val: Standard_Transient; [Symbol.dispose](): void }
Same as ObjectValue, but avoids DownCast : the receiving variable is directly loaded. It is assumed that it complies with the definition of ObjectType ! Otherwise, big trouble.
ReturnsA result object with fields:
val: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- SetObjectValue(obj: Standard_Transient): boolean
Changes the value as Transient Object, only for Object/Entity Returns False if DynamicType does not satisfy ObjectType Can be redefined to be managed (in a subclass).
Parameters (1)obj
- ObjectTypeName(): string
Returns the type name of the ObjectValue, or an empty string if not set.