use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class MeasurementProtocolTest method testFlatMeasurementGetsParsedCorrectly.
@Test
public void testFlatMeasurementGetsParsedCorrectly() {
byte[] packet = new byte[] { 1, -31, 7, -94, 50, 58, 3, -5 };
Assert.assertTrue(MeasurementProtocol.isDataPacket(packet));
Leg actual = MeasurementProtocol.parseDataPacket(packet);
Leg expected = new Leg(2.017f, 71.2f, 4.5f);
assertLegEquality(expected, actual);
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class LrudTest method testStraightNorthCrossSectionRightSplay.
@Test
public void testStraightNorthCrossSectionRightSplay() {
Survey testSurvey = BasicTestSurveyCreator.createStraightNorth();
Station s2 = testSurvey.getStationByName("2");
double angle = CrossSectioner.getAngleOfSection(testSurvey, s2);
Leg splay = LRUD.RIGHT.createSplay(testSurvey, s2, 5);
Assert.assertEquals(90.0, splay.getAzimuth(), SexyTopo.ALLOWED_DOUBLE_DELTA);
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class BasicTestSurveyCreator method createStraightNorthWith2EBranch.
public static Survey createStraightNorthWith2EBranch() {
Survey survey = new Survey("Test Straight Survey North With 2E Branch");
Leg leg0 = new Leg(5, 0, 0);
SurveyUpdater.updateWithNewStation(survey, leg0);
Leg leg1 = new Leg(5, 0, 0);
SurveyUpdater.updateWithNewStation(survey, leg1);
Leg leg2 = new Leg(5, 0, 0);
SurveyUpdater.updateWithNewStation(survey, leg2);
survey.setActiveStation(survey.getStationByName("1"));
Leg legBranch = new Leg(5, 90, 0);
SurveyUpdater.updateWithNewStation(survey, legBranch);
Leg legBranch2 = new Leg(5, 90, 0);
SurveyUpdater.updateWithNewStation(survey, legBranch2);
return survey;
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class BasicTestSurveyCreator method createStraightNorthWith1EBranch.
public static Survey createStraightNorthWith1EBranch() {
Survey survey = new Survey("Test Straight Survey North With 1E Branch");
Leg leg0 = new Leg(5, 0, 0);
SurveyUpdater.updateWithNewStation(survey, leg0);
Leg leg1 = new Leg(5, 0, 0);
SurveyUpdater.updateWithNewStation(survey, leg1);
Leg leg2 = new Leg(5, 0, 0);
SurveyUpdater.updateWithNewStation(survey, leg2);
survey.setActiveStation(survey.getStationByName("1"));
Leg legBranch = new Leg(5, 90, 0);
SurveyUpdater.updateWithNewStation(survey, legBranch);
return survey;
}
use of org.hwyl.sexytopo.model.survey.Leg in project sexytopo by richsmith.
the class BasicTestSurveyCreator method createStraightNorthWithTrip.
@SuppressWarnings("ArraysAsListWithZeroOrOneArgument")
public static Survey createStraightNorthWithTrip() {
Survey survey = new Survey("Test Straight Survey North");
List<Trip.TeamEntry> team = new ArrayList<>();
team.add(new Trip.TeamEntry("Alice", Arrays.asList(Trip.Role.BOOK)));
team.add(new Trip.TeamEntry("Bob", Arrays.asList(Trip.Role.INSTRUMENTS, Trip.Role.DOG)));
Trip trip = new Trip();
trip.setTeam(team);
survey.setTrip(trip);
Leg leg0 = new Leg(5, 0, 0);
SurveyUpdater.updateWithNewStation(survey, leg0);
Leg leg1 = new Leg(5, 0, 0);
SurveyUpdater.updateWithNewStation(survey, leg1);
Leg leg2 = new Leg(5, 0, 0);
SurveyUpdater.updateWithNewStation(survey, leg2);
return survey;
}
Aggregations