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

#include <QWidget>
#include <QLineEdit>

#include "bmsinterface.h"

namespace Ui {
class BmsSettings;
}

class ParamTable;

class BmsSettings : public QFrame
{
    Q_OBJECT

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

    void clearControlls();
    void prepareSettersFromGuiControlsToSettingsFile();

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

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

signals:
    void sendMessage(QString message);
    void showStatusInfo(QString info, bool isGood);
    void showMessageDialog(const QString &title, const QString &msg, bool isGood, bool richText);

public slots:
    void onLoadParams();

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

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

    void onSaveBMSConfToXmlFileClicked();
    void onLoadBMSConfFromXmlFileClicked();

private:
    Ui::BmsSettings *ui;

    BMSInterface *mDieBieMS = nullptr;

    //ParamTable * pt; // = new ParamTable(this); //ui->masterStateTab;
};

#endif // BH

/*
        <notUsedCurrentThreshold>
            <longName>Not used current threshold</longName>
            <type>1</type>
            <transmittable>1</transmittable>
            <description>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; ; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When the battery current goes below this "Not used battery current threshold" value, the "Not used timeout" timer starts.&amp;quot; &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description>
            <cDefine>NOT_USED_CURRENT_THRESHOLD</cDefine>
            <editorDecimalsDouble>2</editorDecimalsDouble>
            <editorScale>1</editorScale>
            <editAsPercentage>0</editAsPercentage>
            <maxDouble>10</maxDouble>
            <minDouble>0</minDouble>
            <showDisplay>0</showDisplay>
            <stepDouble>0.1</stepDouble>
            <valDouble>0.5</valDouble>
            <vTxDoubleScale>100000</vTxDoubleScale>
            <suffix>A</suffix>
            <vTx>9</vTx>
        </notUsedCurrentThreshold>
*/
