#ifndef DISPLAYSERVER_H
#define DISPLAYSERVER_H

#include <QObject>
#include <QVector>
#include "hw.h"
#include "display.h"


typedef struct
{
    int nr;
    QString name;
    int nr_sensors; //this is commonly 2*nr_devices or 2*nr_devices-1
    int nr_devices;
    QVector<Device*> devices;
} PlaneConfig;


class DisplayServer : public QObject
{
    Q_OBJECT
public:
    explicit DisplayServer(QObject *parent = 0);

    void setup(HW *hw);
    void show();
    void hide();
    void plot();
    int isActive();
    ~DisplayServer();
    void unsetup();

    // New boolean flag to control display of RAW or CAL data
    bool showRawData = true;  // Default is to show RAW data // use displays[plane]->showCalibrated instead
signals:

public slots:

protected:
    int active = 0;
    HW* theHW;
    QVector<PlaneConfig*> planeConfig;
    QVector<BPMDisplay*> displays;

    PlaneConfig *findPlane(int plane_nr);
};

#endif // DISPLAYSERVER_H
