Initial work on finding next marks for boats as from mark rounding messages

Marks were very difficult to extend, need large refactor

Marks now have a compound ID as well as their sourceID. They need this compound ID to be identifiable by the
mark rounding messages.

tags: #story[956]  #pair[wmu16, mra106]
This commit is contained in:
William Muir
2017-05-22 18:54:07 +12:00
parent dec742cf54
commit e1b8e19966
13 changed files with 54 additions and 414 deletions
@@ -333,6 +333,7 @@ public class XMLParser {
private Mark createMark(Node compoundMark) {
List<SingleMark> marksList = new ArrayList<>();
Integer compoundMarkID = getNodeAttributeInt(compoundMark, "CompoundMarkID");
String cMarkName = getNodeAttributeString(compoundMark, "Name");
NodeList childMarks = compoundMark.getChildNodes();
@@ -346,7 +347,7 @@ public class XMLParser {
Double targetLat = getNodeAttributeDouble(markNode, "TargetLat");
Double targetLng = getNodeAttributeDouble(markNode, "TargetLng");
SingleMark mark = new SingleMark(markName, targetLat, targetLng, sourceID);
SingleMark mark = new SingleMark(markName, targetLat, targetLng, sourceID, compoundMarkID);
marksList.add(mark);
}
}
@@ -364,7 +365,7 @@ public class XMLParser {
} else if (marksList.size() == 2) {
return new GateMark(cMarkName, MarkType.OPEN_GATE, marksList.get(0),
marksList.get(1), marksList.get(0).getLatitude(),
marksList.get(0).getLongitude());
marksList.get(0).getLongitude(), compoundMarkID);
} else {
return null;
}