Files
giesCANne/graphingwindow.h
T
Collin Kidder 8caafce022 Graphing window now retains your current view when graphs are added and subtracted unless you get down to no graphs.
This makes it easier to load lots of graphs and do work without having the graph constantly resize.
2015-06-04 21:08:25 -04:00

64 lines
1.4 KiB
C++

#ifndef GRAPHINGWINDOW_H
#define GRAPHINGWINDOW_H
#include "qcustomplot.h"
#include "can_structs.h"
#include <QDialog>
namespace Ui {
class GraphingWindow;
}
class GraphParams
{
public:
int32_t ID;
int startByte, endByte;
bool isSigned;
int32_t mask;
float bias;
float scale;
int stride;
QColor color;
QCPGraph *ref;
};
class GraphingWindow : public QDialog
{
Q_OBJECT
public:
explicit GraphingWindow(QVector<CANFrame> *, QWidget *parent = 0);
~GraphingWindow();
void showEvent(QShowEvent*);
private slots:
void titleDoubleClick(QMouseEvent *event, QCPPlotTitle *title);
void axisLabelDoubleClick(QCPAxis* axis, QCPAxis::SelectablePart part);
void legendDoubleClick(QCPLegend* legend, QCPAbstractLegendItem* item);
void selectionChanged();
void mousePress();
void mouseWheel();
void removeSelectedGraph();
void removeAllGraphs();
void contextMenuRequest(QPoint pos);
void moveLegend();
void addNewGraph();
void createGraph(GraphParams &params, bool createGraphParam = true);
void editSelectedGraph();
void updatedFrames(int);
private:
Ui::GraphingWindow *ui;
QList<CANFrame> frameCache;
QVector<CANFrame> *modelFrames;
QList<GraphParams> graphParams;
QPen selectedPen;
bool needScaleSetup; //do we need to set x,y graphing extents?s
void showParamsDialog(int idx);
};
#endif // GRAPHINGWINDOW_H