@@ -191,11 +191,11 @@ void menuBase()
191
191
if (getString (userEntry, sizeof (userEntry)) == INPUT_RESPONSE_VALID)
192
192
{
193
193
double fixedLat = 0.0 ;
194
+
194
195
// Identify which type of method they used
195
- if (coordinateIdentifyInputType (userEntry, &fixedLat) != COORDINATE_INPUT_TYPE_INVALID_UNKNOWN)
196
+ CoordinateInputType latCoordinateInputType = coordinateIdentifyInputType (userEntry, &fixedLat);
197
+ if (latCoordinateInputType != COORDINATE_INPUT_TYPE_INVALID_UNKNOWN)
196
198
{
197
- settings.fixedLat = fixedLat;
198
-
199
199
// Progress with additional prompts only if the user enters valid data
200
200
systemPrint (" \r\n Longitude in degrees (ex: -105.184774720, -105 11.0864832, -105-11.0864832, "
201
201
" -105 11 05.188992, etc): " );
@@ -204,17 +204,25 @@ void menuBase()
204
204
double fixedLong = 0.0 ;
205
205
206
206
// Identify which type of method they used
207
- if ( coordinateIdentifyInputType (userEntry, &fixedLong) !=
208
- COORDINATE_INPUT_TYPE_INVALID_UNKNOWN)
207
+ CoordinateInputType longCoordinateInputType = coordinateIdentifyInputType (userEntry, &fixedLong);
208
+ if (longCoordinateInputType != COORDINATE_INPUT_TYPE_INVALID_UNKNOWN)
209
209
{
210
- settings.fixedLong = fixedLong;
211
- settings.coordinateInputType = coordinateIdentifyInputType (userEntry, &fixedLong);
212
-
213
- systemPrint (" \n Altitude in meters (ex: 1560.2284): " );
214
- double fixedAltitude = getDouble ();
215
- if (fixedAltitude != INPUT_RESPONSE_GETNUMBER_TIMEOUT &&
216
- fixedAltitude != INPUT_RESPONSE_GETNUMBER_EXIT)
217
- settings.fixedAltitude = fixedAltitude;
210
+ if (latCoordinateInputType == longCoordinateInputType)
211
+ {
212
+ settings.fixedLat = fixedLat;
213
+ settings.fixedLong = fixedLong;
214
+ settings.coordinateInputType = latCoordinateInputType;
215
+
216
+ systemPrint (" \r\n Altitude in meters (ex: 1560.2284): " );
217
+ double fixedAltitude = getDouble ();
218
+ if (fixedAltitude != INPUT_RESPONSE_GETNUMBER_TIMEOUT &&
219
+ fixedAltitude != INPUT_RESPONSE_GETNUMBER_EXIT)
220
+ settings.fixedAltitude = fixedAltitude;
221
+ }
222
+ else
223
+ {
224
+ systemPrintln (" \r\n Coordinate types must match!" );
225
+ }
218
226
} // idInput on fixedLong
219
227
} // getString for fixedLong
220
228
} // idInput on fixedLat
0 commit comments