@@ -183,41 +183,42 @@ def on_read_raw(self, data):
183183 def thread_debug_port_receiver (self , * args , ** kwargs ):
184184 if self .debug_logf is None :
185185 return
186- is_get_configuration = 0
187- file_name = args [0 ]
188- self .debug_c_f = open (file_name + '/' + 'configuration.txt' ,"w" )
189-
190- while True :
191- if is_get_configuration :
192- break
193- cmd_configuration = 'get configuration\r '
194- self .debug_serial_port .write (cmd_configuration .encode ())
195- try_times = 20
196- for i in range (try_times ):
197- data_buffer = self .debug_serial_port .read (500 )
198- if len (data_buffer ):
199- try :
200- #print('len = {0}'.format(len(data_buffer)))
201- str_data = bytes .decode (data_buffer )
202- #print('{0}'.format(str_data))
203- json_data = json .loads (data_buffer )
204- for key in json_data .keys ():
205- if key == 'openrtk configuration' :
206- print ('{0}' .format (json_data ))
207- if self .debug_c_f :
208- self .debug_c_f .write (str_data )
209- self .debug_c_f .close ()
210- is_get_configuration = 1
211- if is_get_configuration :
212- break
213- except Exception as e :
214- #print('DEBUG PORT Thread:json error:', e)
215- #the json will not be completed
216- pass
217-
218-
219- cmd_log = 'log com3 P1\r '
220- self .debug_serial_port .write (cmd_log .encode ())
186+
187+ if self .app_info ['app_name' ] == 'INS' :
188+ is_get_configuration = 0
189+ file_name = args [0 ]
190+ self .debug_c_f = open (file_name + '/' + 'configuration.txt' ,"w" )
191+
192+ while True :
193+ if is_get_configuration :
194+ break
195+ cmd_configuration = 'get configuration\r '
196+ self .debug_serial_port .write (cmd_configuration .encode ())
197+ try_times = 20
198+ for i in range (try_times ):
199+ data_buffer = self .debug_serial_port .read (500 )
200+ if len (data_buffer ):
201+ try :
202+ #print('len = {0}'.format(len(data_buffer)))
203+ str_data = bytes .decode (data_buffer )
204+ #print('{0}'.format(str_data))
205+ json_data = json .loads (data_buffer )
206+ for key in json_data .keys ():
207+ if key == 'openrtk configuration' :
208+ print ('{0}' .format (json_data ))
209+ if self .debug_c_f :
210+ self .debug_c_f .write (str_data )
211+ self .debug_c_f .close ()
212+ is_get_configuration = 1
213+ if is_get_configuration :
214+ break
215+ except Exception as e :
216+ #print('DEBUG PORT Thread:json error:', e)
217+ #the json will not be completed
218+ pass
219+
220+ cmd_log = 'log com3 P1\r '
221+ self .debug_serial_port .write (cmd_log .encode ())
221222
222223 # log data
223224 while True :
0 commit comments