#ifndef XLRUCHARTSFORM_H
#define XLRUCHARTSFORM_H

#include <QWidget>
#include "callout.h"

namespace Ui {
class XlruChartsForm;
}

namespace QtCharts
{
class QValueAxis;
}

class XlruChartsForm : public QWidget
{
    Q_OBJECT

public:
    explicit XlruChartsForm(QWidget *parent = 0);
    ~XlruChartsForm();

    QtCharts::QValueAxis* temperatureAxis;
    QtCharts::QValueAxis* currentAxis;
	QtCharts::QValueAxis* voltageAxis;

public slots:
    int addSensor(const QString& name, QtCharts::QValueAxis*, int id=-1);

    int addTemperatureSensor(const QString& name, int id=-1);
    int addCurrentSensor(const QString& name, int id=-1);
    int addVoltageSensor(const QString& name, int id=-1);

    void addSample(int id, float value);

    void addCurrentSample(int id, float value);

    void addTemperatureSample(int id, float value);

    void addVoltageSample(int id, float value);

    void connectMarkers();
    void handleMarkerClicked();
    void disconnectMarkers();

    void keepCallout();
    void tooltip(QPointF point, bool state);
    void connectTooltip();

private slots:
    //void addSampleAxis(int id, float value, QtCharts::QValueAxis*);
    void on_toolButton_clicked();

    void on_tbClear_clicked();

private:
    void timerEvent(QTimerEvent*);

    Ui::XlruChartsForm *ui;

    class Implementation;
    Implementation& p_;

    Callout *m_tooltip;
    QList<Callout *> m_callouts;
};

#endif // XLRUCHARTSFORM_H
