Search in sources :

Example 76 with Survey

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

the class SurvexImporterTest method testBasicImport.

@Test
public void testBasicImport() throws Exception {
    final String testContent = "1\t2\t5.0\t0.0\t0.0";
    Survey survey = new Survey("Test");
    SurvexImporter.parse(testContent, survey);
    Assert.assertEquals(survey.getAllStations().size(), 2);
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Example 77 with Survey

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

the class TestSurveyCreator method create.

public static Survey create(String name, int numStations, int numBranches) {
    Survey survey = new Survey(name);
    createBranch(survey, numStations);
    for (int i = 0; i < numBranches; i++) {
        List<Station> stations = survey.getAllStations();
        Station active = getRandom(stations);
        survey.setActiveStation(active);
        createBranch(survey, 3);
    }
    return survey;
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey)

Example 78 with Survey

use of org.hwyl.sexytopo.model.survey.Survey 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 79 with Survey

use of org.hwyl.sexytopo.model.survey.Survey 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 80 with Survey

use of org.hwyl.sexytopo.model.survey.Survey 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)

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