コード例 #1
0
        private void InitInfoWrappers(FlightDataEntitiesRT.ExtremumPointInfo[] infos)
        {
            var vinfos = from inf in infos
                         select new ExtremumReportItemWrap(this, inf);

            this.Collection = new ObservableCollection<ExtremumReportItemWrap>(vinfos);
        }
コード例 #2
0
        /// <summary>
        /// 创建RawDataRowViewModel作为一行
        /// </summary>
        /// <param name="i"></param>
        /// <param name="datas"></param>
        public void AddOneSecondValue(int i, FlightDataEntitiesRT.ParameterRawData[] datas)
        {
            RawDataRowViewModel model = new RawDataRowViewModel() { Second = i };
            model.AddValue(i);

            foreach (var param in ParameterList)
            {
                var value = datas.Single(
                     new Func<FlightDataEntitiesRT.ParameterRawData, bool>(
                         delegate(FlightDataEntitiesRT.ParameterRawData data)
                         {
                             if (data != null && data.ParameterID == param.ParameterID)
                                 return true;
                             return false;
                         }));

                if (value != null)
                {
                    model.AddValue(value.Values[0]);
                }
                else { model.AddValue(string.Empty); }
            }

            this.Items.Add(model);
        }
コード例 #3
0
 public static string AddDecisionRecordsBatch(FlightDataEntitiesRT.Flight flight,
     List<DecisionRecord> decisionRecords)
 {//TODO: test
     Task<string> task = AddDecisionRecordsBatchAsync(flight, decisionRecords);
     task.Wait();
     return task.Result;
 }
コード例 #4
0
 public Task<FlightDataEntitiesRT.FlightParameters> GetFlightParametersAsync(
     FlightDataEntitiesRT.AircraftModel aircraftModel)
 {
     if (this.m_objectMap.ContainsKey("AircraftModel_FlightParameters:" + aircraftModel.ModelName)
         && this.m_objectMap["AircraftModel_FlightParameters:" + aircraftModel.ModelName] != null)
     {
         return Task.Run<FlightDataEntitiesRT.FlightParameters>(
               new Func<FlightDataEntitiesRT.FlightParameters>(() =>
               {
                   if (this.m_objectMap.ContainsKey("AircraftModel_FlightParameters:" + aircraftModel.ModelName)
                       && this.m_objectMap["AircraftModel_FlightParameters:" + aircraftModel.ModelName] != null)
                   {
                       return m_objectMap["AircraftModel_FlightParameters:" + aircraftModel.ModelName] as FlightDataEntitiesRT.FlightParameters;
                   }
                   return null;
               }));
         //  return m_objectMap["AircraftModel_FlightParameters:" + aircraftModel.ModelName] as FlightDataEntitiesRT.FlightParameters;
     }
     else
     {
         Task<FlightDataEntitiesRT.FlightParameters> parameters = ServerHelper.GetFlightParametersAsync(
             AircraftDataAnalysisWinRT.ApplicationContext.Instance.CurrentAircraftModel);
         parameters.ContinueWith(new Action<Task<FlightDataEntitiesRT.FlightParameters>>(
             delegate(Task<FlightDataEntitiesRT.FlightParameters> t)
             {
                 if (!m_objectMap.ContainsKey("AircraftModel_FlightParameters:" + aircraftModel.ModelName))
                 {
                     m_objectMap.Add("AircraftModel_FlightParameters:" + aircraftModel.ModelName, t.Result);
                 }
             }));
         return parameters;
     }
 }
コード例 #5
0
 /// <summary>
 /// 删除架次并且删除相关信息
 /// </summary>
 /// <param name="flight"></param>
 /// <returns></returns>
 public static Task<string> DeleteExistsDataAsync(FlightDataEntitiesRT.Flight flight)
 {//TODO: test
     AircraftDataInput.AircraftDataInputClient client = GetClient();
     AircraftDataInput.Flight rtFlight = RTConverter.ToDataInput(flight);
     Task<string> task = client.DeleteExistsDataAsync(rtFlight);
     return task;
 }
コード例 #6
0
        private void BuildAndBindRecord(FlightDataEntitiesRT.Decisions.DecisionRecord[] decisionRecords,
            IEnumerable<FlightDataEntitiesRT.Decisions.Decision> decisions)
        {
            var decisionRecordWrap = from one in decisionRecords
                                     where FindDecisionRecord(one, decisions) != null
                                     select new DecisionWrap(one,
                                         FindDecisionRecord(one, decisions));

            var decisionNullWrap = from one in decisions
                                   where FindDecisionRecord(one, decisionRecords) == null
                                   select new DecisionWrap(null, one);

            List<DecisionWrap> wrapList = new List<DecisionWrap>();
            if (decisionRecordWrap != null && decisionRecordWrap.Count() > 0)
            {
                wrapList.AddRange(decisionRecordWrap);
            }
            if (decisionNullWrap != null && decisionNullWrap.Count() > 0)
            {
                wrapList.AddRange(decisionNullWrap);
            }

            this.values = new List<DecisionWrap>(wrapList);

            this.DecisionRecordCollection = new ObservableCollection<DecisionWrap>(values);
        }
