public ReviewSupplemental(SupplementalObservation observation, IGlobalMap globalMap) { Observation = observation; Species species = globalMap.SpeciesList.Find(x => x.AlphaCode.Equals(Observation.SpeciesCode)); if (species == null) { Warning = "Unknown species code. "; } else { SpeciesName = species.CommonName; } }
public static List <ReviewSupplemental> GetReviewSupplementalList(IUserStateManager state, IGlobalMap globalMap) { // TODO: use of state should be moved to a presenter class List <ReviewSupplemental> reviewList = new List <ReviewSupplemental>(); state.SiteVisit.SupplementalObservations.ForEach(x => { reviewList.Add(new ReviewSupplemental(x, globalMap)); }); return(reviewList); }
/// <summary> /// Factory method to build and retrieve all observation information for a particular site visit, for use on the review page. /// </summary> /// <returns></returns> public static List <ReviewObservation> GetReviewList(IUserStateManager state, IGlobalMap globalMap) { // TODO: use of state should be moved to a presenter class List <ReviewObservation> reviewList = new List <ReviewObservation>(); state.SiteVisit.PointSurveys.OrderBy(x => x.StartTimeStamp).ToList().ForEach(x => { List <FiftyMeterDataEntry> entryList = new List <FiftyMeterDataEntry>(); FiftyMeterDataEntryFactory.CreateEntriesFromPointCounts <PointCountBeyond50>( x.Observations.OfType <PointCountBeyond50>().ToList <PointCountBeyond50>(), entryList); FiftyMeterDataEntryFactory.CreateEntriesFromPointCounts <PointCountWithin50>( x.Observations.OfType <PointCountWithin50>().ToList <PointCountWithin50>(), entryList); entryList.ForEach(y => { reviewList.Add(new ReviewObservation(x, y, state, globalMap)); }); }); return(reviewList.OrderBy(x => x.SamplingPointName).ToList()); }
public SiteConditionsPresenterTss SetGlobalMap(IGlobalMap globalMap) { base.GlobalMap = globalMap; return(this); }
public ReviewObservation(FiftyMeterPointSurvey survey, FiftyMeterDataEntry entry, IUserStateManager state, IGlobalMap globalMap) { State = state; DataEntry = entry; SamplingPointName = state.PointsRemaining.Union(state.PointsCompleted).Single(x => x.Id.Equals(survey.LocationId)).Name; Species species = globalMap.SpeciesList.Find(x => x.AlphaCode.Equals(entry.SpeciesCode)); if (species == null) { Warning = "Unknown species code. "; } else { SpeciesName = species.CommonName; if (entry.CountBeyond50 > species.WarningCount) { Warning += "Unusually high count beyond 50m, please verify. "; } if (entry.CountWithin50 > species.WarningCount) { Warning += "Unusually high count within 50m, please verify. "; } } }