1. bookVolume 6 (2021): Issue 2 (July 2021)
Journal Details
License
Format
Journal
First Published
01 Jan 2016
Publication timeframe
2 times per year
Languages
English
access type Open Access

Research on Simufact simulation data processing system based on QT and MySQL

Published Online: 10 Nov 2021
Page range: 291 - 298
Received: 25 Feb 2021
Accepted: 22 Jul 2021
Journal Details
License
Format
Journal
First Published
01 Jan 2016
Publication timeframe
2 times per year
Languages
English
Abstract

As the simulation data of the Simufact Additive software was inconvenient to process, QT and structured query language (MySQL) database were used to develop the database to solve the processing of the simulation data. The GUI interface that has the functions of processing and saving the simulation data was designed. The interface developed by QT was used to start the Simufact Additive software, connect to the MySQL database and save the simulation data. The results showed that using MySQL as the management of simulation data has achieved better results in the post-processing of simulation data.

Keywords

Introduction

Simufact Additive software is developed by MSC software company for additive manufacturing simulation, and its software interface is shown in Figure 1. The software provides a simple user interface that can help users to quickly establish the parts model of additive manufacturing and also support the simulation of the post-treatment process of additive manufacturing (such as heat treatment or hot isostatic pressing). The software can be used for numerical calculation of additive manufacturing process of wire or powder materials under laser, arc or electron beam heat source. Good results can also be obtained for SLM, direct metal sintering (DMLS), electron beam melting (EBM) or laser casting [1].

Fig. 1

Interface of Simufact software.

Simufact Additive software is a simulation software specially developed for the metal additive manufacturing process. It can evaluate the structure design, material selection, manufacturing parameters, stacking forming direction and support structure of the additive manufacturing parts, and carry out the combination of process parameters and design structure and optimization. When using a 3D printer to make a metal model, the 3D printing process can be simulated through the user interface and the simulation data can be saved in a data file, but it is not convenient to operate when the simulation data is processed in the later stage [2]. Therefore, it is necessary to develop a processing system for Simufact Additive simulation data. In this paper, QT and MySQL databases are used to develop Simufact Additive simulation data processing. QT is a cross-platform C++ graphical user interface application-development framework developed by Qt Company in 1991. It can be used to develop GUI programs as well as non-GUI programs. MySQL is a relational database management system. Relational databases store data in different tables, thus increasing the speed of data access and flexibility [3,4,5].

Simufact Additive simulation data

The postprocessing function of Simufact can be displayed in many forms such as text files, pictures, animation, curves, etc. And it can be sliced to display various fields inside the workpiece. It can display material flow lines, variable point queries at any point and tracing of particle flow, and it allows multiple windows to display so that the results can be compared [6].

When using Simufact Additive software for simulation, three files will be produced after the simulation is completed, namely Log file, Status file and Output file. The status data during the simulation process is saved in the Status file. This is a notepad file. The status data during the 3D printing simulation process is recorded in detail in the file, but it is not convenient for later data processing.

Fig. 2

Display of Simufact simulation results.

Fig. 3

Simulation output of Simufact Additive.

MySQL database
Introduction to MySQL database

MySQL database is an open source relational database. It usually uses structured query language (SQL) to manage a variety of data or services. It has high performance, small size, portability and ease of use, which can satisfy different enterprises The business data storage requirements of the unit.

Similar to the conventional scripting languages, MySQL also has a set of rules for the use of characters, words and special symbols. MySQL completes the operation of the database by executing SQL scripts. The script consists of one or more MySQL statements (SQL statements + extended statements), and the script file extension is generally .sql when saving. Under the console, the MySQL client can also execute single-sentence statements without saving them as .sql files.

MySQL database has the advantages of rich functions, speed and security. MySQL supports most of the functions that a relational database should have – either directly or indirectly. Moreover, it also supports many security features and some of them are very advanced and built into MySQL. Abandoning certain standards allows MySQL to work very efficiently and simply, and therefore in a faster manner. The most important thing is MySQL can handle large amounts of data and be used on a large scale when needed. That is exactly what we need.

Creating Simufact simulation database

After installing the MySQL database on the computer, create a database of Simufact simulation data and create a table in the Simufact database named “layerstatus (nu,case_name,case_nu,time,cyc,conv_r,conv_d,prg,pst,rst)” and “cuttingstatus (nu,case_name,time,cyc,conv_r,conv_d,prg,pst,rst)”.

Fig. 4

Table layerstatus.

Fig. 5

Table cuttingstatus.

Operations on the database in QT
Introduction to QT

