A CAA secondary development method and system based on VsCode
By initializing VsCode as a CAA workspace and providing the CAA runtime environment, monitoring file system events for diagnosis and compilation, the problem of VsCode's inability to recognize CAA projects was solved, the core functions and intelligent diagnosis of CAA secondary development were implemented, and development efficiency and success rate were improved.
Patent Information
- Application Number
- CN202310209307.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2043-03-07
AI Technical Summary
VsCode cannot recognize the CAA project workspace, lacks the core functions and intelligent diagnosis required for CAA secondary development, has complex configuration and difficulty in providing a runtime environment, resulting in development complexity and low success rate.
Initialize the VsCode workspace as a CAA workspace, provide the CAA runtime environment, monitor file system events for diagnosis, generate build target instructions, and provide CAA programming services, including dynamic marking of CAA modules and module compilation and deployment.
It enables VsCode to identify and manage CAA workspaces, provides core functions and intelligent diagnosis, improves development efficiency and success rate, and supports continuous integration and continuous delivery deployment.
Smart Images

Figure CN116185422B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of three-dimensional design and application technology, and specifically discloses a CAA secondary development method and system based on VsCode. Background Art
[0002] The Dassault Systèmes 3DE platform is the mainstream 3D design and BIM application platform in today's water conservancy and hydropower industry, offering diverse capabilities including collaborative design, analytical calculations, construction simulation, and business intelligence. The Dassault Systèmes 3DE platform's client secondary development interface is CAA, developed in C++, and developed using Visual Studio + RADE. RADE is a heavyweight development environment, requiring installation media up to several gigabytes, making configuration difficult and inflexible. The current mainstream modern C++ development environment is VsCode, a lightweight editor with a broad user base, a rich plugin library, and flexible expansion. However, VsCode does not provide the essential features required for CAA development, and its direct use for CAA secondary development presents the following technical issues:
[0003] ① Unable to identify CAA project workspace;
[0004] CAA secondary development uses a unique FrameWork framework and Module folder organization structure, which requires special identification and management.
[0005] ② Failure to provide essential core functions of CAA;
[0006] CAA secondary development has many specialized functions, such as component-oriented programming, interface binding, command and UI creation, feature declaration, etc., which are the basic requirements of CAA development.
[0007] ③ CAA intelligent diagnosis function is not provided;
[0008] CAA secondary development is relatively complex. In addition to the general diagnostics of the grammar service, there are many unique diagnostics, such as dictionary file and resource file configuration. If they are not set correctly, it will cause abnormal operation.
[0009] ④No CAA runtime environment is provided;
[0010] The runtime environment refers to a set of preset environment variables. If not set correctly, the compiler may not be able to find header files and library files during compilation, resulting in compilation failure. At runtime, the application may not be able to find dynamic libraries, resulting in execution failure. Summary of the Invention
[0011] To overcome the shortcomings of the prior art in monitoring data transmission and processing, the present invention provides a CAA secondary development method based on VsCode, comprising the following steps:
[0012] Initialize the VsCode original workspace as a CAA workspace, create a CAA runtime environment directory, monitor the CAA workspace, dynamically mark CAA modules, generate build target instructions for them, and provide CAA programming services;
[0013] Monitor CAA work module file system events during interactive programming in VsCode to trigger CAA diagnosis. The diagnosis process includes: reading the file name and content of the event, and performing compliance screening based on at least one of the scope, keyword, keyword context, and prompt information in the preset diagnosis rules;
[0014] The target build instruction is executed to compile the CAA module into a dynamic link library or an executable program, and then deployed to the 3DE platform for execution.
[0015] Preferably, the dynamic marking method is: monitoring the suffix of the folder name in the CAA workspace, and marking the folder with the suffix ".m" as a CAA module.
[0016] Preferably, the step of generating the target build instruction includes: adding CAA predefined macros, adding CAA header files and paths, adding CAA library file paths, and adding compilation and linking options.
[0017] Preferably, the compliance screening comprises reciprocating the following steps:
[0018] Monitor the file system events of all source files and header files of the CAA module. When events such as opening, activating, modifying, switching, and saving occur, CAA diagnosis is triggered and the next step is entered.
[0019] Read the file name of the event and check whether the file name meets the diagnostic scope; only proceed to the next step if it meets the preset diagnostic rules, otherwise return a prompt message;
[0020] Read the file content and search for keywords; proceed to the next step only if the preset diagnosis rules are met, otherwise return a prompt message;
[0021] The context sentence where the keyword is located is read as a parameter and input into the checker for diagnosis, and a prompt message is returned when the preset diagnosis rule is not met.
[0022] Based on the same idea, the present invention also provides a CAA secondary development system based on VsCode, including the following functional modules:
[0023] The core module is used to initialize the VsCode original workspace into a CAA workspace, create a CAA runtime environment directory, monitor the CAA workspace, dynamically mark CAA modules, generate build target instructions for them, and provide CAA programming services;
[0024] A diagnostic module is used to monitor CAA work module file system events during interactive programming in VsCode and trigger CAA diagnosis. The diagnostic process includes: reading the file name and content of the event, and performing compliance screening based on at least one of the scope, keyword, keyword context, and prompt information in the preset diagnostic rules;
[0025] The construction module is used to execute the construction target instruction, compile the CAA module into a dynamic link library or an executable program, and deploy it to the 3DE platform for execution.
[0026] Preferably, the dynamic marking method is: monitoring the suffix of the folder name in the CAA workspace, and marking the folder with the suffix ".m" as a CAA module.
[0027] Preferably, the step of generating the target build instruction includes: adding CAA predefined macros, adding CAA header files and paths, adding CAA library file paths, and adding compilation and linking options.
[0028] Preferably, the compliance screening comprises the following steps in a reciprocating cycle:
[0029] Monitor the file system events of all source files and header files of the CAA module. When events such as opening, activating, modifying, switching, and saving occur, CAA diagnosis is triggered and the next step is entered.
[0030] Read the file name of the event and check whether the file name meets the diagnostic scope; only proceed to the next step if it meets the preset diagnostic rules, otherwise return a prompt message;
[0031] Read the file content and search for keywords; proceed to the next step only if the preset diagnosis rules are met, otherwise return a prompt message;
[0032] The context sentence where the keyword is located is read as a parameter and input into the checker for diagnosis, and a prompt message is returned when the preset diagnosis rule is not met.
[0033] Compared with the prior art, the present invention produces the following beneficial effects:
[0034] ① Enable VsCode to recognize CAA workspace, so that project management can be performed, such as adding, modifying or deleting modules;
[0035] ② Provides core functions for CAA secondary development based on VsCode, such as common code blocks and component-oriented programming, which can improve user experience;
[0036] ③Provides CAA-specific intelligent diagnosis to help improve development quality;
[0037] ④ Provides a CAA runtime environment, enabling CAA secondary development to perform continuous integration and continuous delivery deployment (CI / CD), which can improve the efficiency of secondary development. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 1 is a flow chart of a CAA secondary development method based on VsCode in an embodiment of the present invention;
[0039] Figure 2 This is the technical solution architecture diagram of the CAA secondary development system based on VsCode of the present invention. DETAILED DESCRIPTION
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings. The described embodiments are part of the embodiments of the present invention, but not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without making any innovative efforts shall fall within the scope of protection of the present invention.
[0041] In conjunction with the instructions Figure 1-2 , an implementation method of CAA secondary development method based on VsCode is as follows: The specific steps of this technical solution are as follows:
[0042] S1. Initialize the CAA workspace and create the CAA runtime environment directory CNext;
[0043] The S2.Core module starts scanning and monitoring the CAA workspace. If it finds a folder with a .m suffix in the workspace, it marks it as a CAA module and generates a build target for the module. The build targets mainly include the following:
[0044] Add CAA predefined macros: CAT_ENABLE_NATIVE_EXCEPTION, CNEXT_CLIENT, PLATEFORME_DS64,
[0045] DS_NATIVE_WCHAR_T_DEFINED,_DS_PLATEFORME_64.
[0046] Add CAA header file and path,
[0047] ${CAARootDir}\FramworkName\PublicInterfaces.
[0048] Add the CAA library file path, ${CAARootDir}\win_b64\code\lib.
[0049] Where ${CAARootDir} is the CAA installation root directory, which defaults to C:\Program Files\DassaultSystemes\ <version> , <version>Refers to the version, such as: B424.
[0050] Generates compile_commands.json build instructions to support clangd in providing general language services such as syntax awareness, code hints, and static analysis.
[0051] S3. Users start interactive programming and writing code, and can fully utilize the services and functions such as code snippets provided by the Core module during the process.
[0052] S4. The diagnostic module begins monitoring CAA module file system events. The diagnostic module has pre-set CAA-specific diagnostic rules. These rules include five fields: scope (regular expression), keyword (string), key statement (regular expression), prompt message (string), and checker (closure function). Specifically, the following steps are repeated:
[0053] Monitor CAA module file system events, including creation, modification, opening, switching, etc.
[0054] Read the file name where the listening event is located and check whether the file name meets the scope; if it does, proceed to the next step; otherwise, return.
[0055] The diagnostic module reads the target file content and searches for keywords; if a match is found, it proceeds to the next step; otherwise, it returns.
[0056] The diagnostic module reads the sentence where the keyword is located;
[0057] The diagnostic module calls the checker to check whether the rules are met; if not, it returns diagnostic repair suggestions and prompt information; if it is met, it returns nothing.
[0058] S5. The user clicks the build target, compiles the CAA module to generate a dynamic link library, and automatically deploys it to the 3DE platform runtime environment.
[0059] S6. Test run.
[0060] A CAA secondary development system based on VsCode simply uses virtual modules to express the above method. The basic content remains unchanged, and the embodiments of the system will not be described here.
[0061] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computers containing computer-usable program code, or on available storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.).
[0062] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0063] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0064] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0065] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.< / version> < / version>
Claims
1. A CAA secondary development method based on VsCode, characterized by The following steps are involved: Initialize the VsCode original workspace as a CAA workspace, create a CAA runtime environment directory, monitor the CAA workspace, dynamically mark CAA modules, generate build target instructions for them, and provide CAA programming services; Monitor CAA work module file system events during interactive programming in VsCode to trigger CAA diagnosis. The diagnosis process includes: reading the file name and content of the event, and performing compliance screening based on at least one of the scope, keyword, keyword context, and prompt information in the preset diagnosis rules; Execute the target build instruction, compile the CAA module into a dynamic link library or an executable program, and deploy it to the 3DE platform for execution; The dynamic marking method is: monitoring the suffix of the folder name in the CAA workspace, marking the folder with the suffix ".m" as a CAA module; The step of generating the target construction instruction includes: adding CAA predefined macros, adding CAA header files and paths, adding CAA library file paths, and adding compilation and linking options.
2. A CAA secondary development method based on VsCode as claimed in claim 1, characterized in that: The compliance screening includes the following steps in a reciprocating cycle: Monitor the file system events of all source files and header files of the CAA module. When events such as opening, activating, modifying, switching, and saving occur, CAA diagnosis is triggered and the next step is entered. Read the file name of the event and check whether the file name meets the diagnostic scope; only proceed to the next step if it meets the preset diagnostic rules, otherwise return a prompt message; Read the file content and search for keywords; proceed to the next step only if the preset diagnosis rules are met, otherwise return a prompt message; The context sentence where the keyword is located is read as a parameter and input into the checker for diagnosis, and a prompt message is returned when the preset diagnosis rule is not met.
3. A CAA secondary development system based on VsCode, characterized by Includes the following functional modules: The core module is used to initialize the VsCode original workspace into a CAA workspace, create a CAA runtime environment directory, monitor the CAA workspace, dynamically mark CAA modules, generate build target instructions for them, and provide CAA programming services; A diagnostic module is used to monitor CAA work module file system events during interactive programming in VsCode and trigger CAA diagnosis. The diagnostic process includes: reading the file name and content of the event, and performing compliance screening based on at least one of the scope, keyword, keyword context, and prompt information in the preset diagnostic rules; A construction module is used to execute the construction target instruction, compile the CAA module into a dynamic link library or an executable program, and deploy it to the 3DE platform for execution; The dynamic marking method is: monitoring the suffix of the folder name in the CAA workspace, marking the folder with the suffix ".m" as a CAA module; The step of generating the target construction instruction includes: adding CAA predefined macros, adding CAA header files and paths, adding CAA library file paths, and adding compilation and linking options.
4. A CAA secondary development system based on VsCode as claimed in claim 3, characterized in that: The compliance screening includes the following steps in a reciprocating cycle: Monitor the file system events of all source files and header files of the CAA module. When events such as opening, activating, modifying, switching, and saving occur, CAA diagnosis is triggered and the next step is entered. Read the file name of the event and check whether the file name meets the diagnostic scope; only proceed to the next step if it meets the preset diagnostic rules, otherwise return a prompt message; Read the file content and search for keywords; proceed to the next step only if the preset diagnosis rules are met, otherwise return a prompt message; The context sentence where the keyword is located is read as a parameter and input into the checker for diagnosis, and a prompt message is returned when the preset diagnosis rule is not met.