コード例 #7
0
 public static string AddOneParameterValue(FlightDataEntitiesRT.Flight flight, string parameterID,
     FlightDataEntitiesRT.Level1FlightRecord[] reducedRecords)
 {//TODO: test
     Task<string> task = AddOneParameterValueAsync(flight, parameterID, reducedRecords);
     task.Wait();
     return task.Result;
 }
コード例 #8
0
 public static Task<string> AddOneParameterValueAsync(FlightDataEntitiesRT.Flight flight, string parameterID,
     FlightDataEntitiesRT.Level1FlightRecord[] reducedRecords)
 {//TODO: test
     AircraftDataInput.AircraftDataInputClient client = GetClient();
     AircraftDataInput.Flight rtFlight = RTConverter.ToDataInput(flight);
     Task<string> task = client.AddOneParameterValueAsync(rtFlight, parameterID,
         RTConverter.ToDataInput(reducedRecords));
     return task;
 }
コード例 #9
0
 public FastDataReading(
     IFlightRawDataExtractor rawDataExtractor,
     FlightDataEntitiesRT.Flight flight,
     FlightParameters parameters)
 {
     this.m_rawDataExtractor = rawDataExtractor;
     this.m_flight = flight;
     this.m_parameters = parameters;
 }
コード例 #10
0
        public static Task<string> AddDecisionRecordsBatchAsync(FlightDataEntitiesRT.Flight flight,
            List<DecisionRecord> decisionRecords)
        {//TODO: test
            AircraftDataInput.AircraftDataInputClient client = GetClient();
            AircraftDataInput.Flight rtFlight = RTConverter.ToDataInput(flight);

            Task<string> task = client.AddDecisionRecordsBatchAsync(rtFlight,
                RTConverter.ToDataInput(decisionRecords));
            return task;
        }
コード例 #11
0
 internal static ObservableCollection<AircraftDataInput.GlobeData> ToDataInput(FlightDataEntitiesRT.GlobeData[] globeData)
 {
     if (globeData != null && globeData.Length > 0)
     {
         var objs = from one in globeData
                    select ToDataInput(one);
         return new ObservableCollection<AircraftDataInput.GlobeData>(objs);
     }
     return null;
 }
コード例 #12
0
        public Domain.FlightAnalysisViewModel GetCurrentViewModel(FlightDataEntitiesRT.Flight flight)
        {
            if (flight == null || string.IsNullOrEmpty(flight.FlightID))
            {
                return null;
            }

            string key = this.GetFlightViewModelKey(flight.FlightID);
            return GetCurrentViewModel(key);
        }
コード例 #13
0
 internal static AircraftDataInput.Level2FlightRecord ToDataInput(FlightDataEntitiesRT.Level2FlightRecord level2Record)
 {
     return new AircraftDataInput.Level2FlightRecord()
     {
         EndSecond = level2Record.EndSecond,
         FlightID = level2Record.FlightID,
         ParameterID = level2Record.FlightID,
         StartSecond = level2Record.StartSecond,
         ExtremumPointInfo = RTConverter.ToDataInput(level2Record.ExtremumPointInfo)
     };
 }
        private FlightDataEntitiesRT.FlightParameter FindParameter(string parameterId,
            FlightDataEntitiesRT.FlightParameters parameters)
        {
            var obj = parameters.Parameters.FirstOrDefault(new Func<FlightDataEntitiesRT.FlightParameter, bool>(
                delegate(FlightDataEntitiesRT.FlightParameter para)
                {
                    if (para.ParameterID == parameterId)
                        return true;
                    return false;
                }));

            return obj;
        }
コード例 #15
0
        internal static FlightAnalysisSubViewModel Create(
            AircraftDataAnalysisWinRT.Domain.FlightAnalysisViewModel HostViewModel,
            FlightDataEntitiesRT.Flight flight, string hostParameterID)
        {
            FlightAnalysisSubViewModel viewModel = new FlightAnalysisSubViewModel() { ViewModel = HostViewModel };
            viewModel.HostParameterID = hostParameterID;
            viewModel.CurrentStartSecond = flight.StartSecond;
            viewModel.CurrentEndSecond = flight.EndSecond;

            var dataEntities = AircraftDataAnalysisWinRT.Services.ServerHelper.GetData(flight, new string[] { hostParameterID },
                flight.StartSecond, flight.EndSecond);

            return viewModel;
        }