Qt is a cross-platform C++ application framework that supports Windows, Linux, Mac OS X, Android, iOS, Windows Phone, embedded systems, etc. In other words, Qt can support desktop application development, embedded development and mobile development at the same time, covering all existing mainstream platforms. You only need to write the code once and recompile it before publishing it to a different platform [7].

Qt is not just a GUI library. In addition to creating beautiful interfaces, it also has many other components. For example, you no longer need to study STL, C++ <string> header files, to find and parse XML, various third-party libraries for connecting to databases and Socket, and Qt have these built-in [8].

The interface source code is separated from the user source code. Qt's strategy is to generate a corresponding source code if there is no interface. For example, there is an interface design file xps.ui that will parse the XML and generate a corresponding ui_xps.h file. You do not need this file. Modify, if you want to call the controls in the interface directly through Ui::XPSClass ui; this object definition is also written in ui_xps.h. That is, your business logic is isolated from the creation and setting of interface control objects [9].

Connect to MySQL database in QT

We have installed MySQL database outside of QT platform and then created data table structure and added table database through CMD command. This method is intuitive to operate the database table, but it needs to install the program.

SQL statements are supported in QT. There are two ways to create database tables: one is to use MySQL common lineclient to execute SQL statements; the other is to use SQL model class to provide MVC mode with QT, such as qsqlquerymodel and qsqltablemodel class for database operation, and the results can be displayed in the table [10,11,12].

In order to deal with the simulation data of Simufact Additive software conveniently, we need to operate the database in MySQL in QT. We have already installed and configured this database. The next thing we need to do is to connect the database in QT. In order to achieve this goal, we write a program to connect the host, port number and name of the database in QT. Then enter the user name and password of the database to open the database. The process of connecting to the database is shown in Figure 6.

Fig. 6

QT connection to MySQL database process.

Through the program design, after the connection is successful, a dialogue box for connecting to the database will pop up, as shown in Figure 7.

Fig. 7

Successful database connection.

Processing of simulation data in QT

Before saving the simulation data in the database, the program developed by QT needs to process the data in the data file simulated by the Simufact Additive software, delete irrelevant information in the file, and leave only one space between the data in the notepad file in order to save in the database. The data in the status data file is shown in Figure 8.

Fig. 8

Raw data in the status file.

Use the readLine() statement in QT to read the simulation data in the interface developed by QT. During the reading process, the blanks in the file are processed. The processing statement data=data.append(in.readLine().simplified()).append("\n") displays the read data in the window developed by QT, as shown in Figure 9, deletes the invalid data in the file in the window interface and saves it in the newly created status data file, as shown in Figure 10.

Fig. 9

QT reads the middle data of the status file.

Fig. 10

Data after QT processing.

Use the QsqlQuery class to provide SQL statement operations and save the newly created status data file in a table created in the MySQL database.

QSqlQuery query;

query.exec("load data local infile ‘d:/layerdata.txt’ into table layerstatus’

"character set Utf8 fields terminated by ‘”’

"(nu,case_name,case_nu,time,cyc,conv_r,conv_d,prg,pst,rst)");

Use MySQL commands to display database table data as shown in Figure 11.

Fig. 11

The database table data.

Conclusions

As the Simufact Additive software simulation data is inconvenient to process, this design uses QT and MySQL to realise the development of the database, which solves the storage function of the simulation data obtained in the Simufact Additive software simulation process in the MySQL database. The connection with the database is realised in QT, the SQL statement is used to create the table, and the SQL statement operation is provided through the QsqlQuery class to save the data in the database, which is convenient for processing the data in the database.

Fig. 1

Interface of Simufact software.
Interface of Simufact software.

Fig. 2

Display of Simufact simulation results.
Display of Simufact simulation results.

Fig. 3

Simulation output of Simufact Additive.
Simulation output of Simufact Additive.

Fig. 4

Table layerstatus.
Table layerstatus.

Fig. 5

Table cuttingstatus.
Table cuttingstatus.

Fig. 6

QT connection to MySQL database process.
QT connection to MySQL database process.

Fig. 7

Successful database connection.
Successful database connection.

Fig. 8

Raw data in the status file.
Raw data in the status file.

Fig. 9

QT reads the middle data of the status file.
QT reads the middle data of the status file.

Fig. 10

Data after QT processing.
Data after QT processing.

Fig. 11

The database table data.
The database table data.

Hong Chang, Numerical simulation of forming stress and deformation of GH4169 powder SLM based on simulact. Shandong Jianzhu University, 2019. ChangHong Numerical simulation of forming stress and deformation of GH4169 powder SLM based on simulact Shandong Jianzhu University 2019 Search in Google Scholar

