I do have summer time break but I learn anyway, and I don’t have on mind C++ only, I learn German as well 🙂 But I found some time to do some work by TDP calculator application. Namely I prepared all needet widgets, ProcessingModelWidget, HumidifyingTypeChoosingButtons, HumidifyingPointWidget and PointWidget.
ProcessingModelWidget class declaration:
class ProcessingModelWidget : public QGroupBox { Q_OBJECT public: explicit ProcessingModelWidget(QWidget *parent = 0); explicit ProcessingModelWidget(QString name, QWidget *parent = 0); explicit ProcessingModelWidget(ProcessingModel startingModel, QWidget *parent = 0); explicit ProcessingModelWidget(QString name, ProcessingModel startingModel, QWidget *parent = 0); ~ProcessingModelWidget(); void setProcessingModelHeating(); void setProcessingModelCooling(); private: QVBoxLayout * layout; ProcessingModel * model; QLabel * processingModelLabel void createLayout(); void initAttributes(); void setWidgetProperties(); };
They have long names, but thanks to that they can be easly recognized. Every one of them inherits from QGroupBox class from QT library. Thanks to that they can be used with QT SIGNAL/SLOT mechanism. ProcessingModelWidget, HumidifyingPointWidget and PointWidget can be used independly of each other but HumidifyingTypeChoosingButtons only as a part of the HumidifyingPointWidget. All of them are boundary classes and they will read and write I/O data. Every PointWidget class include PointData class which is used to transfer data from widgets to backend classes.
HumidifyingPointWidget class declaration:
class HumidifyingPointWidget : public QGroupBox { Q_OBJECT public: explicit HumidifyingPointWidget(QWidget *parent = 0); explicit HumidifyingPointWidget(QString name, QWidget *parent = 0); explicit HumidifyingPointWidget(QString name, HumidifyingType        startingHumidifyingType, QWidget *parent = 0); ~HumidifyingPointWidget() HumidifyingType * getHumidifyingType(); PointData * getPointData(); void setPointData(PointData * newPointData); public slots: void emitSignalDataSaved() signals: void dataSaved() private: QVBoxLayout * humidifyingPointWidgetLayout; PointWidget * humidifyingPointWidget; HumidifyingTypeChoosingGroup * typeChoosingGroup void setStartingHumidifyingType(HumidifyingType newHumidifyingType); void createLayout(); void initAttributes(); void makeSignalsConnections(); };
PointData class is a simple class for data storage, it includes seven double variabels: temperature, partialPressure, massStream, enthalpy, equilibriumVaporPressure, humidity, relativeHumidity.