Equipment & Systems |
Schematics Platform Modeler |
Extending Schematic Application Sample "StartUp" objectsWorking with Schematic Components |
Use Case |
AbstractThis article discusses the CAASchAppExtendCATfct use case. |
This use case is intended to illustrate how to extend an existing schematic application "CATfct" file with new StartUp classes. Please refer to Creating StartUp Objects use case for more information.
[Top]
CAASchAppExtendCATfct is a use case of the CAASchPlatformModeler.edu framework that illustrates the procedures to extend "base feature" schematic application classes and their attributes.
[Top]
The sample takes an input ".CATfct" file, created by CAASchAppCreateCATfct use case, containing the schematic StartUp objects Connector, Connection, FuncPart, FuncString, etc. (shown in light blue in the diagram below). It then adds new sample schematic application subclasses (shown in orange in the diagram below) to the FuncPart class, adds the attribute to the existing Connector class, and saves all the modification in the new file to a directory specified by the user.
![]() |
[Top]
To launch CAASchAppExtendCATfct, you will need to set up the build time environment, then compile CAASchAppExtendCATfct along with its prerequisites, set up the run time environment, and then execute the sample. This is fully described in the referenced article [1]. When launching the use case, you must pass the following arguments:
[Top]
CAASchAppExtendCATfct code is located in the CAASchAppExtendCATfct.m use case module of the CAASchPlatformModeler.edu framework:
Windows | InstallRootDirectory\CAASchPlatformModeler.edu\CAASchAppExtendCATfct.m |
Unix | InstallRootDirectory/CAASchPlatformModeler.edu/CAASchAppExtendCATfct.m |
where InstallRootDirectory
is the root directory of your CAA V5
installation. The name of the source file is CAASchAppExtendCATfctMain.cpp.
Additional prerequisite code is located in the CAASchAppUtilities.m module of the same framework.
[Top]
There are 3 logical steps in CAASchAppExtendCATfct:
[Top]
In this use case, we open an input "CATfct" that already has schematic StartUp objects that further subclasses are to be derived from. Initializing the environment involves the following:
CATUnicodeString uClientId (SCHEDUAppClientID); rc = ::UpgradeCatalog(&uCATFctToLoad, &piCatalog, &uClientId);
[Top]
Method CAAExtendBaseFeatureSU is the main method that creates new subclasses and attributes for the sample application. The code can be divided into the following steps:
CATListPtrCATBaseUnknown *pCAASUList = new CATListPtrCATBaseUnknown();
This list will contain a pointer to CATBaseUnknown for each created StartUp.
... CATListValCATUnicodeString CAALUClass; CATListValCATUnicodeString CAALUSuperClass; CATListValCATUnicodeString CAALUName; // class SuperClass CAALUClass.Append(SCHEDUClass_Compressor); CAALUSuperClass.Append(SCHEDUClass_FuncPart); ... CAALUName.Append(SCHEDUName_Compressor); ...
Three CATUnicodeString lists are created: the first for the StartUp class names, the second for the StartUp superclass names, and the third for the StartUp names. The indices of a given StartUp is the same in these three lists. The CATUnicodeString classes are initiliazed in CAASchAppClassNames.h, located in the PrivateInterfaces folder of CAASchPlatformModeler.edu framework.
This step is fully described in CAASchAppCreateCATfct use case.
The pointers in the StartUp list are released and set to NULL, and the list itself is deleted.
CATBaseUnknown *pBUStartUp = NULL; CATUnicodeString uClassCntr (SCHEDUClass_Connector); if (SUCCEEDED(iCatalog->RetrieveSU (&pBUStartUp,&uClassCntr, "CATISpecObject")) && pBUStartUp) { CATISpecObject_var spSpecSU; spSpecSU = pBUStartUp; ... CATISpecAttribute *piSpecAttr = NULL; if (!!spSpecSU) { piSpecAttr = spSpecSU->AddAttribute ( SCHEDUATTR_Connector_ToOtherCntr, tk_specobject); ... } ...
First, CATICatalog::RetrieveSU method is called to retrieve a CATBaseUnknown pointer to the Connector StartUp object, given the Connector class name. A CATISpecObject pointer is found for the Connector object and CATISpectObject::AddArttribute method is called to add a tk_specobject attribute. The attribute name is initialized in CAASchAppClassNames.h, located in the PrivateInterfaces folder of CAASchPlatformModeler.edu framework.
[Top]
The following steps conclude the use case:
rc = ::SaveCatalog (&piCatalog,&uCATFctToOutput);
[Top]
This use case has demonstrated how to define new subclasses and attributes for a typical schematic application.
[Top]
[1] | Building and Launching a CAA V5 Use Case |
[2] | Loading a Document |
Version: 1 [March 2005] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.