Пример #1
0
        private static void SaveTaskToLog(SDR.MeasTask measTask)
        {
            try
            {
                var data = new StringBuilder();

                data.AppendLine($"Created meas task by SO:");
                data.AppendLine($"Name: {measTask.Name}");
                data.AppendLine($"Mode: {measTask.ExecutionMode}");
                data.AppendLine($"Created: {measTask.DateCreated}");
                if (measTask.Stations != null)
                {
                    data.AppendLine($"Stations: {measTask.Stations.Length}");
                }
                else
                {
                    data.AppendLine($"Stations: is null");
                }

                //data.AppendLine($"StationsForMeasurements: {measTask.StationsForMeasurements.Length}");

                Logger.WriteInfo(PluginMetadata.Processes.CreateMeasTask, data.ToString());
            }
            catch (Exception e)
            {
                Logger.WriteExeption(PluginMetadata.Processes.SaveTaskToLog, e);
            }
        }
Пример #2
0
        private static SDR.MeasTask PreparedMeasTaskInfo(DM.Allotment allotment, DM.FreqPlanChan[] freqPlanChans)
        {
            var measTask = new SDR.MeasTask()
            {
                Name              = allotment.CustText1,
                ExecutionMode     = SDR.MeasTaskExecutionMode.Automatic,
                Task              = SDR.MeasTaskType.Scan,
                DateCreated       = DateTime.Now,
                CreatedBy         = IM.ConnectedUser(),
                Stations          = PreparedStations(allotment),
                MeasDtParam       = PreparedDetectedParam(allotment),
                MeasFreqParam     = PreparedFreqParam(allotment, freqPlanChans),
                MeasOther         = PreparedOther(allotment),
                MeasTimeParamList = PreparedTimeParamList(allotment)
            };

            return(measTask);
        }
Пример #3
0
        private static SDR.MeasTask PreparedMeasTaskInfo(DM.Tour tour, DM.Inspection[] inspections)
        {
            var measTask = new SDR.MeasTask()
            {
                Name              = tour.MeasTaskName,
                ExecutionMode     = SDR.MeasTaskExecutionMode.Manual,
                DateCreated       = DateTime.Now,
                CreatedBy         = IM.ConnectedUser(),
                MeasDtParam       = PreparedDetectedParam(tour),
                MeasTimeParamList = new SDR.MeasTimeParamList()
                {
                    PerStart = tour.StartDate, PerStop = tour.StopDate
                },
                Stations = PreparedStations(tour), // new SDR.MeasStation[] { } ,
                StationsForMeasurements = PreparedStationDataForMeasurements(tour, inspections),
            };

            return(measTask);
        }
Пример #4
0
        public static VM.MeasTaskViewModel Map(SDR.MeasTask source)
        {
            if (source == null)
            {
                return(null);
            }

            if (source.MeasDtParam == null)
            {
                source.MeasDtParam = new SDR.MeasDtParam();
            }

            if (source.MeasFreqParam == null)
            {
                source.MeasFreqParam = new SDR.MeasFreqParam();
            }

            if (source.MeasOther == null)
            {
                source.MeasOther = new SDR.MeasOther();
            }

            if (source.MeasTimeParamList == null)
            {
                source.MeasTimeParamList = new SDR.MeasTimeParamList();
            }

            return(new VM.MeasTaskViewModel
            {
                CreatedBy = source.CreatedBy,
                DateCreated = source.DateCreated.ToNull(),
                ExecutionMode = source.ExecutionMode,
                Id = source.Id.Value,
                MaxTimeBs = source.MaxTimeBs.ToNull(),

                MeasDtParamDemod = source.MeasDtParam.Demod,
                MeasDtParamDetectType = source.MeasDtParam.DetectType,
                MeasDtParamIfAttenuation = source.MeasDtParam.IfAttenuation,
                MeasDtParamMeasTime = source.MeasDtParam.MeasTime.ToNull(),
                MeasDtParamMode = source.MeasDtParam.Mode,
                MeasDtParamPreamplification = source.MeasDtParam.Preamplification,
                MeasDtParamRBW = source.MeasDtParam.RBW.ToNull(),
                MeasDtParamRfAttenuation = source.MeasDtParam.RfAttenuation,
                MeasDtParamTypeMeasurements = source.MeasDtParam.TypeMeasurements,
                MeasDtParamVBW = source.MeasDtParam.VBW.ToNull(),

                MeasFreqParamMeasFreqs = (source.MeasFreqParam.MeasFreqs ?? (new SDR.MeasFreq[] { })).Select(i => i.Freq).ToArray(),
                MeasFreqParamMode = source.MeasFreqParam.Mode,
                MeasFreqParamRgL = source.MeasFreqParam.RgL.ToNull(),
                MeasFreqParamRgU = source.MeasFreqParam.RgU.ToNull(),
                MeasFreqParamStep = source.MeasFreqParam.Step.ToNull(),

                MeasOtherLevelMinOccup = source.MeasOther.LevelMinOccup.ToNull(),
                MeasOtherNChenal = source.MeasOther.NChenal.ToNull(),
                MeasOtherSwNumber = source.MeasOther.SwNumber.ToNull(),
                MeasOtherTypeSpectrumOccupation = source.MeasOther.TypeSpectrumOccupation,
                MeasOtherTypeSpectrumScan = source.MeasOther.TypeSpectrumScan,

                MeasTimeParamListDays = source.MeasTimeParamList.Days,
                MeasTimeParamListPerInterval = source.MeasTimeParamList.PerInterval.ToNull(),
                MeasTimeParamListPerStart = source.MeasTimeParamList.PerStart,
                MeasTimeParamListPerStop = source.MeasTimeParamList.PerStop,
                MeasTimeParamListTimeStart = source.MeasTimeParamList.TimeStart.ToNull(),
                MeasTimeParamListTimeStop = source.MeasTimeParamList.TimeStop.ToNull(),

                Name = source.Name,
                OrderId = source.OrderId,
                Prio = source.Prio.ToNull(),
                ResultType = source.ResultType,
                Status = source.Status,
                Task = source.Task,
                Type = source.Type,
                StationsForMeasurements = source.StationsForMeasurements,
                Stations = source.Stations
            });
        }