《CATIA CAA应用开发的过程与方法.doc》由会员分享,可在线阅读,更多相关《CATIA CAA应用开发的过程与方法.doc(22页珍藏版)》请在金锄头文库上搜索。
1、http:/应用开发的过程与方法命名方法详见应用开发中的命名规则一、系统安装与环境配置1.1 系统安装1.1.1 VC1.1.2 CATIA1.1.3 组建应用接口(CAA)1.1.4 快速应用开发环境(RADE)1.2 应用开发环境配置二、目录结构的建立2.1 创建工作空间(Workspace)In Microsoft Developer Studio open menu File and select Open CAAV5 Workspace, the following window appears in which you can select to open your workspa
2、ce with the mkmk functionalities. Either mode will give you access to the Code Generator features.Once you have filled in the workspace information, click on OK. A log window appears while your environment is updated and the workspace opened. When this window has disappeared Developer Studio loads t
3、he project files it stored in your workspace and you are ready to work.The commands available in the Code Generator are a set of wizards wherein you specify a series of parameters and it will generate code for you. Before creating the code, a report window appears so that you may verify that the cod
4、e generated is as you expect it.You may find that some of the generated source files contain commented out statements such as DO NOT EDIT : THE CAA2 WIZARDS WILL INSERT CODE HERE. Do not modify what you find between these commented lines or the wizards will no longer be able to insert code in the so
5、urce file.2.2 定义组件框架(CAA V5 Framework/Implementation Framework)In Microsoft Developer Studio, open menu Project and select New Framework The wizard will then create the following directory structure:Education type frameworks are suffixed .edu and Test frameworks are suffixed .tst. The wizard appends
6、 these suffixes to the name of the framework.2.3 定义接口空间(Interface Framework)An interface framework is a framework that contains (mainly) interfaces in both C+ or IDL language. The structure of this interface is very specific. V5 naming conventions requires that these interfaces be distinguishable th
7、rough an Interfaces suffix. Therefore if you type in Bird in the framework name, the generated framework will be called BirdInterfaces. The generated structure is the following:After the file structure has been created, the C+ Interactive Dashboard updates your Developer Studio project to take into
8、account the new files and directories. In the Java Interactive Dashboard, you will see the new framework in the workspace tree view. Note that the framework is set as the currently active project.2.4 定义模块(Module)In Microsoft Developer Studio, open menu Project and select New Module When you click on
9、 OK a report window is displayed to show you the files and directories that will be created. If you accept, the following file structure will be created:Note that the newly created module is set as the currently active module三、类定义Code Generator wizards enable you to create specific V5 objects that i
10、mplement customary V5 patterns. These currently include: Object modeler interfaces (both C+ and IDL) Object modeler implementations V5 documents V5 features. In Microsoft Developer Studio, source code is generated in the currently active module. If the active project is not a module, the following w
11、arning box will ask you to select an active module. In Microsoft Developer Studio, this is done by activating the contextual menu on the desired Microsoft project (Set as active project). When you generate source code using the Code Generator, your workspace is updated to take into account the files
12、 newly created. In Developer Studio only, this often results in the following warning:This is an expected behaviour and it is safe to reload your project.3.1 CAA V5 C+类In Microsoft Developer Studio, open menu Insert and select CAA V5 Class. .It is recommended to use this command rather than using Ms
13、Devs own class creator because it takes into account the CAAV5 File Tree, as well as the standard macros included in the CAA classes.The wizard will create a header and a source file comprising a standard constructor and destructor, as well as an equal operator and a copy constructor. The following
14、files are created.3.2元件接口类(Object Modeler interfaces)Interfaces can be defined in C+ or in IDL (interface definition language).In Microsoft Developer Studio, open menu Insert and select Interface. .3.2.1 C+接口V5 naming conventions require that your interface have a 3 letter prefix, followed by the le
15、tter I in upper case, followed by anything else, as in CATINavigateObject.3.2.2 IDL接口IDL interfaces can only be generated inside an Interface framework. The IDL radio button will be greyed out in any other type of framework.V5 naming conventions require that automation interface have a 3 letter prefix, followed by the letters IA in upper case, followed by anything else. The automation alias will be generated by extracting the XXXIA prefix from the interface name.When you click on OK a report window is displayed to show you the files that will be created. If you accep