-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwtgraphs.h
81 lines (61 loc) · 2.13 KB
/
wtgraphs.h
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
//This does the windows part of the graph display
//Much of the bit-work happens in the shared library which can graph for the command line
//#include <windows.h>
//#include "mytrips.h"
//#include "worldtracker.h"
#define WT_GRAPH_DEFAULT -1
#define WT_GRAPHTYPE_SCATTER 0x01
#define WT_GRAPHTYPE_HISTOGRAM 0x02
#define WT_GRAPHTYPE_LINE 0x04
#define WT_GRAPHTYPE_LOCATION 0x10 //data is based on a location
#define WT_GRAPHTYPE_TRIP 0x20 //data is based on a list of trips (TRIP)
#define WT_GRAPHTYPE_STAY 0x40 //based on a STAY struct
//firstly allow to set that we're looking at a duration (e.g. of a trip or a stay)
//all of these are a length of time, probably more likely used on a y-axis.
#define WT_SERIES_DUR_SECONDS 1
#define WT_SERIES_DUR_MINUTES 2
#define WT_SERIES_DUR_HOURS 3
#define WT_SERIES_DUR_DAYS 4
#define WT_SERIES_DUR_WEEKS 5
#define WT_SERIES_DUR_MONTHS 6
#define WT_SERIES_DUR_YEARS 7
#define WT_SERIES_TIMEOFDAY 8 //from 0000 to 23:59
#define WT_SERIES_WEEKDAY 9
#define WT_SERIES_MONTH 10
#define WT_SERIES_TIMESTAMP 11
#define WT_SERIES_DAY 12
#define WT_SERIES_DIRECTION 13
#define WT_SERIES_LATITUDE 14
#define WT_SERIES_LONGITUDE 15
#define WT_SERIES_DISTANCE 16
#define WT_SERIES_SPEED 16
typedef struct sGraphInfo GRAPHINFO;
struct sGraphInfo {
HBITMAP hbmGraph;
BM bmGraph;
LOCATIONHISTORY *locationHistory;
WORLDREGION * region;
STAY * stay; //associated stay
TRIP * trip;
int graphType;
int xAxisSeries; //whether this uses month, or accurancy, or time
int yAxisSeries;
int colourSeries;
int markersize;
unsigned long fromtimestamp;
unsigned long totimestamp;
double xmin;
double xmax;
double ymin;
double ymax;
double xmajorunit;
double ymajorunit;
};
LRESULT CALLBACK GraphWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
int PaintMainGraph(HWND hwnd, GRAPHINFO* gi);
HBITMAP MakeHBitmapGraph(HWND hwnd, HDC hdc, GRAPHINFO * gi);
int RecalculateData(GRAPHINFO * gi);
int DrawScatterGraph(GRAPHINFO *gi);
int DrawLineGraph(GRAPHINFO *gi);
void GraphWndProc_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
void GraphContextMenu(HWND hwnd, HWND hwndContext, int xPos, int yPos);