コード例 #1
0
ファイル: magui.py プロジェクト: G3UKB/magloop-controller
 def __configEvnt(self, event):
     """
     Run the configurator
     
     Arguments:
         event   -- ui event object
         
     """
     
     self.__settings, r = configurationdialog.ConfigurationDialog.getConfig(self.__cat, self.__api, self.__settings, self.loopcombo.currentText())
     # Restore the magcontrol callback in case it was nicked
     self.__api.restoreCallback()
     # If Ok save the new config and update internally
     if r:
         # Settings
         persist.saveCfg(SETTINGS_PATH, self.__settings)
         # Update the UI
         self.loopcombo.clear()
         self.freqcombo.clear()
         if len(self.__settings[LOOP_SETTINGS]) > 0:
             for key in sorted(self.__settings[LOOP_SETTINGS].keys()):
                 self.loopcombo.addItem(str(key))
             if len(self.__settings[LOOP_SETTINGS][self.loopcombo.currentText()][I_SETPOINTS]) > 0:
                 for key in sorted(self.__settings[LOOP_SETTINGS][self.loopcombo.currentText()][I_SETPOINTS].keys()):
                     self.freqcombo.addItem(str(key))
         else:
             self.loopcombo.clear()
         # Update motor in idle time
         self.__doUpdate = True
         # Network settings
         self.__api.resetNetworkParams(self.__settings[ARDUINO_SETTINGS][NETWORK][IP], self.__settings[ARDUINO_SETTINGS][NETWORK][PORT])       
コード例 #2
0
ファイル: magui.py プロジェクト: G3UKB/magloop-controller
 def quit(self):
     """ User hit quit """
     
     # Save the current settings
     persist.saveCfg(SETTINGS_PATH, self.__settings)
     self.__state[WINDOW][X_POS] = self.x()
     self.__state[WINDOW][Y_POS] = self.y()
     persist.saveCfg(STATE_PATH, self.__state)
     # Close
     QtCore.QCoreApplication.instance().quit()