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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [gui_plugin/] [GnssWidgets/] [linecommon.h] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sergeykhbr
/**
2
 * @file
3
 * @copyright  Copyright 2017 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      Plot's Line common class.
6
 */
7
#pragma once
8
 
9
#include "attribute.h"
10
 
11
namespace debugger {
12
 
13
class LineCommon {
14
public:
15
    LineCommon(AttributeType &descr);
16
 
17
    const AttributeType &getDescription();
18
    unsigned size();
19
    void append(double y);
20
    void append(double x, double y);
21
    const char *getName() { return descr_["Name"].to_string(); }
22
    const char *getColor() { return color_; }
23
 
24
    void setPlotSize(int w, int h);
25
    void selectData(int start_idx, int total);
26
    bool getNext(int &x, int &y);
27
    bool getXY(int idx, int &x, int &y);
28
    bool getAxisValue(int axis, int idx, double &outval);
29
    bool getAxisValue(int axis, int idx, char *outbuf, size_t bufsz);
30
    void getAxisMin(int axis, char *outbuf, size_t bufsz);
31
    void getAxisMax(int axis, char *outbuf, size_t bufsz);
32
    int getNearestByX(int x);
33
 
34
private:
35
    AttributeType descr_;
36
    struct AxisType {
37
        double *data;
38
        double accum;
39
        double minVal;
40
        double maxVal;
41
    } axis_[2];
42
    bool is_ring_;
43
    int start_;
44
    int cnt_;
45
    int len_;
46
    char color_[8];
47
    char format_[16];
48
    double plot_w;
49
    double plot_h;
50
    double dx;
51
    double dy;
52
    int sel_start_idx;
53
    int sel_cnt;
54
};
55
 
56
}  // namespace debugger

powered by: WebSVN 2.1.0

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