Research and Development of CAPP Template Customization System (3)

2.2 Data description of the process template

The system describes all process cards in XML.

XML uses documents to represent entities, while elements in documents represent instances of entities. Each tag in the document is the beginning of a new element. An XML element contains a start tag, an end tag, and the content of the element. Based on the process model entity, the various elements of the template can be regarded as a series of instances of the entity, so XML technology can be used to design a common XML vocabulary describing the process card table. Based on this, the user can base this set. Glossary and DTDs flexibly build the required process file templates. The constructed process template (XML document) is parsed by the table generation engine and displayed on the client browser. The system generates a metadata tree by parsing the XML document, and then displays it as a process card. The system does not exist. A real table, all craft cards correspond to XML documents.

Therefore, the key to template customization is to provide an interactive card drawing function and convert the user-drawn craft card into a corresponding XML document description.

3 XML-based template customization technology

3.1 Template Sub-Element Creation

By analyzing the composition of the template components, the template customization is actually a process of decomposing a type of process card format into template sub-elements such as static grid, dynamic grid, object grid and loop grid, and separately generated by means of interactive means. In this system, the template is treated as an XML document entity, so the process of generating a template is actually the process of creating an XML document, and the new template child element corresponds to a node that creates an XML document. In order to ensure that the newly created XML document can be parsed by the system, the created XML document must conform to the definition of Schema.

To create a new document object, you must create a new Msxml2.DOMDocument example. The following is the corresponding C++ code:

IXMLDOMDocumentPtrm_pXMLDoc;
m_pXMLDoc.CreateInstance(_T("msxml2.domdocument"));

After creating the DOMDocument object, you can set tags for different types of parsing behaviors and processing behaviors, load XML documents, and create new nodes inside the document to create different template sub-elements to generate a complete craft card.

3.2 Drawing of craft cards

After creating a new template, the user can draw the craft card on the initial template. The system uses the Windows Graphics Device Interface (GDI) when drawing. Through the elemental decomposition of the craft card, the card is composed of a series of cells, so the main work when drawing is the drawing of the rectangular frame.

Before the drawing starts, you need to obtain the device description table handle. In addition, you need to obtain the device description table information, set the GDI mapping mode, and so on. When drawing a picture, you can select the color and line width of the brush, and the coordinate value will be dynamically displayed according to the movement of the brush in the status bar of the interface. In addition, the system also provides the function of "rubber strip", which dynamically displays the graph as the mouse moves, making the operation intuitive.

Previous page next page

Tungsten Carbide Plate

Tungsten Carbide Plate,Carbide Plate,Carbide Sheet,Tungsten Carbide Sheet

Zhuzhou Kerui Cemented Carbide Co., Ltd. , https://www.carbide-china.com