@@ -203,6 +203,8 @@ async def close_banner(e):
203203 global bannerContents
204204 bannerContents = ft .Text ("" )
205205
206+ global isRecordStop
207+ isRecordStop = True
206208
207209 global connectStatus
208210 connectStatus = False
@@ -269,8 +271,8 @@ async def addRealtimeData(resList, resListFloat):
269271 for i in range (0 , 9 ):
270272 realtimeData [i ].value = resList [i ]
271273 # rtNowData[i].on_click=lambda e: pyperclip.copy(resList[i])
272- global recordStartTime , recordStatus , recordDataStatus , recordRawData , recordDateTime , recordBaloonName
273- if recordStatus :
274+ global recordStartTime , recordStatus , recordDataStatus , recordRawData , recordDateTime , recordBaloonName , isRecordStop
275+ if isRecordStop == False :
274276 if recordStartTime == - 1.0 :
275277 recordStartTime = resListFloat [0 ]
276278 recordRawData += "time[sec], temperature[degC], pressure[hPa], humidity[%], altitude[m], a0, a1, a2, a3\n "
@@ -328,8 +330,8 @@ async def addRealtimeData(resList, resListFloat):
328330 a3 .append (resListFloat [8 ])
329331 await realtimeGraphSystem .set (time = time [- 100 :], temp = temp [- 100 :], pressure = pressure [- 100 :], humidity = humidity [- 100 :], altitude = altitude [- 100 :], a0 = a0 [- 100 :], a1 = a1 [- 100 :], a2 = a2 [- 100 :], a3 = a3 [- 100 :])
330332
331- if recordStatus :
332- await tempGraphSystem .set (time = r_time , temp = r_temp , pressure = r_pressure , humidity = r_humidity , altitude = r_altitude , a0 = r_a0 , a1 = r_a1 , a2 = r_a2 , a3 = r_a3 )
333+ # if recordStatus:
334+ # await tempGraphSystem.set(time=r_time, temp=r_temp, pressure=r_pressure, humidity=r_humidity, altitude=r_altitude, a0=r_a0, a1=r_a1, a2=r_a2, a3=r_a3)
333335
334336 await page .update_async ()
335337
@@ -412,11 +414,22 @@ async def connectPC(e):
412414 return ()
413415 await close_banner (e )
414416 global connectStatus
417+ global recordStatus , isRecordStop
415418 connectStatus = True
416419 setuzokuStartButton .text = "接続中..."
417420 setuzokusaki .disabled = True
418421 setuzokuStartButton .disabled = True
419422 setuzokuStopButton .disabled = False
423+ time .clear ()
424+ temp .clear ()
425+ pressure .clear ()
426+ humidity .clear ()
427+ altitude .clear ()
428+ a0 .clear ()
429+ a1 .clear ()
430+ a2 .clear ()
431+ a3 .clear ()
432+ await realtimeGraphSystem .reset ()
420433 await setuzokuStartButton .update_async ()
421434 await setuzokusaki .update_async ()
422435 await page .update_async ()
@@ -432,10 +445,13 @@ async def connectPC(e):
432445
433446 # await setuzokuStatusView.update_async()
434447 break
448+ if recordStatus == False :
449+ isRecordStop = True
450+ else :
451+ isRecordStop = False
435452 if not line :
436453 continue
437-
438- # print(line)
454+ print (line )
439455 await event_listener (line )
440456
441457 # if line.startswith('data:'):
@@ -1227,6 +1243,7 @@ async def recordStop(e):
12271243 await recordStartButton .update_async ()
12281244 await recordSaveButton .update_async ()
12291245 await recordDeleteButton .update_async ()
1246+ await tempGraphSystem .set (time = r_time , temp = r_temp , pressure = r_pressure , humidity = r_humidity , altitude = r_altitude , a0 = r_a0 , a1 = r_a1 , a2 = r_a2 , a3 = r_a3 )
12301247 await page .update_async ()
12311248
12321249 async def recordStart (e ):
@@ -1320,6 +1337,9 @@ async def dataCopy(e):
13201337 ###################
13211338
13221339 async def move_vertical_divider (e : ft .DragUpdateEvent ):
1340+ global connectStatus
1341+ if connectStatus :
1342+ return ()
13231343 if (e .delta_x > 0 and tab0c .widtha () < 1500 ) or (e .delta_x < 0 and tab0c .widtha () > 800 ):
13241344 await tab0c .widthPlus (e .delta_x )
13251345 await tab0c .update_async ()
@@ -1328,6 +1348,9 @@ async def move_vertical_divider(e: ft.DragUpdateEvent):
13281348 await tab1c .update_async ()
13291349
13301350 async def show_draggable_cursor (e : ft .HoverEvent ):
1351+ global connectStatus
1352+ if connectStatus :
1353+ return ()
13311354 e .control .mouse_cursor = ft .MouseCursor .RESIZE_LEFT_RIGHT
13321355 await e .control .update_async ()
13331356
0 commit comments