質問編集履歴
2
ソース冒頭に ```python を付け加えました
title
CHANGED
File without changes
|
body
CHANGED
@@ -22,17 +22,12 @@
|
|
22
22
|
GUI Tkinter
|
23
23
|
|
24
24
|
ソース
|
25
|
-
python
|
25
|
+
```python
|
26
26
|
def ft991_SET_GPS_TIME():
|
27
27
|
global FT991
|
28
28
|
global GPS
|
29
29
|
msec10 = '10'
|
30
30
|
tz_ = 9
|
31
|
-
#J_gpstime = 'None'#文字
|
32
|
-
#U_gpstime = 'None'#文字
|
33
|
-
#J_gpsdate = 'None'#文字
|
34
|
-
#U_gpsdate = 'None'#文字
|
35
|
-
#GPS_STABLE = 'V'#文字
|
36
31
|
hour = GPS.U_gpstime[0:2]
|
37
32
|
minute = GPS.U_gpstime[2:4]
|
38
33
|
sec = GPS.U_gpstime[4:6]
|
@@ -47,15 +42,14 @@
|
|
47
42
|
dtrmc = dt
|
48
43
|
#dtrmc = 20211205234512
|
49
44
|
gnsstime = dtrmc.strftime("%Y-%m-%d %H:%M:%S")
|
50
|
-
#print('gnsstime', gnsstime)
|
51
|
-
#gnsstime = '2021-12-04 23:05:40'dtrmc.strftime("%Y-%m-%d %H:%M:%S")
|
52
45
|
if( GPS.GPS_STABLE == 'A' ):#安定受信
|
53
46
|
if "Linux" in platform.system():
|
54
47
|
print('if_gnsstime', gnsstime)
|
55
48
|
print('GPS.GPS_STABLE', GPS.GPS_STABLE)
|
56
49
|
subprocess.call(["/usr/bin/timedatectl", "set-ntp", "no"])
|
57
50
|
subprocess.call(["/usr/bin/timedatectl", "set-time", gnsstime])
|
58
|
-
#subprocess.call(["sudo /usr/bin/timedatectl", "set-time", gnsstime])
|
59
51
|
subprocess.call(["/usr/bin/timedatectl","set-ntp","yes"])
|
52
|
+
```
|
60
53
|
|
54
|
+
|
61
55
|
以上よろしくお願いいたします。
|
1
ご指摘のとおりpythonの行を追加しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -22,6 +22,7 @@
|
|
22
22
|
GUI Tkinter
|
23
23
|
|
24
24
|
ソース
|
25
|
+
python
|
25
26
|
def ft991_SET_GPS_TIME():
|
26
27
|
global FT991
|
27
28
|
global GPS
|