internal static FlightDataEntitiesRT.AircraftInstance FromAircraftService(AircraftService.AircraftInstance one) { if (one != null) { var instance = new FlightDataEntitiesRT.AircraftInstance() { AircraftModel = FromAircraftService(one.AircraftModel), AircraftNumber = one.AircraftNumber, LastUsed = one.LastUsed }; return instance; } return null; }
internal static FlightDataEntitiesRT.FlightRawDataRelationPoint FromAircraftService(AircraftService.FlightRawDataRelationPoint one) { return new FlightDataEntitiesRT.FlightRawDataRelationPoint() { FlightDate = one.FlightDate, FlightID = one.FlightID, XAxisParameterID = one.XAxisParameterID, XAxisParameterValue = one.XAxisParameterValue, YAxisParameterID = one.YAxisParameterID, YAxisParameterValue = one.YAxisParameterValue }; }
internal static FlightDataEntitiesRT.GlobeData FromAircraftService(AircraftService.GlobeData one) { return new FlightDataEntitiesRT.GlobeData() { Latitude = one.Latitude, Longitude = one.Longitude }; }
internal static FlightDataEntitiesRT.LevelTopFlightRecord FromAircraftService(AircraftService.LevelTopFlightRecord one) { FlightDataEntitiesRT.LevelTopFlightRecord rec = new FlightDataEntitiesRT.LevelTopFlightRecord() { EndSecond = one.EndSecond, FlightID = one.FlightID, ParameterID = one.ParameterID, StartSecond = one.StartSecond, ExtremumPointInfo = FromAircraftService(one.ExtremumPointInfo), Level2FlightRecord = FromAircraftService(one.Level2FlightRecord) }; return rec; }
internal static FlightDataEntitiesRT.Decisions.DecisionRecord FromAircraftService( AircraftService.DecisionRecord one) { return new FlightDataEntitiesRT.Decisions.DecisionRecord() { DecisionID = one.DecisionID, FlightID = one.FlightID, EventLevel = one.EventLevel, DecisionDescription = one.DecisionDescription, DecisionName = one.DecisionName, StartSecond = one.StartSecond, EndSecond = one.EndSecond, HappenSecond = one.HappenSecond }; }
internal static FlightDataEntitiesRT.Charts.ChartPanel FromAircraftService(AircraftService.ChartPanel one) { if (one == null) return null; return new FlightDataEntitiesRT.Charts.ChartPanel() { PanelID = one.PanelID, PanelName = one.PanelName, ParameterIDs = one.ParameterIDs.ToArray() }; }
internal static FlightDataEntitiesRT.ExtremumPointInfo FromAircraftService(AircraftService.ExtremumPointInfo one) { if (one == null) return null; FlightDataEntitiesRT.ExtremumPointInfo info = new FlightDataEntitiesRT.ExtremumPointInfo() { MaxValue = one.MaxValue, MaxValueSecond = one.MaxValueSecond, MinValue = one.MinValue, MinValueSecond = one.MinValueSecond, ParameterID = one.ParameterID, FlightID = one.FlightID, FlightDate = one.FlightDateTime }; return info; }
public static FlightDataEntitiesRT.Decisions.ConditionRelation FromAircraftService( AircraftService.ConditionRelation conditionRelation) { switch (conditionRelation) { case AircraftService.ConditionRelation.OR: return FlightDataEntitiesRT.Decisions.ConditionRelation.OR; default: return FlightDataEntitiesRT.Decisions.ConditionRelation.AND; } }
internal static FlightDataEntitiesRT.Decisions.CompareOperator FromAircraftService( AircraftService.CompareOperator compareOperator) { switch (compareOperator) { case AircraftService.CompareOperator.GreaterOrEqual: return FlightDataEntitiesRT.Decisions.CompareOperator.GreaterOrEqual; case AircraftService.CompareOperator.GreaterThan: return FlightDataEntitiesRT.Decisions.CompareOperator.GreaterThan; case AircraftService.CompareOperator.NotEqual: return FlightDataEntitiesRT.Decisions.CompareOperator.NotEqual; case AircraftService.CompareOperator.SmallerOrEqual: return FlightDataEntitiesRT.Decisions.CompareOperator.SmallerOrEqual; case AircraftService.CompareOperator.SmallerThan: return FlightDataEntitiesRT.Decisions.CompareOperator.SmallerThan; default: return FlightDataEntitiesRT.Decisions.CompareOperator.Equal; } }
public static FlightDataEntitiesRT.Decisions.SubCondition FromAircraftService(AircraftService.SubCondition two) { if (two.ConditionType == AircraftService.SubConditionType.DeltaRate) { return new FlightDataEntitiesRT.Decisions.DeltaRateSubCondition() { Operator = FromAircraftService(two.Operator), ParameterID = two.ParameterID, ParameterValue = two.ParameterValue, Relation = FromAircraftService(two.Relation), SubConditions = two.SubConditions == null ? null : (from three in two.SubConditions select RTConverter.FromAircraftService(three)).ToArray() }; } else { return new FlightDataEntitiesRT.Decisions.CompareSubCondition() { Operator = FromAircraftService(two.Operator), ParameterID = two.ParameterID, ParameterValue = two.ParameterValue, Relation = FromAircraftService(two.Relation), SubConditions = two.SubConditions == null ? null : (from three in two.SubConditions select RTConverter.FromAircraftService(three)).ToArray() }; } }
internal static FlightDataEntitiesRT.Decisions.FlightConditionDecision FromAircraftService(AircraftService.FlightConditionDecision one) { var decisions = new FlightDataEntitiesRT.Decisions.FlightConditionDecision() { DecisionID = one.DecisionID, DecisionName = one.DecisionName, EventLevel = one.EventLevel, LastTime = one.LastTime, RelatedParameters = one.RelatedParameters.ToArray(), DecisionDescriptionStringTemplate = one.DecisionDescriptionStringTemplate, Conditions = (from two in one.Conditions select RTConverter.FromAircraftService(two)).ToArray() }; return decisions; }
internal static FlightDataEntitiesRT.AircraftModel FromAircraftService(AircraftService.AircraftModel aircraftModel) { return new FlightDataEntitiesRT.AircraftModel() { Caption = aircraftModel.Caption, LastUsed = aircraftModel.LastUsed, ModelName = aircraftModel.ModelName }; }
internal static FlightDataEntitiesRT.Flight FromAircraftService(AircraftService.Flight flight) { return new FlightDataEntitiesRT.Flight() { Aircraft = new FlightDataEntitiesRT.AircraftInstance() { AircraftModel = FromAircraftService(flight.Aircraft.AircraftModel), AircraftNumber = flight.Aircraft.AircraftNumber, LastUsed = flight.Aircraft.LastUsed }, FlightDate = flight.FlightDate, FlightName = flight.FlightName, FlightID = flight.FlightID, StartSecond = flight.StartSecond, EndSecond = flight.EndSecond }; }
internal static FlightDataEntitiesRT.FlightParameters FromAircraftService(AircraftService.FlightParameters parameters) { if (parameters == null) return null; return new FlightDataEntitiesRT.FlightParameters() { BytesCount = parameters.BytesCount, Parameters = parameters.Parameters.Select<AircraftDataAnalysisModel1.WinRT.AircraftService.FlightParameter, FlightDataEntitiesRT.FlightParameter>( new Func<AircraftService.FlightParameter, FlightDataEntitiesRT.FlightParameter>( delegate(AircraftService.FlightParameter par) { return new FlightDataEntitiesRT.FlightParameter() { Caption = par.Caption, Index = par.Index, SubIndex = par.SubIndex, ModelName = par.ModelName, ParameterDataType = par.ParameterDataType, ParameterID = par.ParameterID, Unit = par.Unit, ByteIndexes = par.ByteIndexes == null ? new FlightDataEntitiesRT.ByteIndex[] { } : (from bi in par.ByteIndexes select new FlightDataEntitiesRT.ByteIndex() { Index = bi.Index, SubIndexes = bi.SubIndexes == null ? new FlightDataEntitiesRT.BitIndex[] { } : (from si in bi.SubIndexes select new FlightDataEntitiesRT.BitIndex() { SubIndex = si.SubIndex } ).ToArray() }).ToArray() }; })).ToArray() }; }