Skip to content

Commit 91567db

Browse files
committed
Correct negative DDMMSS.sss in main.js
1 parent 5ead5d9 commit 91567db

File tree

1 file changed

+7
-7
lines changed
  • Firmware/RTK_Surveyor/AP-Config/src

1 file changed

+7
-7
lines changed

Firmware/RTK_Surveyor/AP-Config/src/main.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ function identifyInputType(userEntry) {
18121812
seconds -= (decimal * 10000); //Remove DDD
18131813
seconds -= (minutes * 100); //Remove MM
18141814
convertedCoordinate = decimal + (minutes / 60.0) + (seconds / 3600.0);
1815-
if (convertedCoordinate) convertedCoordinate *= -1;
1815+
if (negativeSign) convertedCoordinate *= -1;
18161816
}
18171817
else if (spaceCount == 0 && dashCount == 0 && (lengthOfLeadingNumber == 5 || lengthOfLeadingNumber == 4)) //DDMM.mmmmmmm
18181818
{
@@ -1824,7 +1824,7 @@ function identifyInputType(userEntry) {
18241824
var minutes = userEntry; //Get DDDMM.mmmmmmm
18251825
minutes -= (decimal * 100); //Remove DDD
18261826
convertedCoordinate = decimal + (minutes / 60.0);
1827-
if (negativeSign) convertedCoordinate *= -1;
1827+
if (negativeSign) convertedCoordinate *= -1.0;
18281828
}
18291829

18301830
else if (dashCount == 1) //DD-MM.mmmmmmm
@@ -1835,7 +1835,7 @@ function identifyInputType(userEntry) {
18351835
var decimal = Number(data[0]); //Get DD
18361836
var minutes = Number(data[1]); //Get MM.mmmmmmm
18371837
convertedCoordinate = decimal + (minutes / 60.0);
1838-
if (negativeSign) convertedCoordinate *= -1;
1838+
if (negativeSign) convertedCoordinate *= -1.0;
18391839
}
18401840
else if (dashCount == 2) //DD-MM-SS.ssss
18411841
{
@@ -1851,13 +1851,13 @@ function identifyInputType(userEntry) {
18511851

18521852
var seconds = Number(data[2]); //Get SS.ssssss
18531853
convertedCoordinate = decimal + (minutes / 60.0) + (seconds / 3600.0);
1854-
if (negativeSign) convertedCoordinate *= -1;
1854+
if (negativeSign) convertedCoordinate *= -1.0;
18551855
}
18561856
else if (spaceCount == 0) //DD.ddddddddd
18571857
{
18581858
coordinateInputType = CoordinateTypes.COORDINATE_INPUT_TYPE_DD;
18591859
convertedCoordinate = userEntry;
1860-
if (negativeSign) convertedCoordinate *= -1;
1860+
if (negativeSign) convertedCoordinate *= -1.0;
18611861
}
18621862
else if (spaceCount == 1) //DD MM.mmmmmmm
18631863
{
@@ -1867,7 +1867,7 @@ function identifyInputType(userEntry) {
18671867
var decimal = Number(data[0]); //Get DD
18681868
var minutes = Number(data[1]); //Get MM.mmmmmmm
18691869
convertedCoordinate = decimal + (minutes / 60.0);
1870-
if (negativeSign) convertedCoordinate *= -1;
1870+
if (negativeSign) convertedCoordinate *= -1.0;
18711871
}
18721872
else if (spaceCount == 2) //DD MM SS.ssssss
18731873
{
@@ -1883,7 +1883,7 @@ function identifyInputType(userEntry) {
18831883

18841884
var seconds = Number(data[2]); //Get SS.ssssss
18851885
convertedCoordinate = decimal + (minutes / 60.0) + (seconds / 3600.0);
1886-
if (negativeSign) convertedCoordinate *= -1;
1886+
if (negativeSign) convertedCoordinate *= -1.0;
18871887
}
18881888

18891889
console.log("convertedCoordinate: " + Number(convertedCoordinate).toFixed(9));

0 commit comments

Comments
 (0)