예제 #1
0
        public static IdentificationMissionModel ToIdentificationMissionModel(this IdentificationMission mission)
        {
            var model = new IdentificationMissionModel();

            model.ObservationIdentified = mission.ObservationIdentified;
            model.Restriction           = mission.Restriction?.ToRestrictionModel();
            return(model);
        }
예제 #2
0
        public static IdentificationMission ToIdentificationMission(this IdentificationMissionModel model)
        {
            var mission = new IdentificationMission();

            mission.ObservationIdentified = model.ObservationIdentified;
            mission.Restriction           = model.Restriction?.ToRestriction();
            return(mission);
        }
예제 #3
0
        /*public async Task GenerateVerifyMission()
         * {
         *  var mission = new VerificationMission();
         *  mission.Id = Guid.NewGuid().ToString("N");
         *  mission.Title = "Première verif identification";
         *  mission.Description = "Première verif identification description";
         *  mission.EndingCondition = new NumberOfActions
         *  {
         *      Number = 2,
         *  };
         *  mission.RestrictedArea = new CircleArea
         *  {
         *      Center = new GeoJsonPoint<GeoJson2DGeographicCoordinates>(new GeoJson2DGeographicCoordinates(-0.5762835000000001, 48.015947000000004)),
         *      Radius = 3000
         *  };
         *  mission.UnreliableObservation = true;
         *  await this.CreateMissionAsync(mission);
         *
         *
         *  var mission2 = new VerificationMission();
         *  mission2.Id = Guid.NewGuid().ToString("N");
         *  mission2.Title = "Seconde verif identification";
         *  mission2.Description = "Seconde verif identification description";
         *  mission2.EndingCondition =  new NumberOfActions
         *  {
         *      Number = 1,
         *  };
         *  mission2.RestrictedArea = new PolygonArea
         *  {
         *      Polygon = GeoJson.Polygon(new GeoJson2DGeographicCoordinates(-0.574204, 48.019921), new GeoJson2DGeographicCoordinates(-0.573883, 48.01395),
         *     new GeoJson2DGeographicCoordinates(-0.588023, 48.015214), new GeoJson2DGeographicCoordinates(-0.587873, 48.021041),
         *      new GeoJson2DGeographicCoordinates(-0.574204, 48.019921))
         *  };
         *
         *  mission2.Restriction = new Restriction()
         *  {
         *      Type = RestrictionType.ExactGender,
         *      Value = "Prunus"
         *  };
         *  await this.CreateMissionAsync(mission2);
         * }*/
        public async Task GenerateIdentificationMission()
        {
            var mission = new IdentificationMission();

            mission.Id              = Guid.NewGuid().ToString("N");
            mission.Title           = "Mission identification : Identifier 3 relevés dans un polygone";
            mission.Description     = "Mission identification : Identifier 3 relevés dans un polygone";
            mission.EndingCondition = new NumberOfActions
            {
                Number = 3,
            };
            mission.RestrictedArea = new PolygonArea
            {
                Polygon = GeoJson.Polygon(new GeoJson2DGeographicCoordinates(-0.574204, 48.019921), new GeoJson2DGeographicCoordinates(-0.573883, 48.01395),
                                          new GeoJson2DGeographicCoordinates(-0.588023, 48.015214), new GeoJson2DGeographicCoordinates(-0.587873, 48.021041),
                                          new GeoJson2DGeographicCoordinates(-0.574204, 48.019921))

                          /* Polygon = GeoJson.Polygon(new GeoJson2DGeographicCoordinates(48.074989, -0.746958), new GeoJson2DGeographicCoordinates(48.083799, -0.767936),
                           * new GeoJson2DGeographicCoordinates(48.079838, -0.777394), new GeoJson2DGeographicCoordinates(48.072354, -0.778360),
                           * new GeoJson2DGeographicCoordinates(48.063175, -0.773097), new GeoJson2DGeographicCoordinates(48.060604, -0.761133),
                           * new GeoJson2DGeographicCoordinates(48.074989, -0.746958))*/
            };
            await this.CreateMissionAsync(mission);

            var mission2 = new IdentificationMission();

            mission2.Id              = Guid.NewGuid().ToString("N");
            mission2.Title           = "Mission identification : Identifier 2 relevés précis";
            mission2.Description     = "Mission identification : Identifier 2 relevés précis";
            mission2.EndingCondition = new NumberOfActions
            {
                Number = 2,
            };
            mission2.ObservationIdentified = new string[] { "2d4be513b0324d2289096c851932ad72", "51ac0a0e7aae4591977ed76841b03b4e" };
            await this.CreateMissionAsync(mission2);

            var mission3 = new IdentificationMission();

            mission3.Id              = Guid.NewGuid().ToString("N");
            mission3.Title           = "Mission identification : Identifier 2 relevés d'Abricotier commun dans un cercle";
            mission3.Description     = "Mission identification : Identifier 2 relevés d'Abricotier commun dans un cercle";
            mission3.EndingCondition = new NumberOfActions
            {
                Number = 2,
            };
            mission3.RestrictedArea = new CircleArea
            {
                Center = new GeoJsonPoint <GeoJson2DGeographicCoordinates>(new GeoJson2DGeographicCoordinates(-0.7595157623291017, 48.0699066369019)),
                Radius = 1000,
            };
            mission3.Restriction = new Restriction
            {
                Type  = RestrictionType.ExactSpecies,
                Value = "Abricotier commun",
            };
            await this.CreateMissionAsync(mission3);
        }