From 85192ad4c2eafa78aca4af3965c225877e743310 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:38:55 -0400 Subject: [PATCH 01/56] 1 --- python/L76X.py | 6 +++--- python/main.py | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/python/L76X.py b/python/L76X.py index f5768b3..e67b16a 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -91,12 +91,12 @@ def L76X_Send_Command(self, data): self.config.Uart_SendString(data) self.config.Uart_SendByte('\r') self.config.Uart_SendByte('\n') - print data + print(data) def L76X_Gat_GNRMC(self): data = self.config.Uart_ReceiveString(BUFFSIZE) - print data - print '\n' + print(data) + print('\n') add=0 self.Status = 0 for i in range(0, BUFFSIZE-71): diff --git a/python/main.py b/python/main.py index eff4d50..f474a60 100644 --- a/python/main.py +++ b/python/main.py @@ -18,19 +18,19 @@ while(1): x.L76X_Gat_GNRMC() if(x.Status == 1): - print 'Already positioned' + print('Already positioned') else: - print 'No positioning' - print 'Time %d:'%x.Time_H, - print '%d:'%x.Time_M, - print '%d'%x.Time_S + print('No positioning') + print('Time %d:'%x.Time_H,) + print('%d:'%x.Time_M,) + print('%d'%x.Time_S) - print 'Lon = %f'%x.Lon, - print ' Lat = %f'%x.Lat + print('Lon = %f'%x.Lon,) + print(' Lat = %f'%x.Lat) x.L76X_Baidu_Coordinates(x.Lat, x.Lon) - print 'Baidu coordinate %f'%x.Lat_Baidu, - print ',%f'%x.Lon_Baidu + print('Baidu coordinate %f'%x.Lat_Baidu,) + print(',%f'%x.Lon_Baidu) except: #GPIO.cleanup() - print "\nProgram end" + print("\nProgram end") exit() \ No newline at end of file From 50d592d964570491feef98fd4be9a9ca07acb7ed Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:40:12 -0400 Subject: [PATCH 02/56] 1 --- python/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/main.py b/python/main.py index f474a60..a39176f 100644 --- a/python/main.py +++ b/python/main.py @@ -30,7 +30,8 @@ x.L76X_Baidu_Coordinates(x.Lat, x.Lon) print('Baidu coordinate %f'%x.Lat_Baidu,) print(',%f'%x.Lon_Baidu) -except: +except Exception as e: + print(e) #GPIO.cleanup() print("\nProgram end") exit() \ No newline at end of file From ac72834c5eed6ead13f62a242e420ed4bef74b44 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:42:40 -0400 Subject: [PATCH 03/56] 1 --- python/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/main.py b/python/main.py index a39176f..98d4234 100644 --- a/python/main.py +++ b/python/main.py @@ -1,6 +1,7 @@ import L76X import time import math +import sys, os try: x=L76X.L76X() @@ -31,7 +32,7 @@ print('Baidu coordinate %f'%x.Lat_Baidu,) print(',%f'%x.Lon_Baidu) except Exception as e: - print(e) + print(sys.exc_info()) #GPIO.cleanup() print("\nProgram end") exit() \ No newline at end of file From be5d9c82ad654453678768e6a95734b710391e8b Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:43:20 -0400 Subject: [PATCH 04/56] 1 --- python/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/main.py b/python/main.py index 98d4234..ab5d262 100644 --- a/python/main.py +++ b/python/main.py @@ -1,7 +1,7 @@ import L76X import time import math -import sys, os +import traceback try: x=L76X.L76X() @@ -32,7 +32,7 @@ print('Baidu coordinate %f'%x.Lat_Baidu,) print(',%f'%x.Lon_Baidu) except Exception as e: - print(sys.exc_info()) + print(traceback.format_exc()) #GPIO.cleanup() print("\nProgram end") exit() \ No newline at end of file From 109b50520a5013814426b1700665726a6804c1ba Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:44:58 -0400 Subject: [PATCH 05/56] 1 --- python/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/main.py b/python/main.py index ab5d262..bf138e2 100644 --- a/python/main.py +++ b/python/main.py @@ -10,12 +10,12 @@ time.sleep(2) x.L76X_Set_Baudrate(115200) - x.L76X_Send_Command(x.SET_POS_FIX_400MS); + # x.L76X_Send_Command(x.SET_POS_FIX_400MS) #Set output message - x.L76X_Send_Command(x.SET_NMEA_OUTPUT); + # x.L76X_Send_Command(x.SET_NMEA_OUTPUT) - x.L76X_Exit_BackupMode(); + x.L76X_Exit_BackupMode() while(1): x.L76X_Gat_GNRMC() if(x.Status == 1): From 4a2b0005dfcbb4ca03f18fa7234976debf6488ea Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:45:25 -0400 Subject: [PATCH 06/56] 1 --- python/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/main.py b/python/main.py index bf138e2..345a694 100644 --- a/python/main.py +++ b/python/main.py @@ -6,7 +6,7 @@ try: x=L76X.L76X() x.L76X_Set_Baudrate(9600) - x.L76X_Send_Command(x.SET_NMEA_BAUDRATE_115200) + # x.L76X_Send_Command(x.SET_NMEA_BAUDRATE_115200) time.sleep(2) x.L76X_Set_Baudrate(115200) From cbc68f0357cc14d3d70dbaf26b4831e923982051 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:46:18 -0400 Subject: [PATCH 07/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index e67b16a..5de92f0 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -82,7 +82,7 @@ def __init__(self): self.config = config.config(9600) def L76X_Send_Command(self, data): - Check = ord(data[1]) + Check = ord(data[0]) for i in range(2, len(data)): Check = Check ^ ord(data[i]) data = data + Temp[16] From 84961f1e95ba5b3d35f0f881524705bb3d6e3664 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:46:28 -0400 Subject: [PATCH 08/56] 1 --- python/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/main.py b/python/main.py index 345a694..ffc55eb 100644 --- a/python/main.py +++ b/python/main.py @@ -6,14 +6,14 @@ try: x=L76X.L76X() x.L76X_Set_Baudrate(9600) - # x.L76X_Send_Command(x.SET_NMEA_BAUDRATE_115200) + x.L76X_Send_Command(x.SET_NMEA_BAUDRATE_115200) time.sleep(2) x.L76X_Set_Baudrate(115200) - # x.L76X_Send_Command(x.SET_POS_FIX_400MS) + x.L76X_Send_Command(x.SET_POS_FIX_400MS) #Set output message - # x.L76X_Send_Command(x.SET_NMEA_OUTPUT) + x.L76X_Send_Command(x.SET_NMEA_OUTPUT) x.L76X_Exit_BackupMode() while(1): From 683693c2df763286495ba09200ca14e00d5f2afd Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:47:22 -0400 Subject: [PATCH 09/56] 1 --- python/L76X.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/L76X.py b/python/L76X.py index 5de92f0..d0ea279 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -82,12 +82,12 @@ def __init__(self): self.config = config.config(9600) def L76X_Send_Command(self, data): - Check = ord(data[0]) + Check = ord(data[1]) for i in range(2, len(data)): Check = Check ^ ord(data[i]) data = data + Temp[16] - data = data + Temp[(Check/16)] - data = data + Temp[(Check%16)] + # data = data + Temp[(Check/16)] + # data = data + Temp[(Check%16)] self.config.Uart_SendString(data) self.config.Uart_SendByte('\r') self.config.Uart_SendByte('\n') From b4600bea87137a1cceee09e28019f955889cddc8 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:48:44 -0400 Subject: [PATCH 10/56] 1 --- python/L76X.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/L76X.py b/python/L76X.py index d0ea279..f615faa 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -86,8 +86,8 @@ def L76X_Send_Command(self, data): for i in range(2, len(data)): Check = Check ^ ord(data[i]) data = data + Temp[16] - # data = data + Temp[(Check/16)] - # data = data + Temp[(Check%16)] + data = data + Temp[Check/16] + data = data + Temp[Check%16] self.config.Uart_SendString(data) self.config.Uart_SendByte('\r') self.config.Uart_SendByte('\n') From 682cdc1e20cfc3d010ce9d11927c39207ca62419 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:49:10 -0400 Subject: [PATCH 11/56] 1 --- python/L76X.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index f615faa..6f22793 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -83,11 +83,12 @@ def __init__(self): def L76X_Send_Command(self, data): Check = ord(data[1]) + print(Check) for i in range(2, len(data)): Check = Check ^ ord(data[i]) data = data + Temp[16] data = data + Temp[Check/16] - data = data + Temp[Check%16] + data = data + Temp[(Check%16)] self.config.Uart_SendString(data) self.config.Uart_SendByte('\r') self.config.Uart_SendByte('\n') From e7ec5ddd61aa2d97dda434b043c3a832d291777d Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:50:16 -0400 Subject: [PATCH 12/56] 1 --- python/L76X.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/L76X.py b/python/L76X.py index 6f22793..27ba2fe 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -87,6 +87,7 @@ def L76X_Send_Command(self, data): for i in range(2, len(data)): Check = Check ^ ord(data[i]) data = data + Temp[16] + print(data) data = data + Temp[Check/16] data = data + Temp[(Check%16)] self.config.Uart_SendString(data) From 3f07b7ce6169424d1491109687f46e9b3ce4188b Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:51:57 -0400 Subject: [PATCH 13/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index 27ba2fe..ed31e51 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -88,7 +88,7 @@ def L76X_Send_Command(self, data): Check = Check ^ ord(data[i]) data = data + Temp[16] print(data) - data = data + Temp[Check/16] + data = data + Temp[Check//16] data = data + Temp[(Check%16)] self.config.Uart_SendString(data) self.config.Uart_SendByte('\r') From 4ad8f3c747f5f674a6f0b698dc96e8757da17b9c Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:52:34 -0400 Subject: [PATCH 14/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index ed31e51..21fa7e8 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -90,7 +90,7 @@ def L76X_Send_Command(self, data): print(data) data = data + Temp[Check//16] data = data + Temp[(Check%16)] - self.config.Uart_SendString(data) + self.config.Uart_SendString(data.encode()) self.config.Uart_SendByte('\r') self.config.Uart_SendByte('\n') print(data) From 232d6c82a46d625ed88d089212186c2929ceb88c Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:53:01 -0400 Subject: [PATCH 15/56] 1 --- python/L76X.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/L76X.py b/python/L76X.py index 21fa7e8..514fd43 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -91,8 +91,8 @@ def L76X_Send_Command(self, data): data = data + Temp[Check//16] data = data + Temp[(Check%16)] self.config.Uart_SendString(data.encode()) - self.config.Uart_SendByte('\r') - self.config.Uart_SendByte('\n') + self.config.Uart_SendByte('\r'.encode()) + self.config.Uart_SendByte('\n'.encode()) print(data) def L76X_Gat_GNRMC(self): From 258888c33f65c4d5f1cedf0ddc6815013c5e869b Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:55:41 -0400 Subject: [PATCH 16/56] 1 --- python/L76X.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/L76X.py b/python/L76X.py index 514fd43..26965ab 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -102,9 +102,9 @@ def L76X_Gat_GNRMC(self): add=0 self.Status = 0 for i in range(0, BUFFSIZE-71): - if(ord(data[add]) == 36 and ord(data[add+1]) == 71 and (ord(data[add+2]) == 78 \ - or ord(data[add+2]) == 80) and ord(data[add+3]) == 82 and ord(data[add+4]) == 77\ - and ord(data[add+5]) == 67): + if(data[add]) == 36 and data[add+1] == 71 and (data[add+2] == 78 \ + or data[add+2] == 80) and data[add+3] == 82 and data[add+4] == 77\ + and data[add+5] == 67: x = 0 z = 0 while(x < 12): From d1ba36440555aab29c4518d86e11d48374eaf3a7 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:58:04 -0400 Subject: [PATCH 17/56] 1 --- python/L76X.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/python/L76X.py b/python/L76X.py index 26965ab..7def7eb 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -110,25 +110,25 @@ def L76X_Gat_GNRMC(self): while(x < 12): if(add+z >= BUFFSIZE-1): return - if(ord(data[add+z]) == 44):#, + if(data[add+z]) == 44:#, x = x + 1 if(x == 1): Time = 0 for k in range(0, BUFFSIZE-1): if(add+z+k >= BUFFSIZE-1): return - if(ord(data[add+z+k+1]) == 44):#, + if(data[add+z+k+1]) == 44:#, break - if(ord(data[add+z+k+1]) == 46):#. + if(data[add+z+k+1]) == 46:#. break - Time = (ord(data[add+z+k+1]) - 48) + Time*10 + Time = (data[add+z+k+1]) - 48 + Time*10 self.Time_H = Time/10000 + 8 self.Time_M = Time/100%100 self.Time_S = Time%100 if(self.Time_H >= 24): self.Time_H = self.Time_H - 24 elif(x == 2): - if(ord(data[add+z+1]) == 65):#A + if(data[add+z+1]) == 65:#A self.Status = 1 else: self.Status = 0 @@ -137,11 +137,11 @@ def L76X_Gat_GNRMC(self): for k in range(0, BUFFSIZE-1): if(add+z+k >= BUFFSIZE-1): return - if(ord(data[add+z+k+1]) == 44):#, + if(data[add+z+k+1]) == 44:#, break - if(ord(data[add+z+k+1]) == 46):#. + if(data[add+z+k+1]) == 46:#. continue - latitude = (ord(data[add+z+k+1]) - 48) + latitude*10 + latitude = (data[add+z+k+1]) - 48 + latitude*10 self.Lat = latitude / 1000000.0 elif(x == 4): self.Lat_area = data[add+z+1] @@ -150,11 +150,11 @@ def L76X_Gat_GNRMC(self): for k in range(0, BUFFSIZE-1): if(add+z+k >= BUFFSIZE-1): return - if(ord(data[add+z+k+1]) == 44):#, + if(data[add+z+k+1]) == 44:#, break - if(ord(data[add+z+k+1]) == 46):#. + if(data[add+z+k+1]) == 46:#. continue - longitude = (ord(data[add+z+k+1]) - 48) + longitude*10 + longitude = (data[add+z+k+1]) - 48 + longitude*10 self.Lon = longitude / 1000000.0 elif(x == 6): From bc80433a2c01494ddce807bfa9df99c35f92bd2d Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 00:58:58 -0400 Subject: [PATCH 18/56] 1 --- python/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/main.py b/python/main.py index ffc55eb..d755316 100644 --- a/python/main.py +++ b/python/main.py @@ -10,7 +10,7 @@ time.sleep(2) x.L76X_Set_Baudrate(115200) - x.L76X_Send_Command(x.SET_POS_FIX_400MS) + x.L76X_Send_Command(x.SET_POS_FIX_10MS) #Set output message x.L76X_Send_Command(x.SET_NMEA_OUTPUT) From 42378619428b162f661605d6665a2057275ca371 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 01:00:14 -0400 Subject: [PATCH 19/56] 1 --- python/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/main.py b/python/main.py index d755316..852589d 100644 --- a/python/main.py +++ b/python/main.py @@ -10,7 +10,7 @@ time.sleep(2) x.L76X_Set_Baudrate(115200) - x.L76X_Send_Command(x.SET_POS_FIX_10MS) + x.L76X_Send_Command(x.SET_POS_FIX_100MS) #Set output message x.L76X_Send_Command(x.SET_NMEA_OUTPUT) From 46c41e983bc46d7c33d368b886ea4dc52a190017 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 01:02:37 -0400 Subject: [PATCH 20/56] 1 --- python/L76X.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/L76X.py b/python/L76X.py index 7def7eb..af92f37 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -83,22 +83,22 @@ def __init__(self): def L76X_Send_Command(self, data): Check = ord(data[1]) - print(Check) + # print(Check) for i in range(2, len(data)): Check = Check ^ ord(data[i]) data = data + Temp[16] - print(data) + # print(data) data = data + Temp[Check//16] data = data + Temp[(Check%16)] self.config.Uart_SendString(data.encode()) self.config.Uart_SendByte('\r'.encode()) self.config.Uart_SendByte('\n'.encode()) - print(data) + # print(data) def L76X_Gat_GNRMC(self): data = self.config.Uart_ReceiveString(BUFFSIZE) - print(data) - print('\n') + # print(data) + # print('\n') add=0 self.Status = 0 for i in range(0, BUFFSIZE-71): From e41868fdbc4dce3bd5904e9324c918d0256a48e0 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Fri, 18 Mar 2022 01:05:33 -0400 Subject: [PATCH 21/56] 1 --- python/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/main.py b/python/main.py index 852589d..6a6c225 100644 --- a/python/main.py +++ b/python/main.py @@ -22,10 +22,10 @@ print('Already positioned') else: print('No positioning') - print('Time %d:'%x.Time_H,) - print('%d:'%x.Time_M,) - print('%d'%x.Time_S) - + # print('Time %d:'%x.Time_H,) + # print('%d:'%x.Time_M,) + # print('%d'%x.Time_S) + print(int(time.time() * 1000)) print('Lon = %f'%x.Lon,) print(' Lat = %f'%x.Lat) x.L76X_Baidu_Coordinates(x.Lat, x.Lon) From 20bb98c1113ba5abfd0d10a8a9a75f9f938ec394 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 10:55:49 -0400 Subject: [PATCH 22/56] 1 --- python/main.py | 4 +++ python/redis_class.py | 72 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 python/redis_class.py diff --git a/python/main.py b/python/main.py index 6a6c225..7e73822 100644 --- a/python/main.py +++ b/python/main.py @@ -2,8 +2,10 @@ import time import math import traceback +import redis_class try: + redis = redis_class.RedisClient(host='192.168.0.150', port=6379, password="Redis2019!") x=L76X.L76X() x.L76X_Set_Baudrate(9600) x.L76X_Send_Command(x.SET_NMEA_BAUDRATE_115200) @@ -28,6 +30,8 @@ print(int(time.time() * 1000)) print('Lon = %f'%x.Lon,) print(' Lat = %f'%x.Lat) + redis.set('gps_lon', x.Lon) + redis.set('gps_lat', x.Lat) x.L76X_Baidu_Coordinates(x.Lat, x.Lon) print('Baidu coordinate %f'%x.Lat_Baidu,) print(',%f'%x.Lon_Baidu) diff --git a/python/redis_class.py b/python/redis_class.py new file mode 100644 index 0000000..08b5ed8 --- /dev/null +++ b/python/redis_class.py @@ -0,0 +1,72 @@ +import redis +import datetime +import json + +class RedisClient(object): + def __init__(self, host, port, password, database=0): + self.db = redis.Redis(host=host, port=port, password=password, db=database) + self.host = host + self.port = port + self.password = password + + def get(self, key, start_index=0, end_index=0): + try: + value = self.db.get(key).decode() + if value.isalpha(): + pass + elif "." in value and not ":" in value: + value = float(value) + elif value.count("-") > 1 and ":" in value: + value = datetime.datetime.strptime(value, "%Y-%m-%d %H:%M:%S.%f").timestamp() + elif value.count("-") >= 3: + pass + elif value.count("-") == 1 and value[1:].isnumeric(): + value = int(value) + elif value.isnumeric(): + value = int(value) + else: + pass + except Exception as e: + decoded_list = [] + value = self.db.lrange(key, start_index, end_index) + for i in range(len(value)): + if '{' in value[i].decode(): + value[i] = json.loads(value[i].decode()) + decoded_list.append(value[i]) + else: + decoded_list.append(value[i].decode()) + value = decoded_list + return value + + def get_all_keys(self): + keys = self.db.keys() + for i in range(len(keys)): + keys[i] = keys[i].decode() + return keys + + def get_all_keys_and_values(self): + key_value_dict = {} + keys = self.get_all_keys() + for i in range(len(keys)): + value = self.get(keys[i]) + key_value_dict[keys[i]] = value + return key_value_dict + + def set(self, key, value): + self.db.set(key, value) + + def set_multiple(self, key_value_dict): + pipe = self.db.pipeline() + for key, value in key_value_dict.items(): + pipe.set(key, value) + pipe.execute() + + def delete(self, key): + self.db.delete(key) + + def exists(self, key): + return self.db.exists(key) + +if __name__ == '__main__': + redis = RedisClient(host='192.168.0.150', port=6379, password="Redis2019!") + print(redis.get_all_keys_and_values()) \ No newline at end of file From 6e3c2f42516185f8209d43d2c500d09a27e69f72 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 10:58:28 -0400 Subject: [PATCH 23/56] 1 --- python/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/main.py b/python/main.py index 7e73822..fc5301a 100644 --- a/python/main.py +++ b/python/main.py @@ -30,7 +30,7 @@ print(int(time.time() * 1000)) print('Lon = %f'%x.Lon,) print(' Lat = %f'%x.Lat) - redis.set('gps_lon', x.Lon) + redis.set('gps_lon', -x.Lon) redis.set('gps_lat', x.Lat) x.L76X_Baidu_Coordinates(x.Lat, x.Lon) print('Baidu coordinate %f'%x.Lat_Baidu,) From 24f5746a5c432a9020b43e3591703c56f7f4f275 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 10:59:46 -0400 Subject: [PATCH 24/56] 1 --- python/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/main.py b/python/main.py index fc5301a..9fa6b1b 100644 --- a/python/main.py +++ b/python/main.py @@ -30,8 +30,9 @@ print(int(time.time() * 1000)) print('Lon = %f'%x.Lon,) print(' Lat = %f'%x.Lat) - redis.set('gps_lon', -x.Lon) + redis.set('gps_lon', x.Lon) redis.set('gps_lat', x.Lat) + print(type(x.Lon)) x.L76X_Baidu_Coordinates(x.Lat, x.Lon) print('Baidu coordinate %f'%x.Lat_Baidu,) print(',%f'%x.Lon_Baidu) From 758670a4fed5f2b14568b5d74730e55252746244 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:00:39 -0400 Subject: [PATCH 25/56] 1 --- python/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/main.py b/python/main.py index 9fa6b1b..48b6b20 100644 --- a/python/main.py +++ b/python/main.py @@ -30,6 +30,7 @@ print(int(time.time() * 1000)) print('Lon = %f'%x.Lon,) print(' Lat = %f'%x.Lat) + x.Lon = x.Lon * -1.0000000 redis.set('gps_lon', x.Lon) redis.set('gps_lat', x.Lat) print(type(x.Lon)) From f40aa9e3d0d9eac65216068b95533f79491caf00 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:02:04 -0400 Subject: [PATCH 26/56] 1 --- python/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/main.py b/python/main.py index 48b6b20..0a1d529 100644 --- a/python/main.py +++ b/python/main.py @@ -30,8 +30,8 @@ print(int(time.time() * 1000)) print('Lon = %f'%x.Lon,) print(' Lat = %f'%x.Lat) - x.Lon = x.Lon * -1.0000000 - redis.set('gps_lon', x.Lon) + # x.Lon = x.Lon * -1.0000000 + redis.set('gps_lng', x.Lon) redis.set('gps_lat', x.Lat) print(type(x.Lon)) x.L76X_Baidu_Coordinates(x.Lat, x.Lon) From f77aefd091d6cc61f55f82d28db67937c20a7f57 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:02:56 -0400 Subject: [PATCH 27/56] 1 --- python/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/main.py b/python/main.py index 0a1d529..4fd91eb 100644 --- a/python/main.py +++ b/python/main.py @@ -31,7 +31,7 @@ print('Lon = %f'%x.Lon,) print(' Lat = %f'%x.Lat) # x.Lon = x.Lon * -1.0000000 - redis.set('gps_lng', x.Lon) + redis.set('gps_lng', -1.0 * x.Lon) redis.set('gps_lat', x.Lat) print(type(x.Lon)) x.L76X_Baidu_Coordinates(x.Lat, x.Lon) From 2abcf06089b8ee0d92209d3b76314eced8a46091 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:05:38 -0400 Subject: [PATCH 28/56] 1 --- python/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/main.py b/python/main.py index 4fd91eb..1c4a9ba 100644 --- a/python/main.py +++ b/python/main.py @@ -31,6 +31,7 @@ print('Lon = %f'%x.Lon,) print(' Lat = %f'%x.Lat) # x.Lon = x.Lon * -1.0000000 + print(x) redis.set('gps_lng', -1.0 * x.Lon) redis.set('gps_lat', x.Lat) print(type(x.Lon)) From d44ef205d0ea485c041d3b0dd66f6ffd170be6c3 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:08:01 -0400 Subject: [PATCH 29/56] 1 --- python/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/main.py b/python/main.py index 1c4a9ba..bb14a4c 100644 --- a/python/main.py +++ b/python/main.py @@ -30,8 +30,8 @@ print(int(time.time() * 1000)) print('Lon = %f'%x.Lon,) print(' Lat = %f'%x.Lat) - # x.Lon = x.Lon * -1.0000000 - print(x) + print(x.GPS_Lat, x.GPS_Lon) + print(x.Goodle_Lat, x.Goodle_Lon) redis.set('gps_lng', -1.0 * x.Lon) redis.set('gps_lat', x.Lat) print(type(x.Lon)) From 2832f34b13b5e1859d89add8397359f3b1f4afb0 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:08:47 -0400 Subject: [PATCH 30/56] 1 --- python/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/main.py b/python/main.py index bb14a4c..9c3dec4 100644 --- a/python/main.py +++ b/python/main.py @@ -31,7 +31,7 @@ print('Lon = %f'%x.Lon,) print(' Lat = %f'%x.Lat) print(x.GPS_Lat, x.GPS_Lon) - print(x.Goodle_Lat, x.Goodle_Lon) + print(x.Lat_Goodle, x.Lon_Goodle) redis.set('gps_lng', -1.0 * x.Lon) redis.set('gps_lat', x.Lat) print(type(x.Lon)) From 1a9f5c45497cd069cfe295ac40a4a50bbd693101 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:09:46 -0400 Subject: [PATCH 31/56] 1 --- python/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python/main.py b/python/main.py index 9c3dec4..99e8dfb 100644 --- a/python/main.py +++ b/python/main.py @@ -30,10 +30,9 @@ print(int(time.time() * 1000)) print('Lon = %f'%x.Lon,) print(' Lat = %f'%x.Lat) - print(x.GPS_Lat, x.GPS_Lon) print(x.Lat_Goodle, x.Lon_Goodle) - redis.set('gps_lng', -1.0 * x.Lon) - redis.set('gps_lat', x.Lat) + redis.set('gps_lng', -1.0 * x.Lon_Goodle) + redis.set('gps_lat', x.Lat_Goodle) print(type(x.Lon)) x.L76X_Baidu_Coordinates(x.Lat, x.Lon) print('Baidu coordinate %f'%x.Lat_Baidu,) From 60ea346958b32548ec5758e3459513a60fbce5ec Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:14:12 -0400 Subject: [PATCH 32/56] 1 --- python/main.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/python/main.py b/python/main.py index 99e8dfb..bdec309 100644 --- a/python/main.py +++ b/python/main.py @@ -20,23 +20,23 @@ x.L76X_Exit_BackupMode() while(1): x.L76X_Gat_GNRMC() - if(x.Status == 1): - print('Already positioned') - else: - print('No positioning') + # if(x.Status == 1): + # print('Already positioned') + # else: + # print('No positioning') # print('Time %d:'%x.Time_H,) # print('%d:'%x.Time_M,) # print('%d'%x.Time_S) - print(int(time.time() * 1000)) - print('Lon = %f'%x.Lon,) - print(' Lat = %f'%x.Lat) + # print(int(time.time() * 1000)) + # print('Lon = %f'%x.Lon,) + # print(' Lat = %f'%x.Lat) print(x.Lat_Goodle, x.Lon_Goodle) - redis.set('gps_lng', -1.0 * x.Lon_Goodle) + redis.set('gps_lng', -1.00000000 * x.Lon_Goodle) redis.set('gps_lat', x.Lat_Goodle) - print(type(x.Lon)) - x.L76X_Baidu_Coordinates(x.Lat, x.Lon) - print('Baidu coordinate %f'%x.Lat_Baidu,) - print(',%f'%x.Lon_Baidu) + # print(type(x.Lon)) + # x.L76X_Baidu_Coordinates(x.Lat, x.Lon) + # print('Baidu coordinate %f'%x.Lat_Baidu,) + # print(',%f'%x.Lon_Baidu) except Exception as e: print(traceback.format_exc()) #GPIO.cleanup() From 57dfad1457d32d6d0c859fe06fb13398102ef33d Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:15:19 -0400 Subject: [PATCH 33/56] 1 --- python/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/main.py b/python/main.py index bdec309..6b4ff9f 100644 --- a/python/main.py +++ b/python/main.py @@ -30,11 +30,11 @@ # print(int(time.time() * 1000)) # print('Lon = %f'%x.Lon,) # print(' Lat = %f'%x.Lat) - print(x.Lat_Goodle, x.Lon_Goodle) + x.L76X_Baidu_Coordinates(x.Lat, x.Lon) + print(x.Lat_Goodle, -1.00000000 * x.Lon_Goodle) redis.set('gps_lng', -1.00000000 * x.Lon_Goodle) redis.set('gps_lat', x.Lat_Goodle) # print(type(x.Lon)) - # x.L76X_Baidu_Coordinates(x.Lat, x.Lon) # print('Baidu coordinate %f'%x.Lat_Baidu,) # print(',%f'%x.Lon_Baidu) except Exception as e: From 364e62f0f743cc34ae977d7b99d0f01b23d6271c Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:16:52 -0400 Subject: [PATCH 34/56] 1 --- python/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/main.py b/python/main.py index 6b4ff9f..2bf4fc5 100644 --- a/python/main.py +++ b/python/main.py @@ -31,8 +31,8 @@ # print('Lon = %f'%x.Lon,) # print(' Lat = %f'%x.Lat) x.L76X_Baidu_Coordinates(x.Lat, x.Lon) - print(x.Lat_Goodle, -1.00000000 * x.Lon_Goodle) - redis.set('gps_lng', -1.00000000 * x.Lon_Goodle) + print(x.Lat_Goodle, -x.Lon_Goodle) + redis.set('gps_lng', -x.Lon_Goodle) redis.set('gps_lat', x.Lat_Goodle) # print(type(x.Lon)) # print('Baidu coordinate %f'%x.Lat_Baidu,) From 078c6715de952df8d7d153628738e65277790b54 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:19:24 -0400 Subject: [PATCH 35/56] 1 --- python/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/main.py b/python/main.py index 2bf4fc5..21ea838 100644 --- a/python/main.py +++ b/python/main.py @@ -30,6 +30,7 @@ # print(int(time.time() * 1000)) # print('Lon = %f'%x.Lon,) # print(' Lat = %f'%x.Lat) + x.L76X_Google_Coordinates(x.Lat, x.Lon) x.L76X_Baidu_Coordinates(x.Lat, x.Lon) print(x.Lat_Goodle, -x.Lon_Goodle) redis.set('gps_lng', -x.Lon_Goodle) From 68fd2a4531a6679955f5c683a49dbf624f726235 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 11:20:21 -0400 Subject: [PATCH 36/56] 1 --- python/L76X.py | 12 ++++++------ python/main.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/python/L76X.py b/python/L76X.py index af92f37..0595f46 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -24,8 +24,8 @@ class L76X(object): Status = 0 Lon_Baidu = 0.0 Lat_Baidu = 0.0 - Lon_Goodle = 0.0 - Lat_Goodle = 0.0 + Lon_Google = 0.0 + Lat_Google = 0.0 GPS_Lon = 0 GPS_Lat = 0 @@ -178,8 +178,8 @@ def transformLon(self, x, y): return ret def bd_encrypt(self): - x = self.Lon_Goodle - y = self.Lat_Goodle + x = self.Lon_Google + y = self.Lat_Google z = math.sqrt(x * x + y * y) + 0.00002 * math.sin(y * x_pi) theta = math.atan2(y, x) + 0.000003 * math.cos(x * x_pi) self.Lon_Baidu = z * math.cos(theta) + 0.0065 @@ -194,8 +194,8 @@ def transform(self): math.sqrtMagic = math.sqrt(magic) dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) - self.Lat_Goodle = self.GPS_Lat + dLat - self.Lon_Goodle = self.GPS_Lon + dLon + self.Lat_Google = self.GPS_Lat + dLat + self.Lon_Google = self.GPS_Lon + dLon def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): self.GPS_Lat = U_Lat % 1 *100 / 60 + math.floor(U_Lat) diff --git a/python/main.py b/python/main.py index 21ea838..221a747 100644 --- a/python/main.py +++ b/python/main.py @@ -32,9 +32,9 @@ # print(' Lat = %f'%x.Lat) x.L76X_Google_Coordinates(x.Lat, x.Lon) x.L76X_Baidu_Coordinates(x.Lat, x.Lon) - print(x.Lat_Goodle, -x.Lon_Goodle) - redis.set('gps_lng', -x.Lon_Goodle) - redis.set('gps_lat', x.Lat_Goodle) + print(x.Lat_Google, -x.Lon_Google) + redis.set('gps_lng', -x.Lon_Google) + redis.set('gps_lat', x.Lat_Google) # print(type(x.Lon)) # print('Baidu coordinate %f'%x.Lat_Baidu,) # print(',%f'%x.Lon_Baidu) From cb1a313cb5cf9de90d72dcd4b4175c6adb1588d6 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Wed, 23 Mar 2022 12:11:37 -0400 Subject: [PATCH 37/56] 1 --- python/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/main.py b/python/main.py index 221a747..01b2f99 100644 --- a/python/main.py +++ b/python/main.py @@ -20,10 +20,10 @@ x.L76X_Exit_BackupMode() while(1): x.L76X_Gat_GNRMC() - # if(x.Status == 1): - # print('Already positioned') - # else: - # print('No positioning') + if(x.Status == 1): + redis.set('sat_use', 6) + else: + redis.set('sat_use', 0) # print('Time %d:'%x.Time_H,) # print('%d:'%x.Time_M,) # print('%d'%x.Time_S) From ac5070ac8799785e6a2a4699de8eb3c85ec03910 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:10:21 -0400 Subject: [PATCH 38/56] 1 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d3ce711..97a8a3c 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,5 @@ Uploaded only for the Raspberry Pi driver. ![L76X-GPS-Module-2.jpg](L76X-GPS-Module-2.jpg) +ttt + From 0101fc6ed082547038621604eda432ff62d6111f Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:10:56 -0400 Subject: [PATCH 39/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index 0595f46..bfb8aa1 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -187,7 +187,7 @@ def bd_encrypt(self): def transform(self): dLat = self.transformLat(self.GPS_Lon - 105.0, self.GPS_Lat - 35.0) - dLon = self.transformLon(self.GPS_Lon - 105.0, self.GPS_Lat - 35.0) + dLon = self.transformLon(self.GPS_Lon - 155.0, self.GPS_Lat - 35.0) radLat = self.GPS_Lat / 180.0 * pi magic = math.sin(radLat) magic = 1 - ee * magic * magic From 315e9c5cb9e5e9ee3b30cf47b9962c2557eb7e5f Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:11:29 -0400 Subject: [PATCH 40/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index bfb8aa1..67748b8 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -187,7 +187,7 @@ def bd_encrypt(self): def transform(self): dLat = self.transformLat(self.GPS_Lon - 105.0, self.GPS_Lat - 35.0) - dLon = self.transformLon(self.GPS_Lon - 155.0, self.GPS_Lat - 35.0) + dLon = self.transformLon(self.GPS_Lon - 90.0, self.GPS_Lat - 35.0) radLat = self.GPS_Lat / 180.0 * pi magic = math.sin(radLat) magic = 1 - ee * magic * magic From 9ca498d694ed0dd8c7b40f0c4434f4c2bde848b7 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:11:56 -0400 Subject: [PATCH 41/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index 67748b8..8279853 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -187,7 +187,7 @@ def bd_encrypt(self): def transform(self): dLat = self.transformLat(self.GPS_Lon - 105.0, self.GPS_Lat - 35.0) - dLon = self.transformLon(self.GPS_Lon - 90.0, self.GPS_Lat - 35.0) + dLon = self.transformLon(self.GPS_Lon - 60.0, self.GPS_Lat - 35.0) radLat = self.GPS_Lat / 180.0 * pi magic = math.sin(radLat) magic = 1 - ee * magic * magic From 007f86a97ae8ec27ac67696646bfad9488372d23 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:13:13 -0400 Subject: [PATCH 42/56] 1 --- python/L76X.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/L76X.py b/python/L76X.py index 8279853..09b3392 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -187,7 +187,7 @@ def bd_encrypt(self): def transform(self): dLat = self.transformLat(self.GPS_Lon - 105.0, self.GPS_Lat - 35.0) - dLon = self.transformLon(self.GPS_Lon - 60.0, self.GPS_Lat - 35.0) + dLon = self.transformLon(self.GPS_Lon - 105.0, self.GPS_Lat - 35.0) radLat = self.GPS_Lat / 180.0 * pi magic = math.sin(radLat) magic = 1 - ee * magic * magic @@ -195,7 +195,7 @@ def transform(self): dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) self.Lat_Google = self.GPS_Lat + dLat - self.Lon_Google = self.GPS_Lon + dLon + self.Lon_Google = self.GPS_Lon + dLon - 10 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): self.GPS_Lat = U_Lat % 1 *100 / 60 + math.floor(U_Lat) From e2dd7b8ec716cbcebc0ea9ba26aac4136048a335 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:13:51 -0400 Subject: [PATCH 43/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index 09b3392..9f7d370 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -195,7 +195,7 @@ def transform(self): dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) self.Lat_Google = self.GPS_Lat + dLat - self.Lon_Google = self.GPS_Lon + dLon - 10 + self.Lon_Google = self.GPS_Lon + dLon - .1 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): self.GPS_Lat = U_Lat % 1 *100 / 60 + math.floor(U_Lat) From 6117385f11e64ee6c78dc5f7d56aae7226423071 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:14:20 -0400 Subject: [PATCH 44/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index 9f7d370..01b1414 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -195,7 +195,7 @@ def transform(self): dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) self.Lat_Google = self.GPS_Lat + dLat - self.Lon_Google = self.GPS_Lon + dLon - .1 + self.Lon_Google = self.GPS_Lon + dLon - .001 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): self.GPS_Lat = U_Lat % 1 *100 / 60 + math.floor(U_Lat) From a188e0e856eb640d6bcf5b34e001d4d775fa1d70 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:14:54 -0400 Subject: [PATCH 45/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index 01b1414..7aca2ef 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -195,7 +195,7 @@ def transform(self): dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) self.Lat_Google = self.GPS_Lat + dLat - self.Lon_Google = self.GPS_Lon + dLon - .001 + self.Lon_Google = self.GPS_Lon + dLon - .009 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): self.GPS_Lat = U_Lat % 1 *100 / 60 + math.floor(U_Lat) From a5ffb0bbdebc07a2becc2710257dc5987682d220 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:15:26 -0400 Subject: [PATCH 46/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index 7aca2ef..27444b2 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -195,7 +195,7 @@ def transform(self): dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) self.Lat_Google = self.GPS_Lat + dLat - self.Lon_Google = self.GPS_Lon + dLon - .009 + self.Lon_Google = self.GPS_Lon + dLon - .0035 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): self.GPS_Lat = U_Lat % 1 *100 / 60 + math.floor(U_Lat) From 3442ee9e1a9da327b9a7e66385728e315fae08a2 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:15:53 -0400 Subject: [PATCH 47/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index 27444b2..855fe3d 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -195,7 +195,7 @@ def transform(self): dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) self.Lat_Google = self.GPS_Lat + dLat - self.Lon_Google = self.GPS_Lon + dLon - .0035 + self.Lon_Google = self.GPS_Lon + dLon - .0032 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): self.GPS_Lat = U_Lat % 1 *100 / 60 + math.floor(U_Lat) From e7ac3a6bc4c7f26b06ca5579630d12da2b7e912d Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:16:31 -0400 Subject: [PATCH 48/56] 1 --- python/L76X.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/L76X.py b/python/L76X.py index 855fe3d..e7c89b9 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -194,8 +194,8 @@ def transform(self): math.sqrtMagic = math.sqrt(magic) dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) - self.Lat_Google = self.GPS_Lat + dLat - self.Lon_Google = self.GPS_Lon + dLon - .0032 + self.Lat_Google = self.GPS_Lat + dLat - 0.0005 + self.Lon_Google = self.GPS_Lon + dLon - .0031 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): self.GPS_Lat = U_Lat % 1 *100 / 60 + math.floor(U_Lat) From a7bd3ce62431614ecb427443d298bf423d4f01a1 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:17:04 -0400 Subject: [PATCH 49/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index e7c89b9..ec54806 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -194,7 +194,7 @@ def transform(self): math.sqrtMagic = math.sqrt(magic) dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) - self.Lat_Google = self.GPS_Lat + dLat - 0.0005 + self.Lat_Google = self.GPS_Lat + dLat - 0.00005 self.Lon_Google = self.GPS_Lon + dLon - .0031 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): From 6b1d2db50dd733fc17df367049ba3411121d2707 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:17:37 -0400 Subject: [PATCH 50/56] 1 --- python/L76X.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/L76X.py b/python/L76X.py index ec54806..ebbd45a 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -194,8 +194,8 @@ def transform(self): math.sqrtMagic = math.sqrt(magic) dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) - self.Lat_Google = self.GPS_Lat + dLat - 0.00005 - self.Lon_Google = self.GPS_Lon + dLon - .0031 + self.Lat_Google = self.GPS_Lat + dLat - 0.00006 + self.Lon_Google = self.GPS_Lon + dLon - .00305 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): self.GPS_Lat = U_Lat % 1 *100 / 60 + math.floor(U_Lat) From 35a490d33462029dd0cad63966c773a7ab67e117 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:18:13 -0400 Subject: [PATCH 51/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index ebbd45a..9f2d5ab 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -195,7 +195,7 @@ def transform(self): dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) self.Lat_Google = self.GPS_Lat + dLat - 0.00006 - self.Lon_Google = self.GPS_Lon + dLon - .00305 + self.Lon_Google = self.GPS_Lon + dLon - .00298 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): self.GPS_Lat = U_Lat % 1 *100 / 60 + math.floor(U_Lat) From dbc8c2ade6e8c0723dc775028062d60883de83cd Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:18:48 -0400 Subject: [PATCH 52/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index 9f2d5ab..b671e3f 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -195,7 +195,7 @@ def transform(self): dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) self.Lat_Google = self.GPS_Lat + dLat - 0.00006 - self.Lon_Google = self.GPS_Lon + dLon - .00298 + self.Lon_Google = self.GPS_Lon + dLon - .00293 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): self.GPS_Lat = U_Lat % 1 *100 / 60 + math.floor(U_Lat) From 7849af9c003d9b09c28488d8223e1750acd02954 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:19:19 -0400 Subject: [PATCH 53/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index b671e3f..cc38ed6 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -194,7 +194,7 @@ def transform(self): math.sqrtMagic = math.sqrt(magic) dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) - self.Lat_Google = self.GPS_Lat + dLat - 0.00006 + self.Lat_Google = self.GPS_Lat + dLat - 0.00005 self.Lon_Google = self.GPS_Lon + dLon - .00293 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): From cd24c8bc73b56de86750933273f19d63aa4e2a91 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:19:44 -0400 Subject: [PATCH 54/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index cc38ed6..a5cc27b 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -194,7 +194,7 @@ def transform(self): math.sqrtMagic = math.sqrt(magic) dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) - self.Lat_Google = self.GPS_Lat + dLat - 0.00005 + self.Lat_Google = self.GPS_Lat + dLat - 0.00007 self.Lon_Google = self.GPS_Lon + dLon - .00293 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): From 1b10bfb8ef0a7765dbc76a6f104ccd08e996ac2c Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:20:26 -0400 Subject: [PATCH 55/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index a5cc27b..f57abea 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -194,7 +194,7 @@ def transform(self): math.sqrtMagic = math.sqrt(magic) dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) - self.Lat_Google = self.GPS_Lat + dLat - 0.00007 + self.Lat_Google = self.GPS_Lat + dLat - 0.00004 self.Lon_Google = self.GPS_Lon + dLon - .00293 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon): From b57e38c8679256c8cbe1952513756364bd797875 Mon Sep 17 00:00:00 2001 From: digiwhale Date: Sat, 26 Mar 2022 19:20:57 -0400 Subject: [PATCH 56/56] 1 --- python/L76X.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/L76X.py b/python/L76X.py index f57abea..359d9f3 100644 --- a/python/L76X.py +++ b/python/L76X.py @@ -194,7 +194,7 @@ def transform(self): math.sqrtMagic = math.sqrt(magic) dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * math.sqrtMagic) * pi) dLon = (dLon * 180.0) / (a / math.sqrtMagic * math.cos(radLat) * pi) - self.Lat_Google = self.GPS_Lat + dLat - 0.00004 + self.Lat_Google = self.GPS_Lat + dLat - 0.00003 self.Lon_Google = self.GPS_Lon + dLon - .00293 def L76X_Baidu_Coordinates(self, U_Lat, U_Lon):