Search in sources :

Example 26 with Station

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

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

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

Example 29 with Station

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

the class StationRenameTest method testRenameStation.

@Test
public void testRenameStation() {
    Survey testSurvey = BasicTestSurveyCreator.createStraightNorth();
    Station s2 = testSurvey.getStationByName("2");
    SurveyUpdater.renameStation(testSurvey, s2, "ShinyNewName");
    Station shinyNewStation = testSurvey.getStationByName("ShinyNewName");
    Assert.assertEquals("ShinyNewName", shinyNewStation.getName());
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Example 30 with Station

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

the class StationRenameTest method testGetStationByNameGetsExistingStation.

@Test
public void testGetStationByNameGetsExistingStation() {
    Survey testSurvey = BasicTestSurveyCreator.createStraightNorth();
    Station s1 = testSurvey.getStationByName("1");
    Assert.assertEquals("1", s1.getName());
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Aggregations

Station (org.hwyl.sexytopo.model.survey.Station)85 Leg (org.hwyl.sexytopo.model.survey.Leg)32 Survey (org.hwyl.sexytopo.model.survey.Survey)30 Coord2D (org.hwyl.sexytopo.model.graph.Coord2D)20 Test (org.junit.Test)19 ArrayList (java.util.ArrayList)9 HashMap (java.util.HashMap)9 SuppressLint (android.annotation.SuppressLint)8 AlertDialog (android.app.AlertDialog)8 JSONException (org.json.JSONException)7 Line (org.hwyl.sexytopo.model.graph.Line)6 SurveyConnection (org.hwyl.sexytopo.model.survey.SurveyConnection)6 JSONObject (org.json.JSONObject)6 View (android.view.View)5 Set (java.util.Set)5 Direction (org.hwyl.sexytopo.model.graph.Direction)5 Space (org.hwyl.sexytopo.model.graph.Space)5 JSONArray (org.json.JSONArray)5 Context (android.content.Context)4 HashSet (java.util.HashSet)4