Song Qingjun, Jing Qi, Zhang Wei. Simulation Research on 3D Printing of Selective Laser Melting of Automotive Aluminum Alloy Guide Arm. Automotive technology and materials, 2020, (10), pp. 47–53. SongQingjun JingQi ZhangWei Simulation Research on 3D Printing of Selective Laser Melting of Automotive Aluminum Alloy Guide Arm Automotive technology and materials 2020 10 47 53 Search in Google Scholar

Han Ganning, Li Yongfeng, Gao Yiteng, Design and Development of MySQL Database Based on Embedded Qt. Microcomputer application, 2020, 36 (05), pp. 25–27. HanGanning LiYongfeng GaoYiteng Design and Development of MySQL Database Based on Embedded Qt Microcomputer application 2020 36 05 25 27 Search in Google Scholar

Pan Haoda, Zheng Peng, Zheng Liang, etc, Industrial Remote Control System Based on Qt and Web. Radio communication technology, 2015,41(06), pp. 88–91+96. PanHaoda ZhengPeng ZhengLiang Industrial Remote Control System Based on Qt and Web Radio communication technology 2015 41 06 88 91+96 Search in Google Scholar

Li Pengwei, Zhao Hanchao, Zhang Xinqi, etc, Implementation of a MySQL-based laser ranging data analysis platform. Computer Era, 2020, (07), pp. 37–39+42. LiPengwei ZhaoHanchao ZhangXinqi Implementation of a MySQL-based laser ranging data analysis platform Computer Era 2020 07 37 39+42 Search in Google Scholar

Wu Jianhua, Application of Simufact software in plastic machining. Aviation Precision Manufacturing Technology, 2010, (02), pp. 43–45. WuJianhua Application of Simufact software in plastic machining Aviation Precision Manufacturing Technology 2010 02 43 45 Search in Google Scholar

Zhang, Han, Yin, Hongtao, Fu, Ping Design of Data Acquisition Software for Steam Turbine Based on Qt/Embedded. Smart Innovation, Systems and Technologies, 2020,156, pp. 375–384. ZhangHan YinHongtao FuPing Design of Data Acquisition Software for Steam Turbine Based on Qt/Embedded Smart Innovation, Systems and Technologies 2020 156 375 384 10.1007/978-981-13-9714-1_41 Search in Google Scholar

Zhang Jianwei, Tian Xingke, Duan Qian, Design and implementation of vehicle terminal graphic interface based on QT. Journal of Physics: Conference Series, v 1486, n 7, April 17, 2020. ZhangJianwei TianXingke DuanQian Design and implementation of vehicle terminal graphic interface based on QT Journal of Physics: Conference Series 1486 7 April 17 2020 10.1088/1742-6596/1486/7/072010 Search in Google Scholar

Du Haiming, Design of Vehicle Remote Monitoring System Based on LoRa Technology and QT Platform. Communications in Computer and Information Science, 2020,1252, pp. 449–460. DuHaiming Design of Vehicle Remote Monitoring System Based on LoRa Technology and QT Platform Communications in Computer and Information Science 2020 1252 449 460 10.1007/978-981-15-8083-3_40 Search in Google Scholar

Han Gaining, Li Yongfeng, Gao Yiteng, Design and Development of MySQL Database Based on Embedded Qt. Microcomputer Applications, 2020, 36 (05), pp. 25–27. HanGaining LiYongfeng GaoYiteng Design and Development of MySQL Database Based on Embedded Qt Microcomputer Applications 2020 36 05 25 27 Search in Google Scholar

Ni Jianyun, Xie Shuzhi, Li Zihao, Jia Chao, Optimization design method of cache extension in MySQL database. Proceedings of 2018 IEEE International Conference on Mechatronics and Automation, ICMA 2018, pp. 2295–2299. NiJianyun XieShuzhi LiZihao JiaChao Optimization design method of cache extension in MySQL database Proceedings of 2018 IEEE International Conference on Mechatronics and Automation ICMA 2018 2295 2299 10.1109/ICMA.2018.8484346 Search in Google Scholar

Balabanova, Ivelina Stefanova, Georgiev, Georgi Ivanov, Kostadinova, Stela Savova, WEB Design of Digital Filters in LabVIEW and Connection with MSSQL and MySQL Databases. 2018 IEEE 27th International Scientific Conference Electronics, ET 2018 – Proceedings. BalabanovaIvelina Stefanova GeorgievGeorgi Ivanov KostadinovaStela Savova WEB Design of Digital Filters in LabVIEW and Connection with MSSQL and MySQL Databases 2018 IEEE 27th International Scientific Conference Electronics, ET 2018 – Proceedings 10.1109/ET.2018.8549665 Search in Google Scholar

Recommended articles from Trend MD

Plan your remote conference with Sciendo