-
Notifications
You must be signed in to change notification settings - Fork 23
/
formgps_settings.cpp
155 lines (116 loc) · 5.23 KB
/
formgps_settings.cpp
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
150
151
152
153
154
155
#include "formgps.h"
#include "aogproperty.h"
void FormGPS::loadSettings()
{
isMetric = property_setMenu_isMetric;
//These properties will be accessed directly by QML
//tramLinesMenuField.Visible = setFeatures.isTramOn;
//headlandToolStripMenuItem.Visible = property_setFeature_isHeadlandOn;
//boundariesToolStripMenuItem.Visible = property_setFeature_isBoundaryOn;
//recordedPathStripMenu.Visible = property_setFeature_isRecPathOn;
//SmoothABtoolStripMenu.Visible = property_setFeature_isABSmoothOn;
//deleteContourPathsToolStripMenuItem.Visible = property_setFeature_isHideContourOn;
//webcamToolStrip.Visible = property_setFeature_isWebCamOn;
//offsetFixToolStrip.Visible = property_setFeature_isOffsetFixOn;
//btnContour.Visible = property_setFeature_isContourOn;
//btnAutoYouTurn.Visible = property_setFeature_isYouTurnOn;
//btnStartAgIO.Visible = property_setFeature_isAgIOOn;
//btnAutoSteer.Visible = property_setFeature_isAutoSteerOn;
//btnCycleLines.Visible = property_setFeature_isCycleLinesOn;
//btnCycleLinesBk.Visible = property_setFeature_isCycleLinesOn;
//btnSectionMasterManual.Visible = property_setFeature_isManualSectionOn;
//btnSectionMasterAuto.Visible = property_setFeature_isAutoSectionOn;
//btnABLine.Visible = property_setFeature_isABLineOn;
//btnCurve.Visible = property_setFeature_isCurveOn;
//btnStanleyPure.Visible = property_setFeature_isSteerModeOn;
isUTurnOn = property_setFeature_isUTurnOn;
isLateralOn = property_setFeature_isLateralOn;
if (isMetric)
{
inchOrCm2m = 0.01;
m2InchOrCm = 100.0;
m2FtOrM = 1.0;
ftOrMtoM = 1.0;
inOrCm2Cm = 1.0;
cm2CmOrIn = 1.0;
unitsFtM = " m";
unitsInCm = " cm";
}
else
{
inchOrCm2m = glm::in2m;
m2InchOrCm = glm::m2in;
m2FtOrM = glm::m2ft;
ftOrMtoM = glm::ft2m;
inOrCm2Cm = 2.54;
cm2CmOrIn = 0.394;
unitsInCm = " in";
unitsFtM = " ft";
}
pn.headingTrueDualOffset = property_setGPS_dualHeadingOffset;
frameDayColor = property_setDisplay_colorDayFrame;
frameNightColor = property_setDisplay_colorNightFrame;
sectionColorDay = property_setDisplay_colorSectionsDay;
fieldColorDay = property_setDisplay_colorFieldDay;
fieldColorNight = property_setDisplay_colorFieldNight;
//check color for 255, reset it to properties
//Properties.Settings.Default.setDisplay_colorDayFrame = frameDayColor;
//Properties.Settings.Default.setDisplay_colorNightFrame = frameNightColor;
//Properties.Settings.Default.setDisplay_colorSectionsDay = sectionColorDay;
//Properties.Settings.Default.setDisplay_colorFieldDay = fieldColorDay;
//Properties.Settings.Default.setDisplay_colorFieldNight = fieldColorNight;
isSkyOn = property_setMenu_isSkyOn;
isTextureOn = property_setDisplay_isTextureOn;
isGridOn = property_setMenu_isGridOn;
isBrightnessOn = property_setDisplay_isBrightnessOn;
isCompassOn = property_setMenu_isCompassOn;
isSpeedoOn = property_setMenu_isSpeedoOn;
isSideGuideLines = property_setMenu_isSideGuideLines;
isSvennArrowOn = property_setDisplay_isSvennArrowOn;
lightbarCmPerPixel = property_setDisplay_lightbarCmPerPixel;
//isLogNMEA = property_setMenu_isLogNMEA;
isPureDisplayOn = property_setMenu_isPureOn;
isAutoStartAgIO = property_setDisplay_isAutoStartAgIO;
vehicleOpacity = ((double)(property_setDisplay_vehicleOpacity) * 0.01);
vehicleOpacityByte = (char)(255 * ((double)(property_setDisplay_vehicleOpacity) * 0.01));
isVehicleImage = property_setDisplay_isVehicleImage;
//TODO: custom colors for display
//TODO: check for 255
textColorDay = property_setDisplay_colorTextDay;
textColorNight = property_setDisplay_colorTextNight;
vehicleColor = property_setDisplay_colorVehicle;
isLightbarOn = property_setMenu_isLightbarOn;
//hotkeys = Properties.Settings.Default.setKey_hotkeys.ToCharArray();
udpWatchLimit = property_setGPS_udpWatchMsec;
//check for 255
//TODO
//string[] words = Properties.Settings.Default.setDisplay_customColors.Split(',');
isRTK = property_setGPS_isRTK;
isRTK_KillAutosteer = property_setGPS_isRTK_KillAutoSteer;
pn.ageAlarm = property_setGPS_ageAlarm;
isConstantContourOn = property_setAS_isConstantContourOn;
isSteerInReverse = property_setAS_isSteerInReverse;
guidanceLookAheadTime = property_setAS_guidanceLookAheadTime;
//gyd pulls directly from settings
//gyd.sideHillCompFactor = property_setAS_sideHillComp;
fd.UpdateFieldBoundaryGUIAreas(bnd.bndList);
isStanleyUsed = property_setVehicle_isStanleyUsed;
isDay = property_setDisplay_isDayMode;
tool.loadSettings();
if (tool.isSectionsNotZones){
tool.sectionSetPositions();
tool.sectionCalcWidths();
} else {
tool.sectionCalcMulti();
}
//disable youturn buttons
headingFromSource = (QString)property_setGPS_headingFromWhichSource;
//load various saved settings or properties into the support classes
ahrs.loadSettings();
camera.loadSettings();
pn.loadSettings();
if(!isJobStarted)
sim.loadSettings();
vehicle.loadSettings();
yt.loadSettings();
}