AbstractThis article discusses the CAAMaiUserPostProcessorIntegration use case and explains how to implement the CATIMfgExternalPPDefinition manufacturing interface, and an interface derived from the CATIMfgExternalPPManagement manufacturing interface. |
This use case is intended to help you customize the list of available Post-Processors, by implementing the CATIMfgExternalPPDefinition manufacturing interface, and an interface derived from the CATIMfgExternalPPManagement manufacturing interface.
This involves the following:
GetListOfExternalPostProcessorProviders
method of CATIMfgExternalPPDefinition to return the list of
post-processors providers.GetProviderNames
method of CATIMfgExternalPPManagement
to define for the post-processor provider:
GetListOfPPs
method of CATIMfgExternalPPManagement
to define:
RunHelp
method of CATIMfgExternalPPManagement
to allow for each post-processor to run a HTML browser or any executable
to display documentation.RunPP
method of CATIMfgExternalPPManagement to
allow execution of each post-processor.[Top]
CAAMaiUserPostProcessorIntegration is a use case of the CAAManufacturingItf.edu framework that illustrates ManufacturingInterfaces framework capabilities.
[Top]
CAAMaiUserPostProcessorIntegration runs with a default Process document as shown on Fig.1 that contains the program to use. The use case shows that the tool path computation can be processed, including the NC code generation using a home-made or a third party post-processor.
![]() |
[Top]
To launch CAAMaiUserPostProcessorIntegration, 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 lines by removing the '#'
character:
CATMfgExtPPManagement CATIMfgExternalPPDefinition libCAAMaiUserPostProcessorIntegration
CATMfgExtPPManagement CAAIMaiUserPostProcessorIntegrationExternalPPClient1 libCAAMaiUserPostProcessorIntegration
CATMfgExtPPManagement CATICreateInstance libCAAMaiUserPostProcessorIntegration
In the left part of the Options panel, select the Machining workshop
In the right part of the Options panel, select the Output tab page
This displays the following panel:
Then, select the 'Other PP' check button in the top of the tab page (Post Processor section), and select 'My Post Processors' in the list of the possible PP providers
This will set 'My Post Processors' as current PP provider
Windows | InstallRootDirectory\CAADoc\CAAManufacturingItf.edu\CNext\resources\graphic\ |
Unix | InstallRootDirectory/CAADoc/CAAManufacturingItf.edu/CNext/resources/graphic/ |
where InstallRootDirectory
is the directory where the CAA
CD-ROM is installed.
This displays a panel on the top of the PPR document:
The text MyPP is a keyword associated to the PP provider.
Select a post processor in the list of available post processors. In the example, the provider has defined 2 post processors called My PP 1 and My PP 2
The selected post processor will be used to generate NC code
[Top]
The CAAMaiUserPostProcessorIntegration use case is made of:
Windows | InstallRootDirectory\CAADoc\CAAManufacturingItf.edu\CAAMaiUserPostProcessorIntegration.m |
Unix | InstallRootDirectory/CAADoc/CAAManufacturingItf.edu/CAAMaiUserPostProcessorIntegration.m |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
[Top]
There are five logical steps in CAAMaiUserPostProcessorIntegration:
We now comment each of those sections by looking at the code.
[Top]
The extension class that will implement CATIMfgExternalPPDefinition is named CAAEMaiUserPostProcessorIntegrationExtPPProviders.
The creation of this class is done is three sub steps:
#include "CATBaseUnknown.h" #include "CATListPV.h" class CAAEMaiUserPostProcessorIntegrationExtPPProviders : public CATBaseUnknown { public: CATDeclareClass; CAAEMaiUserPostProcessorIntegrationExtPPProviders (); virtual ~CAAEMaiUserPostProcessorIntegrationExtPPProviders (); virtual HRESULT GetListOfExternalPostProcessorProviders (CATListPV& oListOfPostProcessorProviders); private: CAAEMaiUserPostProcessorIntegrationExtPPProviders(const CAAEMaiUserPostProcessorIntegrationExtPPProviders &iObjectToCopy); }; |
The CAAEMaiUserPostProcessorIntegrationExtPPProviders C++-class derives from CATBaseUnknown.
The CATDeclareClass
macro declares that the class CAAEMaiUserPostProcessorIntegrationExtPPProviders
belongs to a component.
The class has a constructor, a destructor, the GetListOfExternalPostProcessorProviders
method of CATIMfgExternalPPDefinition, 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_CATIMfgExternalPPDefinition.h" CATImplementClass(CAAEMaiUserPostProcessorIntegrationExtPPProviders,CodeExtension,CATBaseUnknown,CATMfgExtPPManagement); TIEchain_CATIMfgExternalPPDefinition (CAAEMaiUserPostProcessorIntegrationExtPPProviders); ... HRESULT CAAEMaiUserPostProcessorIntegrationExtPPProviders::GetListOfExternalPostProcessorProviders (CATListPV& oListOfPostProcessorProviders) { HRESULT rc = S_OK; ... |
The CAAEMaiUserPostProcessorIntegrationExtPPProviders class states
that it implements the CATIMfgExternalPPDefinition interface thanks
to the TIEchain_CATIMfgExternalPPDefinition
macro.
The CATImplementClass
macro declares that the CAAEMaiUserPostProcessorIntegrationExtPPProviders
class is code extension class, thanks to the CodeExtension
keyword, and that it extends the object whose type is CATMfgExtPPManagement.
The third parameter must always be set to CATBaseUnknown, makes no
sense, and is unused for extensions.
Extending the CATMfgExtPPManagement object using the CAAEMaiUserPostProcessorIntegrationExtPPProviders class that implements CATIMfgExternalPPDefinition means fitting this object with your customized behavior for PP provider definition which will replace the default one.
The GetListOfExternalPostProcessorProviders
method
implementation is shown in the next steps. It has no input parameters and a
pointer to the list of pointers of implementation classes ID corresponding
to post-processors providers 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 CATMfgExtPPManagement object implements the CATIMfgExternalPPDefinition interface, and whose code is located in the libCAAMaiUserPostProcessorIntegration shared library or DLL. Pay attention to remove the comment (#) in the supplied dictionary.
CATMfgExtPPManagement CATIMfgExternalPPDefinition libCAAMaiUserPostProcessorIntegration
The CAAManufacturingItf.edu.dico file is located in:
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.
[Top]
Each post-processor provider will have to create an implementation class for an interface derived from the CATIMfgExternalPPManagement interface
The list of post-processors providers is retrieved through the GetListOfExternalPostProcessorProviders
method with instructions as follows:
... oListOfPostProcessorProviders.Append ((void*) &CAAIMaiUserPostProcessorIntegrationExternalPPClient1::ClassId ()); ... |
[Top]
The interface derived from CATIMfgExternalPPManagement is named CAAIMaiUserPostProcessorIntegrationExternalPPClient1.
The creation of this interface is done is four sub steps:
... class ExportedByCAAMaiPostProcessorEnv CAAIMaiUserPostProcessorIntegrationExternalPPClient1 : public CATIMfgExternalPPManagement { CATDeclareInterface ; public: }; CATDeclareHandler (CAAIMaiUserPostProcessorIntegrationExternalPPClient1,CATBaseUnknown) ; ... |
The CATDeclareInterface
macro declares that the CAAIMaiUserPostProcessorIntegrationExternalPPClient1
class is an interface
ExportedByCAAMaiPostProcessorEnv
means that the interface
will be exported by the module CAAMaiPostProcessorEnv
#include "CATMetaClass.h" #include "CAAIMaiUserPostProcessorIntegrationExternalPPClient1.h" ... CATImplementInterface (CAAIMaiUserPostProcessorIntegrationExternalPPClient1,CATBaseUnknown); CATImplementHandler (CAAIMaiUserPostProcessorIntegrationExternalPPClient1,CATBaseUnknown); ... |
The CATImplementInterface
macro declares that the CAAIMaiUserPostProcessorIntegrationExternalPPClient1
class is an interface
#include "CAAIMaiUserPostProcessorIntegrationExternalPPClient1.h" |
#ifdef _WINDOWS_SOURCE #ifdef __CAAMaiUserPostProcessorIntegration #define ExportedByCAAMaiPostProcessorEnv __declspec(dllexport) #else #define ExportedByCAAMaiPostProcessorEnv __declspec(dllimport) #endif #else #define ExportedByCAAMaiPostProcessorEnv #endif |
[Top]
The extension class that will implement CAAIMaiUserPostProcessorIntegrationExternalPPClient1 is named CAAEMaiUserPostProcessorIntegrationExtPPClient1.
The creation of this class is done is three sub steps:
#include "CATBaseUnknown.h" ... class CAAEMaiUserPostProcessorIntegrationExtPPClient1 : public CATBaseUnknown { public: CATDeclareClass; CAAEMaiUserPostProcessorIntegrationExtPPClient1 (); virtual ~CAAEMaiUserPostProcessorIntegrationExtPPClient1 (); virtual HRESULT GetProviderNames ( CATUnicodeString& oNLSName , CATString& oKeywordName ); virtual HRESULT GetListOfPPs ( CATListOfCATUnicodeString& oNLSList , CATListOfCATString& oKeywordList ); virtual HRESULT RunHelp ( CATString& iPPKeyword ); virtual HRESULT RunPP ( CATListOfCATUnicodeString& iPPParams ); private: CAAEMaiUserPostProcessorIntegrationExtPPClient1(const CAAEMaiUserPostProcessorIntegrationExtPPClient1 &iObjectToCopy); }; |
The CAAEMaiUserPostProcessorIntegrationExtPPClient1 C++-class derives from CATBaseUnknown.
The CATDeclareClass
macro declares that the class CAAEMaiUserPostProcessorIntegrationExtPPClient1
belongs to a component.
The class has a constructor, a destructor, the methods of CATIMfgExternalPPManagement,
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_CAAIMaiUserPostProcessorIntegrationExternalPPClient1.h" CATImplementClass (CAAEMaiUserPostProcessorIntegrationExtPPClient1,CodeExtension,CATBaseUnknown,CATMfgExtPPManagement); TIEchain_CAAIMaiUserPostProcessorIntegrationExternalPPClient1 (CAAEMaiUserPostProcessorIntegrationExtPPClient1); ... HRESULT CAAEMaiUserPostProcessorIntegrationExtPPProviders::GetListOfExternalPostProcessorProviders (CATListPV& oListOfPostProcessorProviders) { HRESULT rc = S_OK; ... |
The CAAEMaiUserPostProcessorIntegrationExtPPClient1 class states
that it implements the CAAIMaiUserPostProcessorIntegrationExternalPPClient1
interface thanks to the TIEchain_CAAIMaiUserPostProcessorIntegrationExternalPPClient1
macro.
The CATImplementClass
macro declares that the CAAEMaiUserPostProcessorIntegrationExtPPClient1
class is code extension class, thanks to the CodeExtension
keyword, and that it extends the object whose type is CATMfgExtPPManagement.
The third parameter must always be set to CATBaseUnknown, makes no
sense, and is unused for extensions.
Extending the CATMfgExtPPManagement object using the CAAEMaiUserPostProcessorIntegrationExtPPClient1 class that implements CAAIMaiUserPostProcessorIntegrationExternalPPClient1 means fitting this object with your customized behavior for post-processors definition which will replace the default one.
The methods implementation is shown in the next steps.
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 CATMfgExtPPManagement object implements the CAAIMaiUserPostProcessorIntegrationExternalPPClient1 interface, and whose code is located in the libCAAMaiUserPostProcessorIntegration shared library or DLL. Pay attention to remove the comment (#) in the supplied dictionary.
CATMfgExtPPManagement CAAIMaiUserPostProcessorIntegrationExternalPPClient1 libCAAMaiUserPostProcessorIntegration
The CAAManufacturingItf.edu.dico file is located in:
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.
[Top]
GetProviderNames
methodThis method has no input parameters and two strings as output parameters.
HRESULT CAAEMaiUserPostProcessorIntegrationExtPPClient1::GetProviderNames ( CATUnicodeString& oNLSName , CATString& oKeywordName ) { HRESULT RC = S_OK; oNLSName = "My Post Processors"; oKeywordName = "MyPP"; return RC; } |
The first string (oNLSName
) defines the NLS name of the
post-processors provider.
The second string (oKeywordName
) defines a keyword which
will be used in internal treatments to identify the post-processors
provider. It may be the Company name, for instance
GetListOfPPs
methodThis method has no input parameters and two lists of strings as output parameters.
HRESULT CAAEMaiUserPostProcessorIntegrationExtPPClient1::GetListOfPPs ( CATListOfCATUnicodeString& oNLSList , CATListOfCATString& oKeywordList ) { HRESULT RC = S_OK; oNLSList.Append ("My PP 1"); oNLSList.Append ("My PP 2"); oKeywordList.Append ("PP1"); oKeywordList.Append ("PP2"); return RC; } |
The first list of strings (oNLSList
) defines the NLS names
of the post-processors.
The second list of strings (oKeywordList
) defines a list of
keywords which will be used in internal treatments to identify the
post-processors.
RunHelp
methodThis method has a single input parameter and no output parameter.
The input parameter (iPPKeyword
) is the keyword linked to
the post-processor for which documentation is required.
HRESULT CAAEMaiUserPostProcessorIntegrationExtPPClient1::RunHelp ( CATString& iPPKeyword ) { HRESULT RC = S_OK; // Definition of the path and of the file containing the documentation of the Post-processor // which has iPPKeyword as associated keyword CATUnicodeString path ("/xx/xxx/xxx") , file ("PP1.html"); char cFile [256]; CATMakePath (path.ConvertToChar(),file.ConvertToChar(),cFile); // Execute the browser to open the html file CATCommandHeader* header = NULL; header = CATCommandHeader::GetHeaderFromList ("CATContextualHelpCommand"); if (NULL != header) { header -> SetArgument (CATString (cFile)); header -> StartCommand (); header -> SetArgument (CATString ("")); } return RC; } |
RunPP
methodThis method has a single input parameter and no output parameter.
The input parameter is a list of strings. It contains three strings which are:
iPPParams[1]
: keyword defining the post-processor to be
runiPPParams[2]
: NC file to be treated (APT source,
clfile,...)iPPParams[3]
: ISO file to be generated
HRESULT CAAEMaiUserPostProcessorIntegrationExtPPClient1::RunPP ( CATListOfCATUnicodeString& iPPParams ) { HRESULT RC = S_OK; cout << " PP Name to run : " << iPPParams[1].ConvertToChar() << endl; cout << " NC file : " << iPPParams[2].ConvertToChar() << endl; cout << " ISO file : " << iPPParams[3].ConvertToChar() << endl; ... // Here has to be written the code for the post-processor submission code, using the input parameters ... return RC; } |
[Top]
This article provides an example on how to use the manufacturing interface classes, and has illustrated them on user defined post-processor customization. It shows how to implement the CATIMfgExternalPPDefinition interface and an interface derived from CATIMfgExternalPPManagement to allow third party post-processors or home-made post-processors to be used.
The post-processors provider can be selected in the list of available providers (through the Options item of the Tools menu), thanks to a C++-class implementing the CATIMfgExternalPPDefinition interface.
The post-processor can be selected when submitting the toolpath computation, thanks to a C++-class implementing an interface derived from the CATIMfgExternalPPManagement interface.
[Top]
[1] | Building and Launching a CAA V5 Use Case |
[2] | Process Modeler Home Page |
[Top] |
Version: 1 [Sep 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.