#ifndef FORMCHARGEGUNDETAIL_H
#define FORMCHARGEGUNDETAIL_H

#include <QWidget>

#include "BaseWidget.h"
#include "DataTypeDef.h"

namespace Ui {
class FormChargeGunDetail;
}

class FormChargeGunDetail : public BaseWidget
{
    Q_OBJECT

public:
    explicit FormChargeGunDetail(int gun_id, BaseWidget *parent = nullptr);
    ~FormChargeGunDetail();

    bool returnParent() override;

private:
    void initConnect();
    void initComboBox();
    void initGunTypeComboBox();
    void initSlacIfnameComboBox();
    void initCanIfnameComboBox();

    void refreshData();
    void updateData();

    void connectAllValueChanged(QWidget *widget);

private slots:
    void onValueChanged();

signals:
    void valueChanged();

protected:
    void showEvent(QShowEvent* event) override;

private:
    Ui::FormChargeGunDetail *ui;
    int m_gun_id;
    CCU_CFG m_ccu_cfg;
    bool m_is_spread = true;
};

#endif // FORMCHARGEGUNDETAIL_H
