Search in sources :

Example 76 with Leg

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);
}
Also used : Leg(org.hwyl.sexytopo.model.survey.Leg) Test(org.junit.Test)

Example 77 with Leg

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);
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg) Test(org.junit.Test)

Example 78 with Leg

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;
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg)

Example 79 with Leg

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;
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg)

Example 80 with Leg

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;
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Trip(org.hwyl.sexytopo.model.survey.Trip) ArrayList(java.util.ArrayList) Leg(org.hwyl.sexytopo.model.survey.Leg)

Aggregations

Leg (org.hwyl.sexytopo.model.survey.Leg)94 Station (org.hwyl.sexytopo.model.survey.Station)30 Test (org.junit.Test)30 Survey (org.hwyl.sexytopo.model.survey.Survey)23 Coord3D (org.hwyl.sexytopo.model.graph.Coord3D)17 Line (org.hwyl.sexytopo.model.graph.Line)8 ArrayList (java.util.ArrayList)7 Coord2D (org.hwyl.sexytopo.model.graph.Coord2D)7 JSONArray (org.json.JSONArray)6 JSONObject (org.json.JSONObject)6 Space (org.hwyl.sexytopo.model.graph.Space)4 TextView (android.widget.TextView)3 GraphToListTranslator (org.hwyl.sexytopo.control.util.GraphToListTranslator)3 TableCol (org.hwyl.sexytopo.model.table.TableCol)3 JSONException (org.json.JSONException)3 AlertDialog (android.app.AlertDialog)2 ParseException (java.text.ParseException)2 HashMap (java.util.HashMap)2 LRUD (org.hwyl.sexytopo.model.table.LRUD)2 SuppressLint (android.annotation.SuppressLint)1