Search in sources :

Example 36 with Survey

use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.

the class ExtendedElevationProjectionTest method testProject5MNorth.

@Test
public void testProject5MNorth() {
    Survey survey = BasicTestSurveyCreator.createStraightNorth();
    Space<Coord2D> space = Projection2D.EXTENDED_ELEVATION.project(survey);
    Map<Station, Coord2D> stationMap = space.getStationMap();
    Station two = survey.getStationByName("2");
    Coord2D twoCoord = stationMap.get(two);
    Coord2D expected = new Coord2D(5, 0);
    Assert.assertEquals(expected, twoCoord);
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Coord2D(org.hwyl.sexytopo.model.graph.Coord2D) Test(org.junit.Test)

Example 37 with Survey

use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.

the class StationNamerTest method testNameAdvancesDigitInStraightLine.

@Test
public void testNameAdvancesDigitInStraightLine() {
    Survey testSurvey = BasicTestSurveyCreator.createStraightNorth();
    String newName = StationNamer.generateNextStationName(testSurvey, testSurvey.getActiveStation());
    int numberOfStations = testSurvey.getAllStations().size();
    Assert.assertEquals(Integer.toString(numberOfStations + 1), newName);
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Example 38 with Survey

use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.

the class SurveyStatsTest method testSurveyComponentCountsFromOrigin.

@Test
public void testSurveyComponentCountsFromOrigin() {
    Survey survey = BasicTestSurveyCreator.createStraightNorthWith2EBranchFromS2();
    Assert.assertEquals(6, survey.getAllStations().size());
    Assert.assertEquals(6, SurveyStats.calcNumberSubStations(survey.getOrigin()));
    Assert.assertEquals(5, SurveyStats.calcNumberSubLegs(survey.getOrigin()));
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Example 39 with Survey

use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.

the class LrudTest method testStraightNorthCrossSectionLeftSplay.

@Test
public void testStraightNorthCrossSectionLeftSplay() {
    Survey testSurvey = BasicTestSurveyCreator.createStraightNorth();
    Station s2 = testSurvey.getStationByName("2");
    double angle = CrossSectioner.getAngleOfSection(testSurvey, s2);
    Leg splay = LRUD.LEFT.createSplay(testSurvey, s2, 5);
    Assert.assertEquals(270.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 40 with Survey

use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.

the class BasicTestSurveyCreator method createRightRight.

public static Survey createRightRight() {
    Survey survey = new Survey("Test n-shaped Survey");
    Leg leg0 = new Leg(5, 0, 0);
    SurveyUpdater.updateWithNewStation(survey, leg0);
    Leg leg1 = new Leg(5, 90, 0);
    SurveyUpdater.updateWithNewStation(survey, leg1);
    Leg leg2 = new Leg(5, 180, 0);
    SurveyUpdater.updateWithNewStation(survey, leg2);
    return survey;
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg)

Aggregations

Survey (org.hwyl.sexytopo.model.survey.Survey)101 Test (org.junit.Test)56 Station (org.hwyl.sexytopo.model.survey.Station)31 Leg (org.hwyl.sexytopo.model.survey.Leg)24 AlertDialog (android.app.AlertDialog)10 SuppressLint (android.annotation.SuppressLint)9 Coord2D (org.hwyl.sexytopo.model.graph.Coord2D)9 ArrayAdapter (android.widget.ArrayAdapter)8 File (java.io.File)6 HashMap (java.util.HashMap)6 View (android.view.View)5 EditText (android.widget.EditText)5 ArrayList (java.util.ArrayList)5 Set (java.util.Set)5 Context (android.content.Context)4 SharedPreferences (android.content.SharedPreferences)4 Editable (android.text.Editable)4 List (java.util.List)4 Map (java.util.Map)4 R (org.hwyl.sexytopo.R)4