Machining |
NC Review |
Customizing Tool Editor for Drilling ToolsImplementing the CATIMfgToolEditorCustom interface |
Use Case |
AbstractThis article discusses the CAAMaiToolEditionCustomization use case and explains how to implement the CATIMfgToolEditorCustom manufacturing interface. |
This use case is intended to help you customize the tool editor of a drilling tool by implementing the CATIMfgToolEditorCustom manufacturing interface. This involves the following:
[Top]
CAAMaiToolEditionCustomization is a use case of the CAAManufacturingItf.edu framework that illustrates ManufacturingInterfaces framework capabilities.
[Top]
CAAMaiToolEditionCustomization runs with the Process document that contains the Drilling operation to use, the part to be machined, and the tool to use. The Drilling tool is accessible from the ResourceList. A double click on the Tool will invoke the customized tool editor.
![]() |
[Top]
To launch CAAMaiToolEditionCustomization, you will need to:
Windows | InstallRootDirectory\CAADoc\CAAManufacturingItf.edu\CNext\code\dictionary\ |
Unix | InstallRootDirectory/CAADoc/CAAManufacturingItf.edu/CNext/code/dictionary/ |
where InstallRootDirectory
is the directory where the CAA
CD-ROM is installed, and decomment the following line by removing the '#'
character:
Drilling CATIMfgToolEditorCustom libCAAMaiToolEditionCustomization
Windows | InstallRootDirectory\CAADoc\CAAManufacturingItf.edu\CNext\resources\graphic\ |
Unix | InstallRootDirectory/CAADoc/CAAManufacturingItf.edu/CNext/resources/graphic/ |
This displays the PPR document:
Note: at this step, the Drilling Tool Change is completed.
Top]
The CAAMaiToolEditionCustomization use case is made of a class named CAAEMaiToolEditionCustomizationDrillTool located in the CAAMaiToolEditionCustomization.m module of the CAAManufacturingItf.edu framework:
Windows | InstallRootDirectory\CAADoc\CAAManufacturingItf.edu\CAAMaiToolEditionCustomization.m |
Unix | InstallRootDirectory/CAADoc/CAAManufacturingItf.edu/CAAMaiToolEditionCustomization.m |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
[Top]
There are four logical steps in CAAMaiToolEditionCustomization:
We now comment each of those sections by looking at the code.
[Top]
The extension class that will implement CATIMfgToolEditorCustom is named CAAEMaiToolEditionCustomizationDrillTool. Creating this class is done is three sub steps:
#include "CATDlgInclude.h" #include "CATBooleanDef.h" class CAAEMaiToolEditionCustomizationDrillTool : public CATBaseUnknown { CATDeclareClass; public: CAAEMaiToolEditionCustomizationDrillTool(); virtual ~CAAEMaiToolEditionCustomizationDrillTool(); virtual CATDlgFrame* GetPanelEditor (CATDialog * iFather, CATDlgStyle iStyle=CATDlgFraNoFrame, const boolean iEditMode=TRUE); virtual CATDlgFrame* GetMorePanelEditor (CATDialog * iFather, CATDlgStyle iStyle=CATDlgFraNoFrame, const boolean iEditMode=TRUE); virtual CATDlgFrame* GetActivityEditor (CATDialog * iFather, CATDlgStyle iStyle=CATDlgFraNoFrame, const boolean iEditMode=FALSE); virtual CATDlgFrame* GetGraphicEditor (CATDialog * iFather, CATDlgStyle iStyle=CATDlgFraNoFrame, const boolean iEditMode=FALSE); virtual void GenerateJPEGImageFromGraphicEditor (CATDialog * iFather, const CATUnicodeString &iImagePathName=""); private: CAAEMaiToolEditionCustomizationDrillTool(const CAAEMaiToolEditionCustomizationDrillTool &iObjectToCopy); }; |
The CAAEMaiToolEditionCustomizationDrillTool class C++-derives
from CATBaseUnknown. The CATDeclareClass
macro declares
that the class CAAEMaiToolEditionCustomizationDrillTool belongs to a
component. The class has a constructor, a destructor, all the methods for
the editor customization, and a copy constructor. Note that the copy
constructor is set as private. This is very important for extensions. Since
extensions must never be directly instantiated by client applications, this
prevents the compiler from creating the copy constructor as public without
you know. This copy constructor is not implemented in the source file.
... #include "TIE_CATIMfgToolEditorCustom.h" TIE_CATIMfgToolEditorCustom(CAAEMaiToolEditionCustomizationDrillTool); CATImplementClass(CAAEMaiToolEditionCustomizationDrillTool, DataExtension, CATBaseUnknown, CATEMfgDrillTool); ... CATDlgFrame* CAAEMaiToolEditionCustomizationDrillTool::GetPanelEditor (CATDialog *iFather, CATDlgStyle iStyle, const boolean iMode) { ... |
The CAAEMaiToolEditionCustomizationDrillTool class states that it
implements the CATIMfgToolEditorCustom interface thanks to the TIE_CATIMfgToolEditorCustom
macro. The CATImplementClass
macro declares that the CAAEMaiToolEditionCustomizationDrillTool
class is data extension class, thanks to the DataExtension
keyword, and that it extends the feature whose type is Drilling. The
third parameter must always be set to CATBaseUnknown, makes no sense,
and is unused for extensions.
Extending the CATEMfgDrillTool feature using the CAAEMaiToolEditionCustomizationDrillTool class that implements CATIMfgToolEditorCustom means fitting this feature with your customized behavior for drill tool editor which will replace the default one. Some implementation methods are shown in the next steps. It has a smart pointer to the Process document manufacturing container as input parameter, and a smart pointer to the created tool editor as output parameter.
Update the interface dictionary, that is a file named, for example in this case, CAAManufacturingItf.edu.dico, whose directory's pathname is concatenated at run time in the CATDictionaryPath environment variable, and containing the following declaration to state that the Drilling feature implements the CATIMfgToolEditorCustom interface, and whose code is located in the libCAAMaiToolEditionCustomization shared library or DLL. Pay attention to remove the comment (#) in the supplied dictionary.
Drilling CATIMfgToolEditorCustom libCAAMaiToolEditionCustomization
The CAAManufacturingItf.edu.dico file is located in:
Windows | InstallRootDirectory\CAADoc\CAAManufacturingItf.edu\CNext\code\dictionary\ |
Unix | InstallRootDirectory/CAADoc/CAAManufacturingItf.edu/Cnext/code/dictionary/ |
[Top]
CATDlgFrame *CAAEMaiToolEditionCustomizationDrillTool::GetPanelEditor(CATDialog *iParent, CATDlgStyle iStyle, const CATBoolean iMode) { // Create the frame CATDlgFrame *pFr = new CATDlgFrame (iParent, CATString("theFrame"), iStyle); ... // Defines the list of tool parameters (from the CATMfgToolConstant.h declaration file) CATListOfCATUnicodeString ListNames; ListNames.Append (MfgName); ListNames.Append (MfgNominalDiameter); ListNames.Append (MfgCuttingLength); ListNames.Append (MfgCuttingAngle); ListNames.Append (MfgOverallLength); ListNames.Append (MfgLength); ListNames.Append (MfgBodyDiameter); // Build the frame for the list of tool parameters CATDlgFrame *pFrAtt = new CATDlgFrame (pFr, CATString("Frame"), Style); pFrAtt->SetDefaultOrientation(Vertical); BuildFrame (pFrAtt, ListNames); ... } |
[Top]
void CAAEMaiToolEditionCustomizationDrillTool::BuildFrame (CATDlgFrame *iParent, const CATListOfCATUnicodeString &iAttributesList) { // Make Query interface to retrieve the resource object CATIMfgResource *piMfgResource = NULL; HRESULT Res = this->QueryInterface(CATIMfgResource::ClassId(), (void **)&piMfgResource); ... // For each parameter, call the standard parameter editor ... for (int i=1; i<=iAttributesList.Size(); i++) { // Read the parameter name CATUnicodeString ParmName = iAttributesList[i]; // Read the parameter CATBaseUnknown_var Parm; HRESULT res = piMfgResource->GetValue(ParmName, Parm); // Define the label and editor for the tool parameter pFratt = new CATDlgFrame (iParent, CATString("fr"), CATDlgFraNoFrame); pFratt->SetDefaultOrientation(Horizontal); CATString name = CATString(ParmName ); pLabEdt = new CATDlgLabel (pFratt,name); // Call the standard parameter editor CATICkeParamFrame *piCkeParamFrame = NULL; HRESULT Res = Parm->QueryInterface(CATICkeParamFrame::ClassId(), (void **)&piCkeParamFrame); if (FAILED(res) || NULL != piCkeParamFrame) return; pFrEdt = piCkeParamFrame->GetInPanelEdition(piMfgResource, pFratt, StyleEdit, ParmName); if (NULL != piCkeParamFrame) piCkeParamFrame->Release(); } // Release the smart pointer to the resource object if (NULL != piMfgResource) piMfgResource->Release(); ... } |
[Top]
CATDlgFrame* CAAEMaiToolEditionCustomizationDrillTool::GetGraphicEditor (CATDialog *iParent, CATDlgStyle iStyle, const CATBoolean iMode) { ... //Create a Dialog Frame CATDlgFrame *pFr = new CATDlgFrame (iParent, CATString("theFrame"), iStyle); ... // Add the standard graphic icon CATDlgLabel *pLab = new CATDlgLabel (pFr, CATString("Lab")); CATString Icon("F_MfgDrillTool"); pLab->SetIconName(Icon); ... } |
[Top]
This article provides an example on how to use the manufacturing interface classes, and has illustrated them on a drill tool editor customization. It shows how to implement the CATIMfgToolEditorCustom interface to edit the drill tool in a process document that includes this tool as a resource.
The CATEMfgDrillTool feature behavior is modified by implementing CATIMfgToolEditorCustom in a data extension class. This class allows the end user to display the editor relative to this tool feature according to what he wants to see.
[Top]
[1] | Building and Launching a CAA V5 Use Case |
[2] | Process Modeler Home Page |
[Top] |
Version: 1 [January 2001] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.