Exemple #1
0
        public static Approach CopyApproachForSignal(Approach approachToCopy)
        {
            var newApproach = CopyApproachCommonProperties(approachToCopy, true);

            foreach (var d in approachToCopy.Detectors)
            {
                var dForNewApproach = Detector.CopyDetector(d.ID, false);
                newApproach.Detectors.Add(dForNewApproach);
            }
            return(newApproach);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        public static Approach CopyApproach(int approachIDToCopy)
        {
            var approachRepository =
                ApproachRepositoryFactory.Create();
            var approachToCopy = approachRepository.GetApproachByApproachID(approachIDToCopy);
            var newApproach    = CopyApproachCommonProperties(approachToCopy, false);

            if (approachToCopy.Detectors != null)
            {
                foreach (var d in approachToCopy.Detectors)
                {
                    var
                             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);
        }