当前位置: 首页>>代码示例>>Python>>正文


Python Utils.preferences方法代码示例

本文整理汇总了Python中utils.Utils.preferences方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.preferences方法的具体用法?Python Utils.preferences怎么用?Python Utils.preferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utils.Utils的用法示例。


在下文中一共展示了Utils.preferences方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: GPSunceckbuttons

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import preferences [as 别名]
 def GPSunceckbuttons(self):
     Utils.preferences().setSettings('actionGPS',self.actionT_GPS.isChecked())
     self.actionT_LonLat.setChecked(False)
     if Utils.haveGRASS_ != 0:
         self.actionT_Grass.setChecked(False)
     #TBD
     """
     if self.actionJoystick.isChecked():
         self.joy.stop()
         self.actionJoystick.setChecked(False)
     """    
     if self.actionT_HW.isChecked():
         self.hw.stop()
         self.actionT_HW.setChecked(False)
开发者ID:epifanio,项目名称:planetsasha,代码行数:16,代码来源:sashamainwindow.py

示例2: ResetPosition

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import preferences [as 别名]
 def ResetPosition(self):
     #xprint 'reset position'
     head = self.head
     if head == str('Manual'):
         self.heads = self.HandlingSlider.value()
     if Utils.preferences().getSettings('actionLonLat'):
         self.fxvallon = self.SetPosition()[0]
         self.fxvallat = self.SetPosition()[1]
         if self.northeast.isChecked():
             (z, e, n) = LLtoUTM(ell, self.fxvallat, self.fxvallon)
             self.Nord.setText(str(n))
             self.east.setText(str(e))
             self.utmcode.setText(str(z))
         ossimxml =  Utils.makeActionTemplate(self.item, unicode(self.fxvallon), unicode(self.fxvallat), 
                                          self.ZoomSlider.value(), 0, 0, 
                                          0, self.RangeSlider.value())
         self.Lat.setText(unicode(self.fxvallat))
         self.Lon.setText(unicode(self.fxvallon))
         self.fireAction(ossimxml)
     if Utils.haveGRASS_ != 0:
         if self.actionGrass.isChecked():
             self.slvallon = self.getCenter()[0]
             self.slvallat = self.getCenter()[1]
             #xprint self.slvallon, self.slvallat
             if self.northeast.isChecked():
                 xy = getlonlat(self.slvallon,self.slvallat)
                 self.Nord.setText(xy[1])
                 self.east.setText(xy[0])
         ossimxml =  Utils.makeActionTemplate(self.item, unicode(self.slvallon), unicode(self.slvallat), 
                                          self.ZoomSlider.value(), 0, 0, 
                                          0, self.RangeSlider.value())
         self.Lat.setText(unicode(self.slvallat))
         self.Lon.setText(unicode(self.slvallon))
         self.fireAction(ossimxml)
     if Utils.preferences().getSettings('actionGPS'):
         #self.CrossClassLon = float(self.CrossClassLon)
         #self.CrossClassLat = float(self.CrossClassLat)
         coordsfile = apppath+'/lonlatfile'
         f = open(coordsfile, "r")
         lonlat = f.readline()
         lonlat = lonlat.split(' ')
         lon = lonlat[0]
         lat = lonlat[1]
         ossimxml =  Utils.makeActionTemplate(self.item, lon, lat, self.ZoomSlider.value(), self.heads, 
                                          self.PitchSlider.value(), self.RollSlider.value(),
                                          self.RangeSlider.value())
         self.Lat.setText(unicode(self.CrossClassLat))
         self.Lon.setText(unicode(self.CrossClassLon))
         self.fireAction(ossimxml)
开发者ID:epifanio,项目名称:planetsasha,代码行数:51,代码来源:navigationwindow.py

示例3: onTActionBroadCast

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import preferences [as 别名]
 def onTActionBroadCast(self):
     checked = self.actionT_Broadcast.isChecked()
     print checked
     self.actionT_Broadcast.setChecked(checked)
     Utils.preferences().setSettings('actionBroadcast', checked )
     self.actionT_GPS.setChecked(False)
     self.actionT_LonLat.setChecked(False)
     if Utils.haveGRASS_ != 0:
         self.actionT_Grass.setChecked(False)
     #self.actionJoystick.setChecked(False)
     self.actionT_HW.setChecked(False) 
     if self.navwin:
         self.navwin.toogleBroadCast(self.actionT_Broadcast.isChecked())
     else:
         print 'nav win not created'       
开发者ID:epifanio,项目名称:planetsasha,代码行数:17,代码来源:sashamainwindow.py

