Search in sources :

Example 41 with Survey

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

the class BasicTestSurveyCreator method createStraightNorthThroughRepeats.

public static Survey createStraightNorthThroughRepeats() {
    Survey survey = new Survey("Test Straight Survey North");
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            Leg leg = new Leg(5, 0, 0);
            SurveyUpdater.update(survey, leg);
        }
    }
    return survey;
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg)

Example 42 with Survey

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

the class BasicTestSurveyCreator method createStraightNorth.

public static Survey createStraightNorth() {
    Survey survey = new Survey("Test Straight Survey North");
    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) Leg(org.hwyl.sexytopo.model.survey.Leg)

Example 43 with Survey

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

the class BasicTestSurveyCreator method createStraightSouth.

public static Survey createStraightSouth() {
    Survey survey = new Survey("Test Straight Survey South");
    Leg leg0 = new Leg(5, 180, 0);
    SurveyUpdater.updateWithNewStation(survey, leg0);
    Leg leg1 = new Leg(5, 180, 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)

Example 44 with Survey

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

the class CrossSectionerTest method testStraightNorthCrossSection.

@Test
public void testStraightNorthCrossSection() {
    Survey testSurvey = BasicTestSurveyCreator.createStraightNorth();
    Station s2 = testSurvey.getStationByName("2");
    double angle = CrossSectioner.getAngleOfSection(testSurvey, s2);
    Assert.assertEquals(0.0, angle, SexyTopo.ALLOWED_DOUBLE_DELTA);
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Example 45 with Survey

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

the class StationRenameTest method testRenamingToExistingNameFails.

@Test(expected = IllegalArgumentException.class)
public void testRenamingToExistingNameFails() {
    Survey testSurvey = BasicTestSurveyCreator.createStraightNorth();
    Station s2 = testSurvey.getStationByName("2");
    SurveyUpdater.renameStation(testSurvey, s2, "1");
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

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