The project loader mode type
To create a mode of this type, use the pw::Application.begin command with the mode ProjectLoader specified, like this:
set loader [pw::Application begin ProjectLoader]
pw:: | The project loader mode type |
Instance Attributes | |
AppendMode | This attribute controls whether the data being loaded is treated as an append or a replace. |
EnvironmentMode | This attribute controls whether the load is environment only. |
RepairMode | This attribute controls how connectors with grid points that are out of sync with their distribution functions are loaded. |
RulesOption | This attribute controls how rules are processed by load. |
Instance Actions | |
initialize | This action initializes the mode with the file name. |
getFileInformation | This action initializes returns information about the file after the mode has been initialized with the file name. |
checkForMissingReferences | This action checks to see if the file has any missing references. |
checkForDuplicateEntities | This action checks for duplicate entities. |
checkForDuplicateRules | This action checks for duplicate rules. |
checkCAEUnsupportedEntities | This action checks for the number of unsupported entities that will be ignored or deleted if the file is loaded. |
load | This action loads the entities and settings from the native file. |
getError | This action reports the last I/O error detected when processing the file. |
getRepairConnectors | This action returns the connectors that have grid points that are out of sync with their distribution functions when the RepairMode attribute is set to Defer. |
repair | This action will repair the distributions of the out of sync connectors when the RepairMode attribute is set to Defer. |
$loader get/setAppendMode append
This attribute controls whether the data being loaded is treated as an append or a replace.
This attribute is a boolean, with true meaning that the load is an append.
The default value for this attribute is true.
Grid and database data existing prior to this load will not be changed. The AppendMode only controls how the data being loaded is treated. If you want the existing grid data to be cleared, you must call first pw::Application.reset.
If set to true, the current CAE solver is not changed. If the solver in the file is different from the current solver, all BCs and VCs loaded from the file will have their physical types set to Unspecified. The BCs and VCs that existed prior to the load, will retain their physical types.
If set to false, the current CAE solver is changed to the one specified in the file being loaded. If the solver in the file is different from the current solver, all existing BCs and VCs will have their physical types set to Unspecified. The BCs and VCs loaded from the file will retain their physical types.
pw::Application load -ignoreCAESolver
Code
# Clear out all existing data pw::Application reset # Loads all data in $pwFile1 and sets the CAE solver as specified in $pwFile1 set loader1 [pw::Application begin ProjectLoader] $loader1 initialize $pwFile1 $loader2 AppendMode false $loader1 load $loader1 end unset loader1 # Merges all the data in $pwFile2 without changing the CAE solver set loader2 [pw::Application begin ProjectLoader] $loader2 initialize $pwFile2 $loader2 load $loader2 end unset loader2
$loader get/setEnvironmentMode environment
This attribute controls whether the load is environment only.
This attribute is a boolean, with true meaning that the load is environment only.
The default value for this attribute is false.
None
$loader get/setRepairMode mode
This attribute controls how connectors with grid points that are out of sync with their distribution functions are loaded.
This attribute is a string, with valid values being < KeepGridPoints | KeepDistributions | Defer >.
The default value for this attribute is KeepGridPoints.
If set to Defer, then after the load action completes, the getRepairConnectors action can be called to get the connectors that need to be repaired and the repair action can be called to repair the connectors.
$loader get/setRulesOption option
This attribute controls how rules are processed by load.
This attribute is a string, that is one of <KeepOld|KeepNew|KeepBoth>.
The default value for this attribute is KeepOld.
If option is KeepOld, the rules in the file are discarded.
If option is KeepNew, the rules in the file replace the existing rules.
If option is KeepBoth, both sets of rules are merged which may lead to conflicting or duplicate rules that will have to be sorted out manually.
If there are no rules in the current project, then the KeepNew option is used regardless of the specified option.
$loader getFileInformation option
This action initializes returns information about the file after the mode has been initialized with the file name.
option | This parameter specifies which information to return. The valid options are: Description, ProgramVersion, FileVersion, SystemName, SystemBitness and SystemEndianess. |
This action returns a different value based on the option parameter:
None.
$loader checkForMissingReferences
This action checks to see if the file has any missing references.
This action has no parameters.
This action returns a boolean of true if there are no missing references and false if there are.
This action must be called after initialize, but before load.
$loader checkForDuplicateEntities
This action checks for duplicate entities.
This action has no parameters.
This action returns a boolean of true there are duplicate entities.
This action must be called after initialize, but before load.
$loader checkForDuplicateRules
This action checks for duplicate rules.
This action has no parameters.
This action returns a boolean of true there are duplicate rules.
This action must be called after initialize, but before load.
$loader checkCAEUnsupportedEntities
This action checks for the number of unsupported entities that will be ignored or deleted if the file is loaded.
This action has no parameters.
This action returns the number of unsupported entities.
This action must be called after initialize, but before load.
$loader getError
This action reports the last I/O error detected when processing the file. If no errors were detected, an empty string is returned.
This action has no parameters.
This action returns a string with the last io error.
$loader getRepairConnectors ?-averageChange avgVar? ?-maximumChange maxVar?
This action returns the connectors that have grid points that are out of sync with their distribution functions when the RepairMode attribute is set to Defer. Note that when reading in a file with frameworks, the connectors may be from differing frameworks.
-averageChange avgVar | This optional parameter is the string name of the variable that receives a list of float values for the average change between the grid point locations between the original connector and the repaired connector. The order of the entries correspond with the list returned by this action. |
-maximumChange maxVar | This optional parameter is the string name of the variable that receives a list of float values for the maximum change between the grid point locations between the original connector and the repaired connector. The order of the entries correspond with the list returned by this action. |
This action returns a list of pw::Connector objects.
An empty list will be returned if this action is called prior to calling the load command.
$loader repair mode ?connectors?
This action will repair the distributions of the out of sync connectors when the RepairMode attribute is set to Defer.
mode | This parameter is a string value specifying how to repair connectors. Valid values are < KeepGridPoints | KeepDistributions >. |
connectors | This optional parameter is a list of pw::Connector objects to repair. It has no effect if the connector is not one of the connectors returned by getRepairConnectors. If this parameter is not given, all connectors will be repaired. |
This action returns nothing.
This attribute controls whether the data being loaded is treated as an append or a replace.
$loader get/setAppendMode append
This attribute controls whether the load is environment only.
$loader get/setEnvironmentMode environment
This attribute controls how connectors with grid points that are out of sync with their distribution functions are loaded.
$loader get/setRepairMode mode
This attribute controls how rules are processed by load.
$loader get/setRulesOption option
This action initializes the mode with the file name.
$loader initialize filename
This action initializes returns information about the file after the mode has been initialized with the file name.
$loader getFileInformation option
This action checks to see if the file has any missing references.
$loader checkForMissingReferences
This action checks for duplicate entities.
$loader checkForDuplicateEntities
This action checks for duplicate rules.
$loader checkForDuplicateRules
This action checks for the number of unsupported entities that will be ignored or deleted if the file is loaded.
$loader checkCAEUnsupportedEntities
This action loads the entities and settings from the native file.
$loader load
This action reports the last I/O error detected when processing the file.
$loader getError
This action returns the connectors that have grid points that are out of sync with their distribution functions when the RepairMode attribute is set to Defer.
$loader getRepairConnectors ?-averageChange avgVar? ?-maximumChange maxVar?
This action will repair the distributions of the out of sync connectors when the RepairMode attribute is set to Defer.
$loader repair mode ?connectors?
This action begins a mode in the application.
pw::Application begin ?-mode_specific_flags? mode ?entities?
Reset the settings of the application
pw::Application reset ?-keep keep_list? ?reset_list?