KnowledgeInterfaces Interface CATIDesignTable
Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.
interface CATIDesignTable
Interface dedicated to design table management.
Role: It allows to drive parameters of CATIA Model with values taken from an Excel sheet or from a tabulated text file
A design table is a relation, thus it also implements CATICkeRelation.
The principle of use of this interface is the following:
Creation of a sheet (factory->CreateSheet()
)
Creation of a design table (factory->CreateDesignTable()
)
Attachment of the sheet in the design table (design->SetSheet(sheet)
)
Creation of associations between columns of the sheet and parameters of the model (design->AddAssociation("column", parameter)
)
Choice of a row as configuration of the design table (design->SetConfigurationRow(n)
)
This interface is mono implemented.
- See also:
-
Method Index
- o
ActivateSheetUpdateMessage(int)
- Activates the callback reacting to the source file modification.
- o
AddAssociation(CATUnicodeString&,CATICkeParm_var&)
- Adds an association between the column of name iColumnName and the parameter iParameter.
- o
AddRowWithParmValues(int)
- Adds a new row in the sheet with current values of associated parameters.
- o
Associations()
- Gets the list of associations between columns of the sheet defining the design table and the parameters driven by those columns.
- o
AutomaticAssociations(CATIParmPublisher_var&,CATIParmPublisher_var&,CATLISTV(CATBaseUnknown_var)*)
- Tries to associate automatically parameters and columns of same name.
- o
CellAsDouble(int,int)
- Returns a double containing cell value converted in MKS.
- o
CellWithColumnType(int,int)
- Returns a string containing cell string + column unit extension.
- o
ColumnNames()
- Returns the list of column names in the sheet.
- o
ColumnParameter(int,CATUnicodeString*)
- Gets the parameter associated with the column whose index is columnNb or whose name is iColumnName.
- o
ColumnSupposedType(int)
- Looks for the most adapted type for the column.
- o
ConfigurationParameter()
- Returns the configuration parameter.
- o
ConfigurationRow()
- Returns the configuration row index.
- o
DeactivateSheetUpdateMessage()
- Deactivates the callback reacting to the source file modification.
- o
GetConfigurationsFilter()
- This method allows to retrieve the expression that filters design table configurations.
- o
GetIconMaskName()
- This methods returns the icon mask depending on status of design table (synchronize, broken, etc.
- o
GetInvalidConfigurations(int)
- Allows to retrieve the configurations that are not valid according to design table filter.
- o
IsANumericalColumn(int)
- Indicates if the column is numerical or not.
- o
IsParamReadOnly(CATICkeParm_var&)
- This methods checks if the parameter is seen as read only (cell not empty, or containing ranges or default value) for the current configuration.
- o
ManageCycles(CATCke::Boolean)
- Checks that the design table doesn't generate cycles.
- o
ManageRelationsConflicts(CATCke::Boolean)
- Checks that no relations are in conflict with the design table (this mean, no relations valuate the parameters associated to the design table).
- o
ManageSheetModifications(CATCke::Boolean)
- Called when a subscriber receives modification notification.
- o
ParameterColumn(CATICkeParm_var&)
- Gets the index (1-based) of the column associated with the parameter.
- o
RemoveAssociation(CATUnicodeString&)
- Removes the association with column iColumnName.
- o
SetConfigurationsFilter(CATICkeRelationExp_var&)
- This method allows to specify the expression that allows to filter design table configurations.
- o
SetCurrentConfiguration(int)
- Modifies the configuration parameter (and by consequence all others) to the value of the row rowNb (rowNb has to be > 1).
- o
SetSheet(CATICkeSheet_var&)
- Sets the associated sheet.
- o
Sheet()
- Returns the associated sheet.
Enumerated Type Index
- o
DTError
- Errors produced by Design table.
Methods
o ActivateSheetUpdateMessage
public virtual ActivateSheetUpdateMessage( | | iMode | = 0) |
-
Activates the callback reacting to the source file modification. When this callback is raised.
the design table is synchronized. If source data is copied into model, the synchronization
is optionnal
- Parameters:
-
- iMode
- 0 : Message and update if the design table data isn't embedded, Question and eventually update
if the design table data is embedded
1 : Update
2 : No update
o AddAssociation
public virtual AddAssociation( | const | iColumnName, |
| const | iParameter) |
-
Adds an association between the column of name iColumnName and the parameter iParameter.
- Returns:
- CATNoError if the method succeeds. If the method fails, it can return CATColumnAlreadyAssociated if the column is already associated, CATParameterAlreadyAssociated if the parameter is already associated, CATColumnDoesntExist if the column doesn't exist, CATNotAMagnitude if the
parameter isn't typed and the column has a unit extension, CATBadCellType if a cell of the sheet doesn't fit parameter's type and CATBadColumnType
if a cell of the sheet doesn't fit parameter's type
- Parameters:
-
- iColumnName
- the name of the column (without the column's type if there is one)
- iParameter
- the parameter to be associated
o AddRowWithParmValues
public virtual AddRowWithParmValues( | const | withUpdate | = 1) |
-
Adds a new row in the sheet with current values of associated parameters.
##### Since V5R14 #####
If the file contains at least one empty row between two not empty rows,
the behavior of this method is the same for Excel and Text files :
=> the new row containing the current parameters values replaces the first
empty row found from the beginning of the file.
RQ : before R14, for text files, the new row was appended at the end of the file.
The empty rows were never filed by this way, so that the new row was not
visible in Design Table dialog.
######################
- Parameters:
-
- withUpdate
- if == 0, don't call the sheet update (that reads the file) -> for optimization purpose
- Returns:
- CATCke::True if the method succeeds, CATCke::False else
o Associations
public virtual Associations( | ) |
-
Gets the list of associations between columns of the sheet defining the design table and the parameters driven by those columns.
The first string is associated with the first out-parameter, and so on
- Returns:
- the list of associations
o AutomaticAssociations
public virtual AutomaticAssociations( | const | iRoot, |
| const | iFeature, |
| const | iParameters) |
-
Tries to associate automatically parameters and columns of same name.
- Parameters:
-
- iRoot
- the root from which the naming has to begin
- iFeature
- if not NULL, the feature where parameters are searched.
- iParameters
- if first argument is NULL, use this list of parameters to
look for potential associations
- Returns:
- the number of associations created
o CellAsDouble
public virtual CellAsDouble( | const | iRow, |
| const | iColumn) |
-
Returns a double containing cell value converted in MKS.
If cell isn't numerical, returns 0
- Parameters:
-
- iRow
- index of the row of the cell
- iColumn
- index of the column of the cell
- Returns:
- double value computed
o CellWithColumnType
public virtual CellWithColumnType( | const | iRow, |
| const | iColumn) |
-
Returns a string containing cell string + column unit extension.
if the cell string don't have an type extension and the column has one
- Parameters:
-
- iRow
- index of the row of the cell
- iColumn
- index of the column of the cell
- Returns:
- string computed
o ColumnNames
public virtual ColumnNames( | ) |
-
Returns the list of column names in the sheet.
o ColumnParameter
public virtual ColumnParameter( | | iColumnNb, |
| | iColumnName | = NULL ) |
-
Gets the parameter associated with the column whose index is columnNb or whose name is iColumnName.
- Returns:
- NULL_var if the column doesn't exist or isn't associated
- Parameters:
-
- iColumnNb
- the index of the column. If it is equal to 0, this method uses the second argument
- iColumnName
- a pointer on the name of the column (can be NULL if columnNb <> 0
o ColumnSupposedType
public virtual ColumnSupposedType( | const | iColumn) |
-
Looks for the most adapted type for the column.
- Returns:
- StringType if no other type is found.
Returns NULL_var if argument column isn't good
- Parameters:
-
- iColumn
- the column whose type is to search
o ConfigurationParameter
public virtual ConfigurationParameter( | ) |
-
Returns the configuration parameter.
o ConfigurationRow
public virtual ConfigurationRow( | ) |
-
Returns the configuration row index.
o DeactivateSheetUpdateMessage
public virtual DeactivateSheetUpdateMessage( | ) |
-
Deactivates the callback reacting to the source file modification.
o GetConfigurationsFilter
public virtual GetConfigurationsFilter( | ) |
-
This method allows to retrieve the expression that filters design table configurations.
Role: returns the design table configurations filter
- Returns:
- the relation used to filter the available configurations.
It is a "check" involving associated parameters. For a given configuration,
if its result is False, the configuration is invalid.
o GetIconMaskName
public virtual GetIconMaskName( | ) |
-
This methods returns the icon mask depending on status of design table (synchronize, broken, etc....
- Returns:
- icon mask name
o GetInvalidConfigurations
public virtual GetInvalidConfigurations( | const | iForceUpdate | = 0) |
-
Allows to retrieve the configurations that are not valid according to design table filter.
Role: returns the list of invalid configurations according to design table filter
- Parameters:
-
- iForceUpdate
- says if this list has to be updated (if value is not 0) or not. 0 is advised.
- Returns:
- the list of invalid configurations. This list is index 1-based : the first configuration has index 1.
o IsANumericalColumn
public virtual IsANumericalColumn( | const | iColumn) |
-
Indicates if the column is numerical or not.
- Returns:
- a boolean saying if the column is numerical or not. (numerical means that all rows except the first one contains numerical
values optionnaly with unit extension)
- Parameters:
-
- iColumn
- the index of the column
o IsParamReadOnly
public virtual IsParamReadOnly( | const | parm) |
-
This methods checks if the parameter is seen as read only (cell not empty, or containing ranges or default value) for the current configuration.
- Parameters:
-
- parm
- parameter to check.
- Returns:
- result of the test
o ManageCycles
public virtual ManageCycles( | const | iWithMessage) |
-
Checks that the design table doesn't generate cycles.
- Returns:
- CATCke::True if the activation of the design table doesn't generate cycles, CATCke::False else
- Parameters:
-
- iWithMessage
- Set this parameter to True if you want a message saying there is a cycle
o ManageRelationsConflicts
public virtual ManageRelationsConflicts( | const | iWithMessage) |
-
Checks that no relations are in conflict with the design table (this mean, no relations valuate the parameters associated to the design table).
- Returns:
- False if the design table has to be not activated
- Parameters:
-
- iWithMessage
- This boolean says if the method has to send a question about removing association or deactivating conflicting relations to screen, or to take default actions (not to activate the design table)
o ManageSheetModifications
public virtual ManageSheetModifications( | const | iInteractively | = 0) |
-
Called when a subscriber receives modification notification.
from the sheet imbed in the design table.
It parses the new sheet, updates column names, update associations
- Returns:
- CATParseSheetError if the sheet could'nt be parsed, CATColumnNamesNotUnique if two or more columns have the same name, CATNoError else
- Parameters:
-
- iInteractively
- informs if the caller wants messages and questions, or default operations
o ParameterColumn
public virtual ParameterColumn( | const | iParameter) |
-
Gets the index (1-based) of the column associated with the parameter.
- Returns:
- 0 if the column isn't associated (or doesn't exist)
- Parameters:
-
- iParameter
- the parameter
o RemoveAssociation
public virtual RemoveAssociation( | const | iColumnName) |
-
Removes the association with column iColumnName.
- Returns:
- CATCke::True if the method succeeds, CATCke::False else
- Parameters:
-
- iColumnName
- The name of the column in the association
o SetConfigurationsFilter
public virtual SetConfigurationsFilter( | const | filter) |
-
This method allows to specify the expression that allows to filter design table configurations.
This filter has to be a KnowledgeAdvisor check. If check result is False for a given configuration, the configuration is not valid.
Role: Allows the caller to set the configurations filter
- Parameters:
-
- filter
- the relation that will be used to filter the available configurations.
It has to be a "check" involving associated parameters. For a given configuration,
if its result is False, the configuration is invalid.
o SetCurrentConfiguration
public virtual SetCurrentConfiguration( | const | iRowNb) |
-
Modifies the configuration parameter (and by consequence all others) to the value of the row rowNb (rowNb has to be > 1).
- Returns:
- NoError if the configuration row is valid, otherwise BadConfiguration.
- Parameters:
-
- iRowNb
- the row choosen as configuration (has to be > 1 and <= to the number of rows in the design table, the column names row excluded)
o SetSheet
public virtual SetSheet( | const | sheet) |
-
Sets the associated sheet.
- Parameters:
-
- sheet
- the sheet defining the content of the design table
o Sheet
-
Returns the associated sheet.
Enumerated Types
o DTError
-
enum DTError {
NoError,
ColumnNamesNotUnique,
BadCellType,
BadColumnType,
NotAMagnitude,
BadConfiguration,
ParseSheetError,
ParameterAlreadyAssociated,
ColumnAlreadyAssociated,
ColumnDoesntExist,
MiscellaneousError
}
Errors produced by Design table.
- Parameters:
-
- NoError
- is returned by methods if no error occured.
- NotAMagnitude
- is returned by
or
if given parameter has no magnitude and if the associated column has one in column title.
- BadCellType
- is returned by
or
if the type of one of the cell of the column isn't compliant with associated parameter.
- BadColumnType
- is returned if the unit extension in column use a unit that doesn't exist.
- BadConfiguration
- is returned by
is the given integer in less than 0 and greater than the number of configurations in the sheet.
- ParseSheetError
- is returned by
when the parse operation of the sheet failed.
- ParameterAlreadyAssociated
- is returned by
or
if the given parameter is already associated.
- ColumnAlreadyAssociated
- is returned by
or
if the given column is already associated.
- ColumnDoesntExist
- is returned by
or
if the given column doesn't exist.
- MiscellaneousError
- is returned by methods when other errors are encountered.
This object is included in the file: CATIDesignTable.h
If needed, your Imakefile.mk should include the module: KnowledgeItf
Copyright © 1999-2015, Dassault Systèmes. All rights reserved.