mirror of
https://github.com/openplotter/openplotter-maiana.git
synced 2025-05-27 20:40:14 -07:00
fix issue with aproving SK connection
This commit is contained in:
parent
f937948ed5
commit
2c0fcd6b35
@ -26,7 +26,7 @@ def main():
|
||||
package = 'openplotter-maiana'
|
||||
language.Language(currentdir, package, currentLanguage)
|
||||
|
||||
print(_('Removing openplotter-maiana-read services...'))
|
||||
print(_('Removing openplotter-maiana-read service...'))
|
||||
try:
|
||||
subprocess.call(['systemctl', 'disable', 'openplotter-maiana-read'])
|
||||
subprocess.call(['systemctl', 'stop', 'openplotter-maiana-read'])
|
||||
|
@ -147,6 +147,7 @@ class MyFrame(wx.Frame):
|
||||
self.logger.Clear()
|
||||
self.logger2.Clear()
|
||||
self.device = self.conf.get('MAIANA', 'device')
|
||||
self.toolbar1.EnableTool(105,False)
|
||||
self.toolbar2.EnableTool(202,False)
|
||||
self.toolbar3.EnableTool(302,False)
|
||||
self.toolbar3.EnableTool(303,False)
|
||||
@ -156,6 +157,25 @@ class MyFrame(wx.Frame):
|
||||
availableIDs = []
|
||||
selected = ''
|
||||
self.tx = False
|
||||
|
||||
skConnections = connections.Connections('MAIANA')
|
||||
result = skConnections.checkConnection()
|
||||
if result[0] == 'pending':
|
||||
self.toolbar1.EnableTool(105,True)
|
||||
self.ShowStatusBarYELLOW(result[1]+_(' Press "Approve" and then "Refresh".'))
|
||||
return
|
||||
elif result[0] == 'error':
|
||||
self.ShowStatusBarRED(result[1])
|
||||
return
|
||||
elif result[0] == 'repeat':
|
||||
self.ShowStatusBarYELLOW(result[1]+_(' Press "Refresh".'))
|
||||
return
|
||||
elif result[0] == 'permissions':
|
||||
self.ShowStatusBarYELLOW(result[1]+_(' Press "Allowed".'))
|
||||
return
|
||||
elif result[0] == 'approved':
|
||||
self.ShowStatusBarGREEN(result[1])
|
||||
|
||||
try:
|
||||
setting_file = self.platform.skDir+'/settings.json'
|
||||
with open(setting_file) as data_file:
|
||||
@ -368,21 +388,6 @@ class MyFrame(wx.Frame):
|
||||
if 'bowOffset' in data['station']: self.bowOffset.SetValue(str(data['station']['bowOffset']['value']))
|
||||
if 'portOffset' in data['station']: self.portOffset.SetValue(str(data['station']['portOffset']['value']))
|
||||
|
||||
self.toolbar1.EnableTool(105,False)
|
||||
skConnections = connections.Connections('MAIANA')
|
||||
result = skConnections.checkConnection()
|
||||
if result[0] == 'pending':
|
||||
self.toolbar1.EnableTool(105,True)
|
||||
self.ShowStatusBarYELLOW(result[1]+_(' Press "Approve" and then "Refresh".'))
|
||||
elif result[0] == 'error':
|
||||
self.ShowStatusBarRED(result[1])
|
||||
elif result[0] == 'repeat':
|
||||
self.ShowStatusBarYELLOW(result[1]+_(' Press "Refresh".'))
|
||||
elif result[0] == 'permissions':
|
||||
self.ShowStatusBarYELLOW(result[1]+_(' Press "Allowed".'))
|
||||
elif result[0] == 'approved':
|
||||
self.ShowStatusBarGREEN(result[1])
|
||||
|
||||
if deviceOld != self.device:
|
||||
if self.device:
|
||||
subprocess.Popen([self.platform.admin, 'python3', self.currentdir+'/service.py', 'openplotter-maiana-read', 'restart'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user