示例4: getViewVal

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import preferences [as 别名]
 def getViewVal(self):
     #lon,lat,zoom,heads,pitch,roll,range = 0,0,0,0,0,0,0
     pitch = self.PitchSlider.value()
     roll = self.RollSlider.value()
     rng = self.RangeSlider.value()
     zoom = self.ZoomSlider.value()
     heads = self.head
     lon = self.Lon.text()
     lat = self.Lat.text()
     if heads == str('Manual'):
         heads = self.HandlingSlider.value()
     if Utils.preferences().getSettings('actionLonLat'): #self.actionLonLat.isChecked():
         lat = self.fxvallat
         lon = self.fxvallon
         if self.northeast.isChecked():
             (z, e, n) = LLtoUTM(ell, lat, lon)
             self.Nord.setText(str(n))
             self.east.setText(str(e))
             self.utmcode.setText(str(z))
     """
     TBMV: to grass and gps window
     if Utils.haveGRASS_ != 0:
         if Utils.preferences().getSettings('actionGrass'): #self.actionGrass.isChecked():
             lon = self.slvallon
             lat = self.slvallat
             if self.northeast.isChecked():
                 xy = getlonlat(lon,lat)
                 self.Nord.setText(xy[1])
                 self.east.setText(xy[0])
     if Utils.preferences().getSettings('actionGPS'): #self.actionGPS.isChecked():
         lon = self.GPSlon.text()
         lat = self.GPSlat.text()
     """    
     pos = [lon,lat,zoom,heads,pitch,roll,rng]
     return pos
开发者ID:epifanio,项目名称:planetsasha,代码行数:37,代码来源:navigationwindow.py

示例5: sendFunction

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import preferences [as 别名]
 def sendFunction(self):
     if Utils.preferences().getSettings('actionLonLat'):
         pos = self.getViewVal()
         #xprint pos
         ossimxml =  Utils.makeActionTemplate(self.item, pos[0], pos[1], pos[2], pos[3], pos[4], pos[5], pos[6])
         self.fireAction(ossimxml)
         self.Lat.setText(unicode(pos[1]))
         self.Lon.setText(unicode(pos[0]))
开发者ID:epifanio,项目名称:planetsasha,代码行数:10,代码来源:navigationwindow.py

示例6: onTActionLonLat

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import preferences [as 别名]
    def onTActionLonLat(self):

        checked = not self.actionT_LonLat.isChecked()
        self.actionT_Broadcast.setChecked(checked)
        Utils.preferences().setSettings('actionLonLat', checked )
        
        if self.actionT_GPS.isChecked():
            self.gpsx.stop()
            self.actionT_GPS.setChecked(False)
        if Utils.haveGRASS_ != 0:
            self.actionT_Grass.setChecked(False)
        #if self.actionJoystick.isChecked():
        #    self.joy.stop()
        #    self.actionJoystick.setChecked(False)
        if self.actionT_HW.isChecked():
            self.hw.stop()
            self.actionT_HW.setChecked(False)
开发者ID:epifanio,项目名称:planetsasha,代码行数:19,代码来源:sashamainwindow.py

示例7: pan

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import preferences [as 别名]
    def pan(self, action):
        step = float(self.SpeedSpinBox.value())
        mult = float(self.SpeedMultipler.value())
        step = step * (10 ** -mult)

        if Utils.preferences().getSettings('actionLonLat'):
            if action == 'inclat' :
                self.fxvallat += step
            if action == 'inclon' :
                self.fxvallon += step
            if action == 'declat' :
                self.fxvallat -= step
            if action == 'declon' :
                self.fxvallon -= step
            if action == 'inclatlon' :
                self.fxvallat += step
                self.fxvallon += step
            if action == 'declatlon' :
                self.fxvallat -= step
                self.fxvallon -= step
            if action == 'inclatdeclon' :
                self.fxvallat += step
                self.fxvallon -= step
            if action == 'declatinclon' :
                self.fxvallat -= step 
                self.fxvallon += step
        if Utils.haveGRASS_ != 0:
            if self.actionGrass.isChecked():
                if action == 'inclat' :
                    self.slvallat += step
                if action == 'inclon' :
                    self.slvallon += step
                if action == 'declat' :
                    self.slvallat -= step
                if action == 'declon' :
                    self.slvallon -= step
                if action == 'inclatlon' :
                    self.slvallat += step
                    self.slvallon += step
                if action == 'declatlon' :
                    self.slvallat -= step
                    self.slvallon -= step
                if action == 'inclatdeclon' :
                    self.slvallat += step
                    self.slvallon -= step
                if action == 'declatinclon' :
                    self.slvallat -= step 
                    self.slvallon += step
        pos = self.getViewVal()
        ossimxml =  Utils.makeActionTemplate(self.item, pos[0], pos[1], pos[2], pos[3], pos[4], pos[5], pos[6])
        self.fireAction(ossimxml)
        self.Lat.setText(unicode(pos[1]))
        self.Lon.setText(unicode(pos[0]))
开发者ID:epifanio,项目名称:planetsasha,代码行数:55,代码来源:navigationwindow.py

示例8: fireAction

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import preferences [as 别名]
 def fireAction(self, xml):
     result = Utils.fireAction(xml)
     if result < 0:
             if not Utils.preferences().getSettings('actionBroadcast'):#self.actionBroadcast.isChecked(): FIXME
                 self.CeckViewTypeState()
开发者ID:epifanio,项目名称:planetsasha,代码行数:7,代码来源:navigationwindow.py

示例9: CeckViewTypeState

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import preferences [as 别名]
 def CeckViewTypeState(self):
     if not Utils.preferences().getSettings('actionLonLat'): #self.actionLonLat.isChecked():
         if Utils.haveGRASS_ !=0:
             if not Utils.preferences().getSettings('actionGrass'): #self.actionGrass.isChecked():
                 #self.worningmessage('check a view type')
                 x = 1
开发者ID:epifanio,项目名称:planetsasha,代码行数:8,代码来源:navigationwindow.py


注:本文中的utils.Utils.preferences方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。