mainwindow.h 3.82 KB
Newer Older
Alexander Steffens's avatar
Alexander Steffens committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QListWidget>
#include <QTabWidget>
#include <QStringList>
#include <QList>
#include "device.h"
#include "dlglog.h"
#include "tabmaroc.h"
#include "tabconcentrator.h"
#include "qmaroc.h"
#include "qconcentrator.h"
#include "mainwindow_def.h"
#include "dlggrafik.h"
#include "dlgstartup.h"
#include "tabclkrst.h"
#include "psf1100.h"
#include "tabmeasure.h"




#define SAPHIRTITLE     "Saphir - Testsoftware, V 1.0, (c) 2015 Forschungszentrum Jülich GmbH, ZEA-2"

class DlgLog;

namespace Ui {
class MainWindow;
}


class MainWindow : public QMainWindow
{
    Q_OBJECT

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

public slots:
    void Main_IncErrors();
    void Main_IncWarnings();


private slots:
    void on__CentralTab_currentChanged(int index);

    void on_ClearWarnings_clicked();
    void on_ClearLog_clicked();
    void on_FirmwareUpdate_clicked();
    void on_DeviceInfo_itemSelectionChanged();

    void on_actionCheck_data_file_triggered();

    void on_Identify_clicked();
    void Show_LED0_Off();

    void on_actionSave_Configuration_to_triggered();

    void ISetValue(int id, int idx, QVariant val);

    void on_SegmentNo_editingFinished();

    void on_SetSegmentNo_clicked();

signals:
    void OAddToLog(int ltype, QString msg);
    void OUpdateConcentratorDaq();
    void OSyncClkRst(quint32 what);

private:
    Ui::MainWindow *ui;
    QWidget         *Parent;
    int             MyLogTab;
    bool            Init;
    int             DlgsVisible;
    DlgLog          *_LogDlg;
    DlgStartup      *_DlgSU;
    int             LastTab;
    QString         _DataFile;
    quint8          LastType[MAX_NO_OF_PCI_DEVICES];
    bool            bDlg_Log;
    QString         ProgPath;

    QTabWidget      *_MainTab;
//    QList <QString> _MainTabNames;
    QListWidget     *_MainLog;

//    QList<quint8>   _KnownDevices;

    QString         MainWindowSettingsFile;
    QString         _SaveConfigPath;

    int             _ClkRstDev;
    int             _Warnings;
    int             _AktRow;
    int             _Errors;
//    int             DeviceAnzahl;
//    tDeviceInfo     DeviceInfo[MAX_NO_OF_PCI_DEVICES];
    QList <tDeviceInfo *>    _DeviceInfo;

    QMaroc          *_qMaroc[MAX_NO_OF_PCI_DEVICES];
    TabMaroc        *Tab_Maroc[MAX_NO_OF_PCI_DEVICES];

    QList <QConcentrator *>     _qConcentrators;
    QList <tTabInfo>            _TabInfo;
    TabConcentrator *Tab_Concentrator[MAX_NO_OF_PCI_DEVICES];
    tabclkrst       *Tab_ClkRst[MAX_NO_OF_PCI_DEVICES];
    tabmeasure      *_Tab_GlobalControl;

    psf1100         *_psf1100[MAX_NO_OF_PCI_DEVICES];

    PromSettings    Proms[MAX_NO_OF_PCI_DEVICES];

    QStringList     Header;
//    QStringList     VertHeader;

    void            Main_ShowDevices();

    void            Main_SearchDevices();
    void            Main_LoadSettings();
    void            Main_SaveSettings();
    BOOL            Main_ConnectToCards();
    void            Main_GetBoardIDTxt(int dev, QString *txt);
    bool            Main_ReadyToClose();
    void            SortTab();

    void            closeEvent(QCloseEvent * event);
    void            ShowPsf1100Info(int d, bool set);

    void            CheckFirmware();
    void            Show_LED0(bool show);
    void            Identify();


    void            CopyAllINItoPath(QString path);
    int             GetTabFromDevNo(int idx);
    int             GetNewTabNameFromDevNo(int idx, quint32 neu);


    tTabInfo        NewTabInfo(TabType type, quint32 device, quint32 ListNo, TabState active, quint32 TabNo, QString name);

    void            UpdateTab(int dev, quint32 seg);

};

#endif // MAINWINDOW_H