6#ifndef iqtinsp_CGeneralSupplierGuiComp_included
7#define iqtinsp_CGeneralSupplierGuiComp_included
11#include <QtCore/QTimer>
17#include <GeneratedFiles/iinspgui/ui_CGeneralSupplierGuiComp.h>
24template <
class UI = Ui::CGeneralSupplierGuiComp>
52 if (supplierPtr !=
nullptr) {
61 BaseClass::GetQtWidget(),
63 QObject::tr(
"Processing Error"));
65 if (BaseClass::AutoTestButton->isChecked()) {
66 BaseClass::AutoTestButton->setChecked(
false);
78 Q_ASSERT(BaseClass::IsGuiCreated());
80 return BaseClass::ParamsFrame;
87 if (BaseClass::IsGuiCreated() && BaseClass::AutoTestButton->isChecked()) {
88 QTimer::singleShot(1,
this, SLOT(on_TestButton_clicked()));
98 BaseClass::OnGuiModelAttached();
100 bool isLoadSupported = BaseClass::IsLoadParamsSupported();
101 bool isSaveSupported = BaseClass::IsSaveParamsSupported();
102 bool isEditSupported = BaseClass::AreParamsEditable();
104 BaseClass::ParamsGB->setVisible(isEditSupported || isLoadSupported);
106 BaseClass::LoadParamsButton->setVisible(isLoadSupported);
107 BaseClass::SaveParamsButton->setVisible(isSaveSupported);
114 BaseClass::AutoTestButton->setChecked(
false);
116 BaseClass::OnGuiHidden();
123 BaseClass::UpdateGui(changeSet);
125 Q_ASSERT(BaseClass::IsGuiCreated());
127 BaseClass::UpdateVisualStatus();
129 QString statusLabelText = BaseClass::tr(
"Unknown");
133 if (supplierPtr !=
nullptr) {
134 BaseClass::UpdateAllViews();
137 if (infoProviderPtr !=
nullptr) {
142 BaseClass::StatusLabel->setText(BaseClass::m_visualStatus.GetStatusText());
143 if (!description.isEmpty()) {
144 BaseClass::DescriptionLabel->setText(description);
145 BaseClass::DescriptionLabel->setVisible(
true);
148 BaseClass::DescriptionLabel->setVisible(
false);
164 I_ASSIGN(m_showResultStatusFrameAttrPtr,
"ShowResultStatusFrame",
"If enabled, show result status group box on the bottom of the view",
true,
true);
179 I_ATTR(
bool, m_showResultStatusFrameAttrPtr);
Base interface for suppliers providing calculating of objects on demand ("pull data" model).
virtual void InvalidateSupplier()=0
Called to signalize that this supplier is invalid.
virtual int GetWorkStatus() const =0
Get status of last work.
@ WS_FAILED
Work couldn't be done.
virtual void EnsureWorkInitialized()=0
Force the supplier to initialize its work.
virtual void EnsureWorkFinished()=0
Ensure that all objects are produced.
Default implementation of the supplier's UI.
void on_SaveParamsButton_clicked()
void on_LoadParamsButton_clicked()
void OnGuiCreated() override
Called just after GUI is initialized.
void on_TestButton_clicked()
TGeneralSupplierGuiComp BaseClass
CGeneralSupplierGuiComp()
virtual void OnGuiHidden()
Called from widget event filter when slave widget is hidden.
virtual QWidget * GetParamsWidget() const
virtual void UpdateGui(const istd::IChangeable::ChangeSet &changeSet)
TSupplierGuiCompBase< UI > BaseClass
virtual void OnGuiModelAttached()
virtual void OnSupplierParamsChanged()
Help class which provides the group of changes for update mechanism of the model.
Set of change flags (its IDs).
Contains Qt based implementations of inspection classes and components.