XNSim/XNMonitor/ModelStatusWidget/ModelStatusWidget.h

176 lines
4.0 KiB
C
Raw Normal View History

2025-04-28 12:25:20 +08:00
/**
* @file ModelStatusWidget.h
* @author jinchao
* @brief
* @version 1.0
* @date 2025-03-10
*
* @copyright Copyright (c) 2025 COMAC
*
*/
#pragma once
#include <QWidget>
#include <QSplitter>
#include <QTableWidget>
#include <QVector>
#include "../TypeDefine.h"
#include "ModelInfoUpdateThread.h"
#include "../SystemStatusWidget/SystemStatusWidget.h"
/**
* @brief
*/
class ModelStatusWidget : public QWidget
{
Q_OBJECT
public:
/**
* @brief
* @param parent
* @param systemStatusWidget
*/
ModelStatusWidget(QWidget *parent = nullptr, SystemStatusWidget *systemStatusWidget = nullptr);
/**
* @brief
*/
~ModelStatusWidget();
signals:
/**
* @brief
*/
void updateModelCutomPlotData();
/**
* @brief 线
*/
void controlModelInfoThread(bool bActive);
public slots:
/**
* @brief
* @param index
*/
void onSetCurrentTabIndex(int index);
/**
* @brief
* @param newXData X数据
* @param newYData Y数据
*/
void updatePlotData(const QVector<double> &newXData, const QVector<double> &newYData);
/**
* @brief /线
*/
void toggleThreadInfo();
/**
* @brief 线
* @param threadID 线ID
* @param data 线
*/
void updateThreadInfoPage(unsigned int threadID, const XNRuntimeData &data);
/**
* @brief
*/
void onModelStatusTableSelectionChanged();
/**
* @brief
* @param data
*/
void updateModelData(const XNRuntimeData &data);
/**
* @brief
* @param pos
*/
void showChartContextMenu(const QPoint &pos);
/**
* @brief
*/
void onShowFrequency();
/**
* @brief
*/
void onShowPeriod();
private:
/**
* @brief 线
*/
void InitialModelInfoThread();
/**
* @brief
*/
void setupTabModelStatus();
/**
* @brief
* @param splitter
*/
void setupTabModelStatusLeftPanel(QSplitter *splitter);
/**
* @brief 线
* @param threadID 线ID
* @return 线
*/
QWidget *createThreadInfoPage(unsigned int threadID);
/**
* @brief 线
* @param threadID 线ID
* @param index
* @param newValue
*/
void updateThreadInfoValue(unsigned int threadID, int index, const QString &newValue);
/**
* @brief
* @param splitter
*/
void setupTabModelStatusRightPanel(QSplitter *splitter);
/**
* @brief
* @param tableWidget
*/
void setupModelStatusTableWidget(QTableWidget *tableWidget);
/**
* @brief
* @param chartWidget
*/
void setupModelStatusChartWidget(QWidget *chartWidget);
/**
* @brief
* @param data
* @param rowIndex
*/
void updateModelTableData(const XNRuntimeData &data, int rowIndex);
/**
* @brief
* @param str
* @param count
* @return
*/
int extractTrailingNumbers(const QString &str, int count);
private:
/**
* @brief
*/
int freqOrPeriodIndex = 0;
/**
* @brief
*/
int currentTabIndex = 0;
/**
* @brief
*/
QVector<XNRuntimeData> modelDataVec;
/**
* @brief 线
*/
ModelInfoUpdateThread *modelThread;
/**
* @brief
*/
QMutex mutex;
/**
* @brief
*/
SystemStatusWidget *systemStatusWidget;
};