/** method which is called if a timer is set up */ public void updateGps(int fix) { Double bearMov = new Double(); Double speed = new Double(); Double sunAzimut = new Double(); compassRose.setGpsStatus( fix, myNavigation.gpsPos.getSats(), myNavigation.gpsPos.getSatsInView(), myNavigation.gpsPos.getHDOP()); if ((fix > 0) && (myNavigation.gpsPos.getSats() >= 0)) { // display values only, if signal good lblPosition.setText(myNavigation.gpsPos.toString(CoordsScreen.getLocalSystem(currFormatSel))); speed.set(myNavigation.gpsPos.getSpeed()); sunAzimut.set(myNavigation.skyOrientationDir.lonDec); bearMov.set(myNavigation.gpsPos.getBear()); updateDistance(); compassRose.setSunMoveDirections( (float) sunAzimut.value, (float) bearMov.value, (float) speed.value); // Set background to signal quality } // receiving data, but signal ist not good if ((fix == 0) && (myNavigation.gpsPos.getSats() >= 0)) { gpsStatus = YELLOW; } // receiving no data if (fix == -1) { if (gpsStatus != RED) (new MessageBox( MyLocale.getMsg(321, "Error"), MyLocale.getMsg(1510, "No data from GPS.\nConnection to serial port/gpsd closed."), FormBase.OKB)) .exec(); gpsStatus = RED; myNavigation.stopGps(); } // cannot interpret data if (fix == -2) { if (gpsStatus != RED) (new MessageBox( MyLocale.getMsg(321, "Error"), MyLocale.getMsg( 1511, "Cannot interpret data from GPS/gpsd!\nPossible reasons:\nWrong port,\nwrong baud rate,\ninvalid protocol (need NMEA/gpsd).\nConnection to serial port closed.\nLast String tried to interpret:\n") + myNavigation.gpsPos.lastStrExamined, FormBase.OKB)) .exec(); gpsStatus = RED; myNavigation.stopGps(); // TODO automatic in myNavigate? } }