Otwarty dostęp

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


Zacytuj

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.

eISSN:
2444-8656
Język:
Angielski
Częstotliwość wydawania:
Volume Open
Dziedziny czasopisma:
Life Sciences, other, Mathematics, Applied Mathematics, General Mathematics, Physics