#ifndef BMSSETTINGSWIDGET_H
#define BMSSETTINGSWIDGET_H
// void PageMasterSettings
// Test: Cell groups in Series 10 -> 9 // Записать текущ. в БМС

#include <QWidget>
#include <QLineEdit>

#include "bmsinterface.h"

namespace Ui {
class BmsSettingsWidget;
}

class ParamTable;

class BmsSettingsWidget : public QFrame
{
    Q_OBJECT

public:
    explicit BmsSettingsWidget(QWidget *parent = nullptr);
    ~BmsSettingsWidget();

    void clearControlls();
    void prepareSettersFromGuiControlsToSettingsFile();

    BMSInterface *bms() const;
    void setDieBieMS(BMSInterface *dieBieMS);

    //bool addParamRow(QLineEdit* edit, ConfigParams *params, QString paramName);

signals:
    void sendMessage(QString message);

public slots:
    void onLoadParams();

    void onBmsconfUpdateRequested();
    void onBmsconfUpdateRequestDefault();
    void onBmsconfUpdated();
    void onBmsconfStored();

    void onPortConnectedChanged();

private slots:
    void on_pbCalibrateZeroPoint_clicked();
    //void on_pbWriteIntoNonVolatileMemoryOfBsm_clicked();
    //void on_pbWriteCurrentValuesIntoBsm_clicked();
    void on_pbWriteToNonVolatileBmsMemory_clicked();
    void on_pbWriteCurrentValuesToBms_clicked();

private:
    Ui::BmsSettingsWidget *ui;

    BMSInterface *mDieBieMS;
    bool mIsBmsConnected = false;
    bool mDoConnectGettersOnStart = true;
    //ParamTable * pt; // = new ParamTable(this); //ui->masterStateTab;
};

#endif // BMSSETTINGSWIDGET_H
