OpenCores
URL https://opencores.org/ocsvn/modular_oscilloscope/modular_oscilloscope/trunk

Subversion Repositories modular_oscilloscope

[/] [modular_oscilloscope/] [trunk/] [sw/] [src/] [rvicommthread.h] - Blame information for rev 60

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 60 budinero
#ifndef RVICOMMTHREAD_H
2
#define RVICOMMTHREAD_H
3
 
4
#include <QThread>
5
#include <QTimer>
6
#include "include/epp_parallel_use_win.h"
7
 
8
 
9
const int MAX_BUFF_SIZE= 15359;// = 15359;  size of memory address bus
10
const int MIN_BUFF_SIZE = 20;
11
const int SCALE_BITS = 5; // bits for data skipper
12
const double BASE_SAMPLE_RATE = 20e6;
13
const int PLOT_SIZE = 15359;
14
const int ADC_PS_BITS = 5;
15
 
16
 
17
class RVICommThread : public QThread
18
{
19
    Q_OBJECT
20
 
21
    public:
22
        RVICommThread(QObject *parent);
23
        ~RVICommThread();
24
        // Reimplementation
25
        void run();
26
 
27
        // Control
28
        void setAddress(const short int &address);
29
        void setContinuous(const bool &on);
30
        void setTrigger(const bool &on, const bool &slope, const bool &channel, const int &level, \
31
                        const int &offset);
32
        void setChannels(const bool &chAOn, const bool &chBOn);
33
        void setBuffer(const int &size);
34
        void setTimeScaler(const bool &on, const int &value);
35
 
36
        // ADC
37
        void setADCPreScale(const int &preScale);
38
 
39
        // Data
40
        QList<int> getChannelData(int channel);
41
        bool isBufferFull();
42
        double getADCSampleRate();
43
 
44
    public slots:
45
        void stopAcquistion();
46
        void configADC();
47
 
48
    private slots:
49
        void endWaiting();
50
 
51
    signals:
52
        void chANewData(int val);
53
        void chBNewData(int val);
54
        void statusMessage(QString message);
55
        void endOfBuffer();
56
 
57
    private:
58
        QString translateStatus(const EppParallelUseWin::PPStatusType &port_status);
59
        EppParallelUseWin port;
60
        void checkDataSize();
61
        bool acqStopped;
62
        bool dataUsed;
63
        bool bufferFull;
64
 
65
        //Data
66
        QList<int>   channelData[2]; // two channels
67
        // Timer
68
        QTimer *timer;
69
        bool waiting;
70
        // Config variables
71
        short int portAddress;
72
        bool continuous;
73
        bool triggerOn;
74
        bool triggerSlope;
75
        bool triggerChannel;
76
        bool timeScaleEnabled;
77
        int  timeScaleValue;
78
        bool channelAEnabled;
79
        bool channelBEnabled;
80
        int  bufferSize;
81
        int  triggerLevel;
82
        int  triggerOffset;
83
        // ADC
84
        int adcPreScaler;
85
 
86
        // Values
87
        double aDCSampleRate;
88
 
89
};
90
 
91
#endif // RVICOMMTHREAD_H
92
 
93
 
94
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.