コード例 #16
0
 internal IEnumerable<FlightDataEntitiesRT.Charts.ChartPanel> GetChartPanels(FlightDataEntitiesRT.AircraftModel aircraftModel)
 {
     if (this.m_objectMap.ContainsKey("AircraftModel_ChartPanel:" + aircraftModel.ModelName)
         && this.m_objectMap["AircraftModel_ChartPanel:" + aircraftModel.ModelName] != null)
     {
         return m_objectMap["AircraftModel_ChartPanel:" + aircraftModel.ModelName] as IEnumerable<FlightDataEntitiesRT.Charts.ChartPanel>;
     }
     else
     {
         var panels = ServerHelper.GetChartPanels(aircraftModel);
         m_objectMap.Add("AircraftModel_ChartPanel:" + aircraftModel.ModelName, panels);
         return panels;
     }
 }
コード例 #17
0
 internal FlightDataEntitiesRT.FlightParameters GetFlightParameters(
     FlightDataEntitiesRT.AircraftModel aircraftModel)
 {
     if (this.m_objectMap.ContainsKey("AircraftModel_FlightParameters:" + aircraftModel.ModelName)
         && this.m_objectMap["AircraftModel_FlightParameters:" + aircraftModel.ModelName] != null)
     {
         return m_objectMap["AircraftModel_FlightParameters:" + aircraftModel.ModelName] as FlightDataEntitiesRT.FlightParameters;
     }
     else
     {
         var parameters = ServerHelper.GetFlightParameters(aircraftModel);
         m_objectMap.Add("AircraftModel_FlightParameters:" + aircraftModel.ModelName, parameters);
         return parameters;
     }
 }
コード例 #18
0
        public ExtremumReportItemWrap(ExtremumReportViewModel viewModel,
            FlightDataEntitiesRT.ExtremumPointInfo info)
        {
            this.viewModel = viewModel;
            this.extremumInfo = info;

            var para = this.viewModel.FlightParameters.Parameters.FirstOrDefault(
                new Func<FlightDataEntitiesRT.FlightParameter, bool>(delegate(FlightDataEntitiesRT.FlightParameter p)
                    {
                        if (p.ParameterID == info.ParameterID)
                            return true;
                        return false;
                    }));

            if (para != null)
                this.ParameterCaption = para.Caption;
        }
コード例 #19
0
        internal static AircraftDataInput.Flight ToDataInput(FlightDataEntitiesRT.Flight flight)
        {
            AircraftDataInput.Flight rt = new AircraftDataInput.Flight()
            {
                Aircraft = new AircraftDataInput.AircraftInstance()
                {
                    AircraftModel = new AircraftDataInput.AircraftModel()
                    {
                        ModelName = flight.Aircraft.AircraftModel.ModelName,
                        Caption = flight.Aircraft.AircraftModel.Caption
                    },
                    AircraftNumber = flight.Aircraft.AircraftNumber,
                    LastUsed = flight.Aircraft.LastUsed
                },
                FlightID = flight.FlightID,
                FlightName = flight.FlightName,
                StartSecond = flight.StartSecond,
                EndSecond = flight.EndSecond
            };

            return rt;
        }
コード例 #20
0
        public void SetCurrentViewModel(FlightDataEntitiesRT.Flight flight,
            AircraftDataAnalysisWinRT.Domain.FlightAnalysisViewModelOld viewModel)
        {
            if (flight == null || string.IsNullOrEmpty(flight.FlightID))
            {
                return;
            }

            SetCurrentViewModel(flight.FlightID, viewModel);
        }
コード例 #21
0
        internal static void AddLevelTopFlightRecords(FlightDataEntitiesRT.Flight flight,
            List<FlightDataEntitiesRT.LevelTopFlightRecord> topRecords)
        {
            AircraftDataInput.AircraftDataInputClient client = GetClient();
            AircraftDataInput.Flight rtFlight = RTConverter.ToDataInput(flight);

            Task<string> task = client.AddLevelTopFlightRecordsAsync(
                RTConverter.ToDataInput(flight),
                new System.Collections.ObjectModel.ObservableCollection<AircraftDataInput.LevelTopFlightRecord>((
                    from one in topRecords select RTConverter.ToDataInput(one))));
            task.Wait();
            //return RTConverter.FromDataInput(task.Result);
        }
