logplus/ModuleConsole/include/SubmitWorkflowDialog.h

222 lines
5.5 KiB
C
Raw Normal View History

2026-01-16 17:18:41 +08:00
/**
* @file SubmitWorkflowDialog.h
* @brief
* @date 2014-12-10
*/
#ifndef PAI_FRAME_WORKFLOWVIEW_SUBMITWORKFLOWDIALOG_H_
#define PAI_FRAME_WORKFLOWVIEW_SUBMITWORKFLOWDIALOG_H_
#include "PaiDialog.h"
#include "Job.h"
#include <QCheckBox>
class QStackedWidget;
class QTableWidget;
namespace pai
{
namespace gui
{
class PaiPushButton;
class PaiLabel;
class PaiNameLineEdit;
class PaiCheckBox;
class PaiCollapsibleWidget;
}
}
namespace pai
{
namespace gui
{
/**
* @class SubmitWorkflowDialog
* @brief
*/
class SubmitWorkflowDialog : public PaiDialog
{
Q_OBJECT
public:
/**
* @brief
*/
struct ResItem
{
QString queueName; // 队列名称
QString mainTitle; // 主标题
QString totalTitle; // 总资源量标题
QString freeTitle; // 可用资源量标题
QString usedTitle; // 已经使用资源量标题
long total; // 总资源量
long used; // 已经使用资源量
long required; // 所需资源量
};
/**
* @brief
* @param[in] pParent
*/
SubmitWorkflowDialog(QWidget *pParent = NULL);
/**
* @brief
*/
virtual ~SubmitWorkflowDialog();
/**
* @brief map slot的资源信息
* @param[in] item
*/
void SetCpuItem(const ResItem& item);
/**
* @brief
* @param[in] item
*/
void SetStorageItem(const ResItem& item);
/**
* @brief
* @param[in] jobName
*/
void SetJobName(const QString& jobName);
/**
* @brief
* @return
*/
QString GetJobName();
/**
* @brief Widget
*/
void SetWidgets();
/**
* @brief
* @return
*/
pai::ios::job::JobPriority GetPriority();
/**
* @brief
* @return
*/
QString GetQueueName();
private slots:
/**
* @brief NormalRadioButton时触发
* @param[in] toggled true选中false取消选中
*/
void ToggleNormalRadio(bool toggled);
/**
* @brief SpecialRadioButton时触发
* @param[in] toggled true选中false取消选中
*/
void ToggleSpecialRadio(bool toggled);
/**
* @brief
*/
void ExpandAllSpecilaQueue();
/**
* @brief
*/
void CollapseAllSpecilaQueue();
/**
* @brief radioButton所在行
* @param[in] toggled true选中false取消选中
*/
void SelectCurrentRow(bool toggled);
/**
* @brief radioButton
*/
void SelectCurrentRadioBtn();
/**
* @brief checkBox选中
* @param[in] checked true选中false取消选中
*/
void SetPriority(int checked);
private:
/**
* @brief Widget
*/
void ClearCpuWidget();
/**
* @brief Widget
*/
void SetSpecialCpuWidget();
/**
* @brief
* @param[in] name
* @return
*/
ResItem GetSpecialQueueResItem(const QString& name);
/**
* @brief
* @return
*/
QList<ResItem> GetSpecialQueueResItems();
/**
* @brief Widget
*/
void SetCpuWidget();
/**
* @brief Widget
*/
void SetStorageWidget();
/**
* @brief item信息添加Widget
* @param[in] item
* @param[in] pIcon
*/
QWidget* AddItemWidget(const ResItem& item, PaiLabel *pIcon);
/**
* @brief continue状态
* @param[in] name
*/
void UpdateContinueBtn(const QString& name);
/**
* @brief
* @param[in] name
*/
ResItem GetCurrentItem(const QString& name);
private:
QWidget *m_pCpuWgt; //普通队列槽信息Widget显示容器
QWidget *m_pSpecialCpuWgt; //特殊队列槽信息Widget显示容器
QStackedWidget *m_pStack; //槽信息分页显示布局器
QWidget *m_pStorage; //配额信息Widget显示容器
PaiPushButton *m_pContinuePBtn; //continue按钮
PaiPushButton *m_pCancelPBtn; //Cancel按钮
PaiNameLineEdit *m_pJobNameEdit; //作业名称编辑框
ResItem m_cpuItem; //普通队列槽信息
ResItem m_storageItem; //配额信息
QCheckBox *m_priorityCheckBox; //作业优先级设置checkBox
PaiCollapsibleWidget *m_pExtendCtrl; //所有特殊队列展示控制控件
QTableWidget *m_pTable; //展示特殊队列的表格
pai::ios::job::JobPriority m_priority; //记录当前的作业优先级
QString m_currentSQueue; //当前队列名称
QList<ResItem> m_items; //特殊队列的槽资源信息
};
}
}
#endif