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)
def SetLonLat(self): host = self.setparamconnection()[0] nav = self.setparamconnection()[1] heads = head if head == str('Manual'): heads = self.HandlingSlider.value() if self.actionLonLat.isChecked(): if self.NorthEast.isChecked(): (z, e, n) = LLtoUTM(ell, float(self.Lat.text()), float(self.Lon.text())) self.Nord.setText(str(n)) self.East.setText(str(e)) self.utmcode.setText(str(z)) if Utils.haveGRASS_ != 0: if self.actionGrass.isChecked(): if self.NorthEast.isChecked(): xy = getlonlat(self.fxvallon,self.fxvallat) #xprint xy ossimxml = Utils.makeActionTemplate(self.item, unicode(self.Lon.text()), unicode(self.Lat.text()), self.ZoomSlider.value(), heads, self.PitchSlider.value(), self.RollSlider.value(), self.RangeSlider.value()) ossim = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ossim.connect((host, int(nav))) try: ossim.send(ossimxml) ossim.close() except: if not self.actionBroadcast.isChecked(): self.CeckViewTypeState()
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]))
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]))