1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
/* Copyright (c) 2020, Dyssol Development Team. All rights reserved. This file is part of Dyssol. See LICENSE file for license information. */
#pragma once
#include "ui_BasicStreamEditor.h"
#include "SolidDistributionsEditor.h"
#include "MDMTable.h"
#include "DDTable.h"
class CFlowsheet;
class CBasicStreamEditor : public QWidget
{
Q_OBJECT
private:
Ui::CBasicStreamEditorClass ui;
// TODO: make it const
CFlowsheet* m_pFlowsheet; // pointer to the flowsheet
CMaterialsDatabase* m_materialsDB; // pointer to a materials database
bool m_bAvoidSignal;
CBaseStream* m_pSelectedHoldup; // pointer to the selected stream
CDDTable* m_pDDTableMTP;
CDDTable* m_pDDTablePhase;
std::vector<CMDMTable*> m_vMDMTablePhases;
CSolidDistributionsEditor* m_pSolidDistrEditor;
// for save/restore view
int m_nLastTab;
int m_nLastTime;
std::vector<int> m_vLastCombos;
std::vector<int> m_vLastSliders;
public:
CBasicStreamEditor(QWidget *parent = Q_NULLPTR);
void SetFlowsheet(CFlowsheet* _pFlowsheet, CMaterialsDatabase* _materialsDB);
void SetStream(CBaseStream* _pStream);
void SetEditable(bool _bEditable); // Turn on/off edit possibility.
void UpdateWholeView();
private slots:
void setVisible(bool _bVisible) override;
void ChangeData();
private:
void InitializeConnections();
void UpdateTabs();
void UpdateTabContent(); // update content of the multitab widget
void UpdateStreamMTPTab(); // updates content of the first tab
void UpdatePhaseFractionsTab();
void UpdatePhaseTab(unsigned _nIndex);
void UpdateDistributionTab();
void UpdateTimePointsTable(); // update the table where all time points are shown
void AddTimePoint();
void RemoveTimePoint();
void RemoveAllTimePoints();
void ChangeTimePoint();
void TimePointsPasted();
void TableTimeChanged(int _nRow, int _nCol, int _nPrevRow, int _nPrevCol);
void SetControlsActivity(bool _bActive);
void SaveViewState();
void LoadViewState();
signals:
void DataChanged(); // some information in holdup have been changed
};
|