/// <summary> /// Convert a CANStream SignalFormatProperties class into a Ctrl_GraphWindow GraphSerieValueFormat class /// </summary> /// <param name="oSigFormat">CANStream SignalFormatProperties object to convert</param> /// <returns>Ctrl_GraphWindow GraphSerieValueFormat object</returns> public static GraphSerieValueFormat Convert_CSSignalFormatToSerieValueFormat(SignalFormatProperties oSigFormat) { GraphSerieValueFormat oSerieFormat = new GraphSerieValueFormat(); switch (oSigFormat.FormatType) { case SignalValueFormat.Binary: oSerieFormat.Format = GraphSerieLegendFormats.Binary; break; case SignalValueFormat.Decimal: oSerieFormat.Format = GraphSerieLegendFormats.Decimal; oSerieFormat.Decimals = oSigFormat.Decimals; break; case SignalValueFormat.Enum: oSerieFormat.Format = GraphSerieLegendFormats.Enum; foreach (EnumerationValue sSigEnum in oSigFormat.Enums) { GraphSerieEnumValue sSerieEnum = new GraphSerieEnumValue(); sSerieEnum.Value = sSigEnum.Value; sSerieEnum.Text = sSigEnum.Text; oSerieFormat.Enums.Add(sSerieEnum); } break; case SignalValueFormat.Hexadecimal: oSerieFormat.Format = GraphSerieLegendFormats.Hexadecimal; break; default: oSerieFormat.Format = GraphSerieLegendFormats.Auto; break; } return(oSerieFormat); }
/// <summary> /// Constructor including name and sampling mode of the data channel to create /// </summary> /// <param name="ChannelName">Channel name</param> /// <param name="SampleMode">Sampling mode of the data channel</param> public GW_DataChannel(string ChannelName, SamplingMode SampleMode) { Name = ChannelName; Min = 0; Max = 0; Avg = 0; ChannelStepTimeMin = 0; ChannelStepTimeMax = 0; KeyId = -1; InitChannelValues(SampleMode); //XML Data file channel properties default values Description = ""; Unit = ""; GraphicFormat = new GraphSerieValueFormat(); ChannelReferenceLines = new List <GraphReferenceLine>(); }
/// <summary> /// Default constructor /// </summary> public GW_DataChannel() { Name = ""; Values = new List <double>(); Samples = null; Min = 0; Max = 0; Avg = 0; ChannelStepTimeMin = 0; ChannelStepTimeMax = 0; KeyId = -1; //XML Data file channel properties default values Description = ""; Unit = ""; GraphicFormat = new GraphSerieValueFormat(); ChannelReferenceLines = new List <GraphReferenceLine>(); }