コード例 #22
0
        /// <summary>
        /// 添加一个架次对象到数据库,必须先添加成功,否则后面数据没有架次作为参数是不行的
        /// </summary>
        /// <param name="flight"></param>
        /// <returns></returns>
        public static Task<FlightDataEntitiesRT.Flight> AddOrReplaceFlightAsync(FlightDataEntitiesRT.Flight flight)
        {//TODO: test
            AircraftDataInput.AircraftDataInputClient client = GetClient();
            AircraftDataInput.Flight rtFlight = RTConverter.ToDataInput(flight);

            Task<AircraftDataInput.Flight> task = client.AddOrReplaceFlightAsync(rtFlight);
            Task<FlightDataEntitiesRT.Flight> task2 = task.ContinueWith<FlightDataEntitiesRT.Flight>(
                new Func<Task, FlightDataEntitiesRT.Flight>(
                    delegate(Task task1)
                    {
                        task1.Wait();
                        var result = task.Result;
                        return RTConverter.FromDataInput(result);
                    }));

            return task2;
        }
コード例 #23
0
 public PanelViewModelItem(FlightDataEntitiesRT.Charts.ChartPanel panel)
 {
     this.m_panel = panel;
 }
コード例 #24
0
 /// <summary>
 /// 删除架次并且删除相关信息
 /// </summary>
 /// <param name="flight"></param>
 /// <returns></returns>
 public static string DeleteExistsData(FlightDataEntitiesRT.Flight flight)
 {//TODO: test
     Task<string> task = DeleteExistsDataAsync(flight);
     task.Wait();
     return task.Result;
 }
コード例 #25
0
        public ColumnWrapper(FlightDataEntitiesRT.FlightParameter pm)
        {
            // TODO: Complete member initialization
            this.m_parameter = pm;

            this.GridColumn = new Syncfusion.UI.Xaml.Grid.GridTextColumn()
            {
                MappingName = pm.ParameterID,
                ColumnSizer = Syncfusion.UI.Xaml.Grid.GridLengthUnitType.Auto,
                HeaderText = ApplicationContext.Instance.GetFlightParameterCaption(pm.ParameterID),
                TextAlignment = TextAlignment.Center,
                HorizontalHeaderContentAlignment = HorizontalAlignment.Center,
                IsHidden = this.IsParameterHidden,
            };
        }
コード例 #26
0
        /// <summary>
        /// 添加一个架次对象到数据库,必须先添加成功,否则后面数据没有架次作为参数是不行的
        /// </summary>
        /// <param name="flight"></param>
        /// <returns></returns>
        public static FlightDataEntitiesRT.Flight AddOrReplaceFlight(FlightDataEntitiesRT.Flight flight)
        {//TODO: test
            AircraftDataInput.AircraftDataInputClient client = GetClient();
            AircraftDataInput.Flight rtFlight = RTConverter.ToDataInput(flight);

            Task<AircraftDataInput.Flight> task = client.AddOrReplaceFlightAsync(rtFlight);
            task.Wait();
            return RTConverter.FromDataInput(task.Result);
        }
コード例 #27
0
        internal static void AddOrReplaceFlightExtreme(FlightDataEntitiesRT.Flight flight,
            FlightDataEntitiesRT.ExtremumPointInfo[] extremumPointInfo)
        {
            AircraftDataInput.AircraftDataInputClient client = GetClient();
            AircraftDataInput.Flight rtFlight = RTConverter.ToDataInput(flight);

            var points = from one in extremumPointInfo
                         select RTConverter.ToDataInput(one);
            var collection = new System.Collections.ObjectModel.ObservableCollection<
                AircraftDataInput.ExtremumPointInfo>(points);

            Task<string> task = client.AddOrReplaceFlightExtremeAsync(rtFlight, collection);
            task.Wait();
        }
コード例 #28
0
        internal static void AddFlightConditionDecisionRecordsBatch(
            FlightDataEntitiesRT.Flight flight, List<DecisionRecord> decisionFlightRecords)
        {
            AircraftDataInput.AircraftDataInputClient client = GetClient();
            AircraftDataInput.Flight rtFlight = RTConverter.ToDataInput(flight);

            var collection = RTConverter.ToDataInput(decisionFlightRecords);

            Task<string> task = client.AddFlightConditionDecisionRecordsBatchAsync(rtFlight, collection);
            task.Wait();
        }
コード例 #29
0
 protected override string HandleOneStepData(int second, FlightDataEntitiesRT.ParameterRawData[] datas)
 {
     throw new NotImplementedException();
 }
コード例 #30
0
        internal static void AddFlightRawDataRelationPoints(FlightDataEntitiesRT.Flight flight,
            List<FlightDataEntitiesRT.FlightRawDataRelationPoint> flightRawDataRelationPoints)
        {
            AircraftDataInput.AircraftDataInputClient client = GetClient();
            AircraftDataInput.Flight rtFlight = RTConverter.ToDataInput(flight);

            var points = from one in flightRawDataRelationPoints
                         select RTConverter.ToDataInput(one);
            var collection = new System.Collections.ObjectModel.ObservableCollection<
                AircraftDataInput.FlightRawDataRelationPoint>(points);

            Task<string> task = client.AddFlightRawDataRelationPointsAsync(rtFlight, collection);
            task.Wait();
        }