public SignalsController( MOE.Common.Models.Repositories.IControllerTypeRepository controllerTypeRepository, MOE.Common.Models.Repositories.IRegionsRepository regionRepository, MOE.Common.Models.Repositories.IDirectionTypeRepository directionTypeRepository, MOE.Common.Models.Repositories.IMovementTypeRepository movementTypeRepository, MOE.Common.Models.Repositories.ILaneTypeRepository laneTypeRepository, MOE.Common.Models.Repositories.IDetectionHardwareRepository detectionHardwareRepository, MOE.Common.Models.Repositories.ISignalsRepository signalsRepository, MOE.Common.Models.Repositories.IDetectorRepository detectorRepository, MOE.Common.Models.Repositories.IDetectionTypeRepository detectionTypeRepository, MOE.Common.Models.Repositories.IApproachRepository approachRepository, MOE.Common.Models.Repositories.IMetricTypeRepository metricTypeRepository) { _signalsRepository = signalsRepository; _detectorRepository = detectorRepository; _detectionTypeRepository = detectionTypeRepository; _approachRepository = approachRepository; _controllerTypeRepository = controllerTypeRepository; _regionRepository = regionRepository; _directionTypeRepository = directionTypeRepository; _movementTypeRepository = movementTypeRepository; _laneTypeRepository = laneTypeRepository; _detectionHardwareRepository = detectionHardwareRepository; _metricTypeRepository = metricTypeRepository; }
public string GetLaneGroupDirection() { MOE.Common.Models.Repositories.IApproachRepository Approaches = MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create(); MOE.Common.Models.Approach approach = Approaches.GetApproachByApproachID(LaneGroup.ApproachID); return(approach.DirectionType.Description); }
public List <Models.Approach> GetRouteNonMember() { MOE.Common.Models.Repositories.IApproachRepository sr = MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create(); var members = from r in ApproachRouteDetails select r.Approach; return(sr.GetAllApproaches().Except(members).ToList()); }
public ActionResult Copy(int approachID) { ViewBag.DirectionType = new SelectList(directionRepository.GetAllDirections(), "DirectionTypeID", "Abbreviation"); MOE.Common.Models.Repositories.IApproachRepository approachRepository = MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create(); MOE.Common.Models.Approach approachToCopy = approachRepository.GetApproachByApproachID(approachID); Approach newApproach = MOE.Common.Models.Approach.CopyApproach(approachID); return(PartialView("Create", newApproach)); }
public SignalsController() { _signalsRepository = MOE.Common.Models.Repositories.SignalsRepositoryFactory.Create(); _detectorRepository = MOE.Common.Models.Repositories.DetectorRepositoryFactory.Create(); _detectionTypeRepository = MOE.Common.Models.Repositories.DetectionTypeRepositoryFactory.Create(); _approachRepository = MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create(); _metricTypeRepository = MOE.Common.Models.Repositories.MetricTypeRepositoryFactory.Create(); _controllerTypeRepository = MOE.Common.Models.Repositories.ControllerTypeRepositoryFactory.Create(); _regionRepository = MOE.Common.Models.Repositories.RegionsRepositoryFactory.Create(); _directionTypeRepository = MOE.Common.Models.Repositories.DirectionTypeRepositoryFactory.Create(); _movementTypeRepository = MOE.Common.Models.Repositories.MovementTypeRepositoryFactory.Create(); _laneTypeRepository = MOE.Common.Models.Repositories.LaneTypeRepositoryFactory.Create(); _detectionHardwareRepository = MOE.Common.Models.Repositories.DetectionHardwareRepositoryFactory.Create(); }
public static Approach CopyApproachForSignal(int approachIDToCopy) { MOE.Common.Models.Repositories.IApproachRepository approachRepository = MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create(); Approach approachToCopy = approachRepository.GetApproachByApproachID(approachIDToCopy); Approach newApproach = CopyApproachCommonProperties(approachToCopy); foreach (Detector d in approachToCopy.Detectors) { Detector dForNewApproach = Detector.CopyDetector(d.ID, false); newApproach.Detectors.Add(dForNewApproach); } return(newApproach); }
public static Approach CopyApproach(int approachIDToCopy) { MOE.Common.Models.Repositories.IApproachRepository approachRepository = MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create(); Approach approachToCopy = approachRepository.GetApproachByApproachID(approachIDToCopy); Approach newApproach = CopyApproachCommonProperties(approachToCopy); foreach (Detector d in approachToCopy.Detectors) { Detector dForNewApproach = Detector.CopyDetector(d.ID, true); //need to increase DetChannel if not copying the whole signal. newApproach.Detectors.Add(dForNewApproach); } if (newApproach.Detectors.Count > 1) { newApproach = SetDetChannelWhenMultipleDetectorsExist(newApproach); } return(newApproach); }