Skip to content

Commit

Permalink
Bugfixing 1.6.0 rc6 (#37)
Browse files Browse the repository at this point in the history
* Update version in poms

* Fix url path in moon container

* Save dates in utc zone

* Small refactor

* Fix null pointer when no end date

* Fix set datepicker on date value

* Change observation to offset dates

* Clean some classes with zonedDateTime

* Improve help

* Upgrade log4j
  • Loading branch information
capape authored Jan 28, 2023
1 parent db016ba commit dbd11a5
Show file tree
Hide file tree
Showing 59 changed files with 464 additions and 358 deletions.
2 changes: 1 addition & 1 deletion observation-manager/deepsky-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>observation-manager</artifactId>
<groupId>de.lehmannet.om</groupId>
<version>1.6.0-RC6</version>
<version> 1.6.0-RC7</version>
</parent>

<groupId>de.lehmannet.om</groupId>
Expand Down
2 changes: 1 addition & 1 deletion observation-manager/imager-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>observation-manager</artifactId>
<groupId>de.lehmannet.om</groupId>
<version>1.6.0-RC6</version>
<version> 1.6.0-RC7</version>
</parent>

<groupId>de.lehmannet.om</groupId>
Expand Down
2 changes: 1 addition & 1 deletion observation-manager/observation-manager-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>observation-manager</artifactId>
<groupId>de.lehmannet.om</groupId>
<version>1.6.0-RC6</version>
<version> 1.6.0-RC7</version>
</parent>

<groupId>de.lehmannet.om</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ protected String getKey(ISchemaElement element) {

ISession session = (ISession) element;

return dateManager.zonedDateTimeToStringWithHour(session.getBegin()) + " - "
+ dateManager.zonedDateTimeToStringWithHour(session.getEnd());
return dateManager.offsetDateTimeToStringWithHour(session.getBegin()) + " - "
+ dateManager.offsetDateTimeToStringWithHour(session.getEnd());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package de.lehmannet.om.ui.comparator;

import java.time.ZonedDateTime;
import java.time.OffsetDateTime;
import java.util.Comparator;

import de.lehmannet.om.IObservation;
Expand Down Expand Up @@ -42,16 +42,16 @@ public int compare(IObservation o1, IObservation o2) {
ob1 = (IObservation) o2;
}

ZonedDateTime ob1B = ob1.getBegin();
ZonedDateTime ob2B = ob2.getBegin();
OffsetDateTime ob1B = ob1.getBegin();
OffsetDateTime ob2B = ob2.getBegin();

if (ob1B.isBefore(ob2B)) {
return -1;
} else if (ob1B.isAfter(ob2B)) {
return 1;
} else if (ob1B.equals(ob2B)) { // Same start date. Try to check end date
ZonedDateTime ob1E = ob1.getEnd();
ZonedDateTime ob2E = ob2.getEnd();
OffsetDateTime ob1E = ob1.getEnd();
OffsetDateTime ob2E = ob2.getEnd();
if (ob1E != null) {
if (ob2E != null) {
if (ob1E.isBefore(ob2E)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package de.lehmannet.om.ui.comparator;

import java.time.ZonedDateTime;
import java.time.OffsetDateTime;
import java.util.Comparator;

import de.lehmannet.om.ISession;
Expand Down Expand Up @@ -39,8 +39,8 @@ public int compare(ISession o1, ISession o2) {
s1 = (ISession) o2;
}

ZonedDateTime s1Begin = s1.getBegin();
ZonedDateTime s2Begin = s2.getBegin();
OffsetDateTime s1Begin = s1.getBegin();
OffsetDateTime s2Begin = s2.getBegin();

if (s1Begin.isBefore(s2Begin)) {
return -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
Expand Down Expand Up @@ -45,8 +44,7 @@ public class MoonDetailContainer extends JLabel {

private IObservation observation = null;

private transient final ImageResolver moonImages = new ImageClassLoaderResolverImpl(
"images" + File.separator + "moon");
private transient final ImageResolver moonImages = new ImageClassLoaderResolverImpl("images/moon");

public MoonDetailContainer(IObservation obs) {

Expand All @@ -70,7 +68,7 @@ private void setImage() {
return;
}

ZonedDateTime date = this.observation.getBegin();
ZonedDateTime date = this.observation.getBegin().toZonedDateTime();

String path = "";
if (Ephemerides.isMoonAboveHorizon(date, site.getLongitude().toDegree(), site.getLatitude().toDegree())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.time.YearMonth;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Locale;
import java.util.ResourceBundle;
Expand All @@ -42,7 +42,7 @@ public class DatePicker extends JDialog {
private final ResourceBundle bundle = LocaleToolsFactory.appInstance().getBundle("ObservationManager",
Locale.getDefault());

private final JButton[] fields = new JButton[37];
private final JButton[] fields = new JButton[38];
private final DateManager dateManager;

private JLabel monthYearLabel = null;
Expand Down Expand Up @@ -100,6 +100,9 @@ private void createDatePicker(String title, ZonedDateTime date, TimeZone timeZon

this.timeZone = timeZone;
this.date = date;
this.day = date.getDayOfMonth();
this.month = date.getMonthValue();
this.year = date.getYear();
this.initDialog();
this.setDates();

Expand Down
2 changes: 1 addition & 1 deletion observation-manager/observation-manager-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>observation-manager</artifactId>
<groupId>de.lehmannet.om</groupId>
<version>1.6.0-RC6</version>
<version> 1.6.0-RC7</version>
</parent>
<properties>
<eap.fits.version>1.3</eap.fits.version>
Expand Down
Loading

0 comments on commit dbd11a5

Please sign in to comment.