Air defense weapon equipment fault diagnosis method based on Qt development platform
Through the fault diagnosis method based on the Qt development platform, multi-threaded processing and data analysis algorithms are used to label abnormal data points, solving the problem of quickly finding abnormal data in multi-function artillery research and development, achieving efficient and accurate equipment fault diagnosis, and shortening the R&D cycle.
Patent Information
- Application Number
- CN202510334579.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-07-11
AI Technical Summary
During the development and debugging of multi-function artillery, how to quickly find abnormal data from a large amount of data to reduce development cycles and improve equipment error accuracy.
The fault diagnosis method based on the Qt development platform is adopted, and the QFile and QTextStream classes are used to read the operation data of air defense weapons, and the standard data is obtained through multi-threading and data analysis algorithms, and the qcustommplot class is used to draw a line graph to mark an exception data point.
It realizes cross-platform support, low resource consumption, convenient and intelligent fault diagnosis, can efficiently utilize system resources and intuitively display results, shorten the R&D cycle of new artillery weapons, and improves the accuracy of equipment error handling.
Smart Images

Figure CN120295893A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of fault diagnosis, and more specifically, relates to a fault diagnosis method for air defense weapon equipment based on the Qt development platform. Background Art
[0002] In modern warfare, the types and performances of air raid targets are diverse. Therefore, relying solely on a certain weapon cannot fully achieve effective air defense. It is necessary to comprehensively use various air defense weapons to build a complete air defense system with long, medium, and short ranges, and high, medium, and low altitudes for multi-layer interception to achieve effective air defense purposes. Multifunctional artillery has the characteristics of simple structure, long range, and high cost-effectiveness. If a search system, a tracking system, and a fire control system are added to the existing artillery, a new type of weapon and equipment can be added to the air defense and anti-missile system, greatly improving and enhancing the ability of terminal air defense and anti-missile. Artillery air defense can form a complete terminal air defense and anti-missile firepower network together with small-caliber self-propelled anti-aircraft guns, missile-gun combination systems, and short-range terminal air defense missile weapons, further improving the current short-range terminal air defense and anti-missile system and enhancing the terminal air defense and anti-missile ability. At present, a large amount of data will be generated during the research, development, and debugging of multifunctional artillery. How to quickly find abnormal data from a large amount of data has become a difficult problem. The air defense weapon data diagnosis method based on the QT development platform can process the complex data in the multifunctional artillery operation file into standard data, and draw a line chart to visually display the standard data. The equipment error correction algorithm can mark the abnormal data points on the line chart. This is of great significance for reducing the development cycle of multifunctional artillery and improving the accuracy of equipment error correction. Summary of the Invention
[0003] The purpose of the present invention is to provide a fault diagnosis method for air defense weapon equipment based on the Qt development platform, which processes and searches for abnormal data in a large number of data files generated during the operation of air defense weapons, so as to find faulty equipment, increase the accuracy of abnormal data query, and shorten the research and development cycle of new artillery weapons.
[0004] The technical solution for realizing the purpose of the present invention is as follows:
[0005] A fault diagnosis method for air defense weapons based on the Qt development platform, comprising:
[0006] Step 1, use the QFile and QTextStream classes in QT to open a file selection dialog box, select the air defense weapon operation data storage file, read the status data of each device during the operation of the air defense weapon from the storage file, and store it in the InData array;
[0007] Step 2: Create the MyThread class and inherit from the QThread class. Override the run() function of the QThread class to create a child thread and run the data processing in the child thread;
[0008] Step 3: Judge the data source entering the run() function. After determining the data source, use the data parsing algorithm to further process the data to obtain the standard data;
[0009] Step 4: According to the data processing result in Step 3, use the qcustomplot class to draw a data line chart. The x-axis shows the time when the air defense weapon is running, and the y-axis shows the standard data obtained after the data parsing algorithm;
[0010] Step 5: Use the data error correction algorithm to mark the abnormal data on the line chart drawn in Step 4 for the staff to quickly find the faulty equipment.
[0011] Compared with the prior art, the remarkable advantages of the present invention are:
[0012] (1) The present invention uses QT as the implementation means, which has good cross-platform support compared with other traditional implementation means, and has higher performance and lower resource consumption;
[0013] (2) The present invention is more convenient and intelligent compared with other fault diagnosis methods;
[0014] (3) The present invention combines multi-threading with qcustomplot drawing, which can efficiently utilize system resources and intuitively display the results. Description of the Drawings
[0015] Figure 1 It is a flow chart of an air defense weapon fault diagnosis method based on the Qt development platform.
[0016] Figure 2 It is a flow chart for reading the air defense weapon data file in the present invention.
[0017] Figure 3 It is a flow chart for creating a child thread in the present invention.
[0018] Figure 4 It is a flow chart for data processing in the present invention.
[0019] Figure 5 It is a flow chart for drawing a line chart in the present invention.
[0020] Figure 6 It is a flow chart for the data error correction algorithm in the present invention.
[0021] Figure 7 It is the overall architecture diagram of the present invention. Detailed implementation manners
[0022] The following describes the detailed implementation manners of the present invention with reference to the accompanying drawings, so that those skilled in the art can better understand the present invention. It should be particularly noted that in the following description, when the detailed descriptions of known functions and designs may dilute the main content of the present invention, these descriptions will be ignored here.
[0023] Refer to Figures 1 to 7 , a remote control method for air defense weapons based on the Qt development platform is described for the specific implementation manners of the present invention, including the following steps:
[0024] Step 1, the present invention first needs to introduce the QFile and QTextStream classes in QT. Use the QFile class to instantiate an object, and use the open() method to open the file selection dialog to select the file storing the operation data of the air defense weapon. After opening the file, use the QTextStream class to instantiate an object, and use the readAll() method to store the data in the file into an array InData of the QStringList type. Subsequently, use the count() method to calculate the size of the InData array, and traverse the entire array according to the array size. In each traversal, use the split(",") method to separate the cells in each column of the data with ",", and store them in an array strLine of the QStringList type.
[0025] Step 2, in the Qt framework, multi-threaded programming is implemented through the QThread class. The QThread class provides a high-level, object-oriented way to handle threads. It allows developers to separate time-consuming tasks from the main thread (GUI thread) to avoid freezing the interface and improve the responsiveness of the application. The air defense weapon data file contains millions or even tens of millions of lines of data. Placing complex data processing in a child thread can not interfere with the normal operation of the main thread. Therefore, create a MyThread class file and inherit from the QThread class, and override the run() function in the QThread class. First, create the MyThread class, and use the public keyword to inherit from the QThread class. In the MyThread.cpp file, use void Mythread::run() to define the run() function, and write a data processing algorithm in the run() function to override it. The data read in Step 1 is passed into the run() function, and the data source is queried and the queried data is processed in the run() function to obtain standard data.
[0026] Step 3, determine the data source entering the run() function. Use the if-else statement to complete the judgment of the data source. If if(strLine.at(indexOfID) == "0x055c5e00") holds, then enter the soft time statistics module. The data sources include soft time statistics, fire control launch control, servo equipment data, optoelectronic miss distance data, servo master command azimuth data, servo master command elevation, optoelectronic equipment data, laser distance, vehicle body data, and radar equipment data. After determining the data source, use the data parsing algorithm to further process the data to obtain standard data. The data parsing algorithm specifically includes the following steps:
[0027] (1) If if(strLine.at(indexOfID) == "0x055c5e00") holds, then enter the soft time statistics module according to the judgment result. This module defines two regular expressions of the QRegExp type to remove the "x\" prefix and spaces in the data. After removing the redundant characters, use the left() method to extract the two leftmost characters in the string, and then use the toInt() method to convert the hexadecimal data to decimal data.
[0028] (2) If if(strLine.at(indexOfID) == "0x055c5e01") holds, then enter the fire control launch control module according to the judgment result. This module requires an input of the QString type and uses the data of the QString type to store the data. Define two regular expressions of the QRegExp type to remove the "x\" character prefix and spaces in the data. Subsequently, use the remove() method to delete the first two character data in the data. After removing the first two characters in the data, define an int-type intermediate variable val and an int-type array myarray with a length of 1. Convert the first two character data in the data from hexadecimal to decimal and assign it to val. Finally, assign val to the myarray array.
[0029] (3) If if (strLine.at(indexOfID) == "0x055c5e02") holds, enter the slave device data module according to the determination result. This module requires an input of QString type and uses QString type data to store data. Two regular expressions of QRegExp type are defined to remove the leading "x\" characters and spaces in the data. An int-type intermediate variable val and an int-type array myarray with a length of 2 are defined. First, convert the first two-character data of data from hexadecimal to decimal and assign it to val, then assign val to the first element of myarray. Use the remove() method to delete the first two-character data of data. Subsequently, convert the first two-character data of data from hexadecimal to decimal and assign it to val, and then calculate the slave azimuth data using the following formula. Where d1 represents the slave azimuth data, a1 represents the value of the first element of the myarray array, and b1 represents the intermediate variable val.
[0030]
[0031] After calculating the slave azimuth, if the slave azimuth is greater than 3000 at this time, it needs to be subtracted by 6000, and the finally obtained slave azimuth data is reassigned to the first element of myarray. On this basis, use the remove() method to delete the first two-character data of data, convert the first two-character data of data from hexadecimal to decimal and assign it to val, then assign val to the second element of the myarray array. Then delete the first two-character data of data, convert the first two-character data of data from hexadecimal to decimal and assign it to val, and then calculate the slave elevation data using the following formula. Where d2 represents the slave elevation data, a2 represents the value of the second element of the myarray array, and b2 represents the intermediate variable val.
[0032]
[0033] After calculating the azimuth, if the slave elevation is greater than 3000 at this time, it needs to be subtracted by 6000, and the finally obtained slave elevation data is reassigned to the second element of myarray. Finally, return the myarray array as the return value of the function.
[0034] (4) If if (strLine.at(indexOfID) == "0x055c5e04") holds, enter the optoelectronic miss distance data module according to the determination result. This module requires an input of QString type and uses QString type data to store data. Two regular expressions of QRegExp type are defined to remove the leading "x\" characters and spaces in the data. An int type intermediate variable val and an int type array myarray with a length of 3 are defined. First, convert the first two characters of the data from hexadecimal to decimal and assign it to val, then assign val to the first element of myarray. Use the remove() method to delete the first two characters of the data, then convert the first two characters of the data from hexadecimal to decimal and assign it to val, and then calculate the optoelectronic azimuth miss distance data using the following formula. Where d3 represents the optoelectronic azimuth miss distance data, a3 represents the value of the first element of the myarray array, and b3 represents the intermediate variable val.
[0035]
[0036] After calculating the azimuth, if the optoelectronic azimuth miss distance is greater than 3000 at this time, it needs to be subtracted by 6000, and the finally obtained optoelectronic azimuth miss distance data is reassigned to the first element of myarray. On the above basis, use the remove() method to delete the first two characters of the data, convert the first two characters of the data from hexadecimal to decimal and assign it to val, and then assign val to the second element of the myarray array. Then delete the first two characters of the data, convert the first two characters of the data from hexadecimal to decimal and assign it to val, and then calculate the optoelectronic elevation miss distance data using the following formula. Where d4 represents the optoelectronic elevation miss distance data, a4 represents the value of the second element of the myarray array, and b4 represents the intermediate variable val.
[0037]
[0038] After calculating the optoelectronic elevation miss distance, if the optoelectronic elevation miss distance is greater than 3000 at this time, it needs to be subtracted by 6000, and the finally obtained optoelectronic elevation miss distance data is reassigned to the second element of myarray. Then use the remove() method to delete the first eight characters of the data, convert the first two characters of the data from hexadecimal to decimal and assign it to the third element of the myarray array. Finally, return the myarray array as the return value of the function.
[0039] (5) If if (strLine.at(indexOfID) == "0x055c5e05") holds, enter the follow-up master command azimuth data module according to the determination result. This module requires an input of QString type and uses QString type data to store data. Two regular expressions of QRegExp type are defined to remove the leading "x\" characters and spaces in the data. An intermediate variable val of int type and an int array myarray with a length of 1 are defined. First, convert the first two characters of the data from hexadecimal to decimal and assign it to val, then assign val to the first element of myarray. Use the remove() method to delete the first two characters of the data, then convert the first two characters of the data from hexadecimal to decimal and assign it to val, and then calculate the follow-up master command azimuth data using the following formula.
[0040]
[0041] Where d5 represents the follow-up master command azimuth data, a5 represents the value of the first element of the myarray array, and b5 represents the intermediate variable val. After calculating the azimuth, if the follow-up master command azimuth is greater than 3000 at this time, it needs to be subtracted by 6000, and the finally obtained follow-up master command azimuth data is reassigned to the first element of myarray. Finally, the myarray array is used as the return value of the function.
[0042] (6) If if (strLine.at(indexOfID) == "0x055c5e06") holds, enter the follow-up master command height module according to the determination result. This module requires an input of QString type and uses QString type data to store data. Two regular expressions of QRegExp type are defined to remove the leading "x\" characters and spaces in the data. An intermediate variable val of int type and an int array myarray with a length of 1 are defined. First, convert the first two characters of the data from hexadecimal to decimal and assign it to val, then assign val to the first element of myarray. Use the remove() method to delete the first two characters of the data, then convert the first two characters of the data from hexadecimal to decimal and assign it to val, and then calculate the follow-up master command height data using the following formula.
[0043]
[0044] Among them, d6 represents the follow-up master command high and low data, a6 represents the value of the first element of the myarray array, and b6 represents the intermediate variable val. After calculating the azimuth, if the follow-up master command azimuth is greater than 3000 at this time, it is necessary to subtract 6000 from it, and reassign the finally obtained follow-up master command high and low data to the first element of myarray. Finally, return the myarray array as the return value of the function.
[0045] (7) If if(strLine.at(indexOfID) == "0x055c5e07") holds, enter the optoelectronic device data module according to the determination result. The data processing method of this module is the same as the process in (4).
[0046] (8) If if(strLine.at(indexOfID) == "0x055c5e08") holds, enter the laser distance module according to the determination result. This module requires an input of QString type and uses QString type data to store data. Two QRegExp type regular expressions are defined to remove the leading "x\" character and spaces in the data. An int type intermediate variable val and an int type array myarray with a length of 1 are defined. The first two character data of the data are converted from hexadecimal to decimal and then assigned to val and myarray. Subsequently, the remove() method is used to delete the first two character data of the data. After converting the first two character data of the data from hexadecimal to decimal and assigning it to val, the following formula is used to calculate the laser distance.
[0047] d7 = a7 + 256b7
[0048] Among them, d7 represents the laser distance data, a7 represents the value of the first element of the myarray array, and b7 represents the intermediate variable val. Finally, return the myarray array as the return value of the function.
[0049] (9) If if(strLine.at(indexOfID) == "0x055c5e09") holds, enter the vehicle body data module according to the determination result. This module requires an input of QString type and uses QString type data to store data. Two QRegExp type regular expressions are defined to remove the leading "x\" characters and spaces in the data. An int type intermediate variable val and an int type array myarray with a length of 3 are defined. First, convert the first two characters of the data from hexadecimal to decimal and assign it to val. Then use the number() method of the QString class to convert val to a QString type in decimal, and then use the toInt() method to convert val to an int type in decimal. Subsequently, assign val to the first element of myarray. Use the remove() method to delete the first two characters of the data. Convert the first two characters of the data from hexadecimal to decimal and assign it to val. Then use the number() method of the QString class to convert val to a QString type in decimal, and then use the toInt() method to convert val to an int type in decimal. Calculate the vehicle body heading angle data using the following formula.
[0050]
[0051] Where d8 represents the vehicle body heading angle data, a8 represents the value of the first element of the myarray array, and b8 represents the intermediate variable val. After calculating the azimuth, if the vehicle body heading angle is greater than 3000 at this time, it needs to be subtracted by 6000, and the finally obtained vehicle body heading angle data is reassigned to the first element of myarray. On the above basis, use the remove() method to delete the first two characters of the data. Convert the first two characters of the data from hexadecimal to decimal and assign it to val. Then use the number() method of the QString class to convert val to a QString type in decimal, and then use the toInt() method to convert val to an int type in decimal. Subsequently, assign val to the second element of myarray. Use the remove() method to delete the first two characters of the data. Convert it to decimal and assign it to val. Then use the number() method of the QString class to convert val to a QString type in decimal, and then use the toInt() method to convert val to an int type in decimal. Calculate the vehicle body pitch angle data using the following formula.
[0052]
[0053] Among them, d9 represents the vehicle body pitch angle data, a9 represents the value of the second element of the myarray array, and b9 represents the intermediate variable val. After calculating the azimuth, if the vehicle body pitch angle is greater than 3000 at this time, it is necessary to subtract 6000 from it, and reassign the finally obtained vehicle body pitch angle data to the second element of myarray. On this basis, use the remove() method to delete the first two character data of data, convert the first two character data of data from hexadecimal to decimal and assign it to val, then use the number() method of the QString class to change val to a QString type in decimal, and then use the toInt() method to change val to an int type data in decimal. Subsequently, assign val to the second element of myarray. Use the remove() method to delete the first two character data of data, convert it to decimal and assign it to val, then use the number() method of the QString class to change val to a QString type in decimal, and then use the toInt() method to change val to an int type data in decimal. Calculate the vehicle body roll angle data using the following formula.
[0054]
[0055] Among them, d 10 represents the vehicle body roll angle data, a 10 represents the value of the third element of the myarray array, b 10 represents the intermediate variable val. After calculating the roll angle data, if the vehicle body roll angle is greater than 3000 at this time, it is necessary to subtract 6000 from it, and reassign the finally obtained vehicle body roll angle data to the third element of myarray. Finally, return the myarray array as the return value of the function.
[0056] (10) If if(strLine.at(indexOfID) == "0x055c5e10") holds, enter the radar device data module according to the determination result. This module requires an input of QString type and uses QString type data to store data. Two regular expressions of QRegExp type are defined to remove the "x\" character prefix and spaces in data. Define an int-type intermediate variable val and a float-type array myarray with a length of 5. First, convert the first two character data of data from hexadecimal to decimal and assign it to val and the first element of myarray. Use the remove() method to delete the first two character data of data, then convert the first two character data of data from hexadecimal to decimal and assign it to val, and then calculate the radar azimuth data using the following formula.
[0057]
[0058] where d 11 represents the radar azimuth data, a 11 represents the value of the first element of the myarray array, b 11 represents the intermediate variable val. After calculating the radar azimuth data, if the radar azimuth data is greater than 3000 at this time, it needs to be subtracted by 6000, and the finally obtained radar azimuth data is reassigned to the first element of myarray. On this basis, use the remove() method to delete the first two character data of data, convert the first two character data of data from hexadecimal to decimal and assign it to val and the second element of myarray, use the remove() method to delete the first two character data of data, convert the first two character data of data from hexadecimal to decimal and assign it to val, and then use the following formula to calculate the radar elevation data.
[0059]
[0060] where d 12 represents the vehicle roll angle data, a 12 represents the value of the second element of the myarray array, b 12 represents the intermediate variable val. After calculating the radar elevation data, if the radar elevation data is greater than 3000 at this time, it needs to be subtracted by 6000, and the finally obtained radar elevation data is reassigned to the second element of myarray. On this basis, use the remove() method to delete the first two character data of data, convert the first two character data of data from hexadecimal to decimal and assign it to val and the third element of myarray, use the remove() method to delete the first two character data of data, use the left() method to take out the leftmost two characters of data, use the right() method to take out the rightmost one character from these two characters, and then convert it from hexadecimal to decimal, and finally use the following formula to calculate the track distance data.
[0061] d 13 =a 13 +256b 13
[0062] where d 13 represents the track distance data, a 13 represents the value of the third element of the myarray array, b 13Represents the intermediate variable val. Reassign the finally obtained track distance data to the third element of myarray. On the above basis, use the left() method to extract the leftmost character of data and assign it to val and the fourth element of myarray. Use the remove() method to delete the first two character data of data. Convert the leftmost two characters of data from hexadecimal to decimal and assign it to val. Finally, calculate the track speed data using the following formula.
[0063] d 14 = 256a 14 + b 14
[0064] where d 13 represents the track speed data, a 13 represents the value of the fourth element of the myarray array, and b 13 represents the intermediate variable val. Reassign the finally obtained track speed data to the fourth element of myarray. On the above basis, use the remove() method to delete the first two character data of data. Use the left() method to extract the leftmost two characters of data and convert them from hexadecimal to decimal and assign them to the fifth element of myarray, which is the track guidance data. Finally, return the myarray array as the return value of the function.
[0065] Step 4, add the qcustomplot.cpp and qcustomplot.h files in this project to draw a line chart. Add a QWidget in the ui file and promote it to QCustomPlot. Use the xAxis->setLabel() method to set the x-axis name, and use the yAxis->setLabel() method to set the y-axis name. Use graph()->setPen() to add the radar azimuth, radar elevation, optoelectronic main command azimuth, optoelectronic main command elevation, follow-up main command azimuth, follow-up main command elevation, follow-up azimuth, follow-up elevation, optoelectronic tracking status, optoelectronic azimuth miss distance, optoelectronic elevation miss distance, laser distance, optoelectronic turret status, track speed, track distance, track guidance flag, soft timekeeping system, vehicle heading angle, vehicle pitch angle, vehicle roll angle, and fire control launch control drawing objects to the QWidget canvas. Use the addData() method to draw the processing results of Step 3 on the canvas. The x-axis shows the time when the air defense weapon is operating, and the y-axis shows the standard data obtained after the data parsing algorithm.
[0066] According to the data processing results in step 3, if the data source of this traversal is the soft time synchronization module, use emit to send a signal to the signalRST() slot function to trigger the drawing operation. If the data source of this traversal is the fire control launch control module, use emit to send a signal to the signalHKFS() slot function to trigger the drawing operation. If the data source of this traversal is the servo device data module, use emit to send signals to signalSD_Fw() and signalSD_Gd() respectively to trigger the drawing operation. If the data source of this traversal is the optoelectronic miss distance data module, use emit to send signals to signalGDGZ_Fw(), signalGDGZ_Gd(), and signalGDGZ_Flag() respectively to trigger the drawing operation. If the data source of this traversal is the servo master command azimuth data module, use emit to send a signal to the signalSDZL_Fw() to trigger the drawing operation. If the data source of this traversal is the servo master command elevation module, use emit to send a signal to the signalSDZL_Gd() to trigger the drawing operation. If the data source of this traversal is the optoelectronic device data module, use emit to send signals to signalGDZL_Fw(), signalGDZL_Gd(), and signalGDZL_Status() respectively to trigger the drawing operation. If the data source of this traversal is the laser distance module, use emit to send a signal to the signalJGJL() to trigger the drawing operation. If the data source of this traversal is the vehicle body data module, use emit to send signals to signalCT_Hangxiang(), signalCT_Zongyao(), and signalCT_Henggun() respectively to trigger the drawing operation. If the data source of this traversal is the radar device data module, use emit to send signals to signalLD_Fw(), signalLD_Gd(), signalHJ_Speed(), signalHJ_Distance(), and signalHJ_Flag() respectively to trigger the drawing operation.
[0067] Step 5, use the data error correction algorithm to mark the abnormal data on the line chart drawn in step 4. The data error correction algorithm will first judge whether the data is greater than 3000 and less than -3000. If the data is greater than 3000 or less than -3000, the flag bit of this data will be changed to -1. If the absolute value of the difference between the data at the previous moment and the current moment is greater than 200 or the absolute value of the difference between the current moment data and the data at the next moment is greater than 200, the flag bit of the current moment data will also be changed to -1. The specific judgment formula is as follows, where flag represents the flag bit of the current data, x pIndicates the data of the previous moment, x represents the data of the current moment, x q The data of the next moment. If, for the data of two different modules in the same batch of data (such as follow-up azimuth data, photoelectric azimuth miss distance data), the absolute value of the difference between the data of the previous moment and the data of the current moment is greater than 200 or the absolute value of the difference between the data of the current moment and the data of the next moment is greater than 200, then it will be determined that the data is in the change stage at this time, and the flag bit of the data will not be changed to -1.
[0068]
[0069] After judging the data anomaly situation, use the setPen(QPen(Qt::red)) method to mark the data in red so that the staff can quickly find the faulty device and the time when the fault occurred.
Claims
1. A fault diagnosis method for air defense weapons based on the Qt development platform, characterized in that, Including: Step 1: Use the QFile and QTextStream classes in QT to open a file selection dialog, select the storage file for the operation data of air defense weapons, read out the status data of each device during the operation of air defense weapons from the storage file, and store it in the InData array; Step 2: Create a MyThread class and inherit from the QThread class, override the run() function of the QThread class, create a child thread, and run the data processing in the child thread; Step 3: Judge the data source of the data entering the run() function. After determining the data source, use a data parsing algorithm to further process the data to obtain standard data; Step 4: According to the data processing result of Step 3, use the qcustomplot class to draw a data line chart. The x-axis shows the time during the operation of air defense weapons, and the y-axis shows the standard data obtained after the data parsing algorithm; Step 5: Use a data error correction algorithm to mark abnormal data on the line chart drawn in Step 4 for the staff to quickly find the faulty device.
2. The air defense weapon fault diagnosis method based on the Qt development platform according to claim 1, characterized in that In Step 2, first create a MyThread class, inherit from the QThread class using the public keyword, define the run() function using void Mythread::run() in the MyThread.cpp file, and place the data processing in the overridden run() function.
3. The air defense weapon fault diagnosis method based on the Qt development platform according to claim 1, characterized in that The data sources include soft time system, fire control launch control, servo device data, optoelectronic miss distance data, servo command azimuth data, servo command elevation, optoelectronic device data, laser distance, vehicle body data, and radar device data; use if-else statements to complete the judgment of the data source, and enter the soft time system module, fire control launch control module, servo device data module, optoelectronic miss distance data module, servo command azimuth data module, servo command elevation module, optoelectronic device data module, laser distance module, vehicle body data module, and radar device data module respectively according to the judgment result, and convert the data from hexadecimal to standard decimal.
4. The fault diagnosis method of air defense weapons based on the Qt development platform according to claim 3, characterized in that If the data source for the current traversal is the soft time synchronization module, use emit to send a signal to the signalRST() slot function to trigger the drawing operation; if the data source for the current traversal is the fire control launch control module, use emit to send a signal to the signalHKFS() slot function to trigger the drawing operation; if the data source for the current traversal is the servo device data module, use emit to send signals to signalSD_Fw() and signalSD_Gd() respectively to trigger the drawing operation; if the data source for the current traversal is the optoelectronic miss distance data module, use emit to send signals to signalGDGZ_Fw(), signalGDGZ_Gd(), and signalGDGZ_Flag() respectively to trigger the drawing operation; if the data source for the current traversal is the servo master command azimuth data module, use emit to send a signal to signalSDZL_Fw() to trigger the drawing operation; if the data source for the current traversal is the servo master command elevation module, use emit to send a signal to signalSDZL_Gd() to trigger the drawing operation; if the data source for the current traversal is the optoelectronic device data module, use emit to send signals to signalGDZL_Fw(), signalGDZL_Gd(), and signalGDZL_Status() respectively to trigger the drawing operation; if the data source for the current traversal is the laser distance module, use emit to send a signal to signalJGJL() to trigger the drawing operation; if the data source for the current traversal is the vehicle body data module, use emit to send signals to signalCT_Hangxiang(), signalCT_Zongyao(), and signalCT_Henggun() respectively to trigger the drawing operation; if the data source for the current traversal is the radar device data module, use emit to send signals to signalLD_Fw(), signalLD_Gd(), signalHJ_Speed(), signalHJ_Distance(), and signalHJ_Flag() respectively to trigger the drawing operation.
5. The fault diagnosis method for air defense weapons based on the Qt development platform according to claim 1, characterized in that, The data error correction algorithm first determines whether the data is greater than 3000 and less than -3000. If the data is greater than 3000 or less than -3000, the flag bit of the data will be set to -1. If the absolute value of the difference between the data at the previous moment and the data at the current moment is greater than 200, or the absolute value of the difference between the data at the current moment and the data at the next moment is greater than 200, the flag bit of the data at the current moment will also be set to -1.
6. The air defense weapon fault diagnosis method based on the Qt development platform according to claim 1, characterized in that After determining the data anomaly situation, use the setPen(QPen(Qt::red)) method to turn the data red.