/// <summary> /// Initializes a new instance of the structure. Used when instantiating a data stream structure to store the simulated fault log. /// </summary> /// <param name="logType">The type of log.</param> /// <param name="durationMs">The duration of the log, in ms.</param> /// <param name="durationPostTripMs">The duration of the log, in ms, following the trip.</param> /// <param name="frameIntervalMs">The interval, in ms, between successive data frames.</param> public DataStream_t(LogType logType, double durationMs, double durationPostTripMs, short frameIntervalMs) { DataStreamTypeParameters = new DataStreamTypeParameters_t(); StreamNumber = CommonConstants.NotDefined; LogType = LogType.SimulatedDataStream; EventDescription = string.Empty; FrameIntervalMs = frameIntervalMs; DurationMs = (int)durationMs; SampleCount = (short)(DurationMs / frameIntervalMs); DurationPostTripMs = (int)durationPostTripMs; DurationPreTripMs = (int)(durationMs - durationPostTripMs); DataStreamTypeParameters.TripIndex = (short)(((durationMs - durationPostTripMs) / durationMs) * SampleCount); Workset = new Workset_t(); WatchFrameList = new List <WatchFrame_t>(SampleCount); AutoScaleWatchValues = new AutoScale_t[Parameter.WatchSize]; TimeOrigin = CommonConstants.NotDefined; }
/// <summary> /// Initializes a new instance of the structure. Used when initializing a data stream to store recorded watch values. /// </summary> /// <param name="frameIntervalMs">The interval, in ms, between successive data frames.</param> public DataStream_t(short frameIntervalMs) { DataStreamTypeParameters = new DataStreamTypeParameters_t(); DataStreamTypeParameters.SetToDefaulDataStreamType(); StreamNumber = CommonConstants.NotDefined; LogType = LogType.Watch; EventDescription = string.Empty; FrameIntervalMs = frameIntervalMs; DurationMs = CommonConstants.NotDefined; SampleCount = CommonConstants.NotDefined; DurationPostTripMs = CommonConstants.NotDefined; DurationPreTripMs = CommonConstants.NotDefined; Workset = new Workset_t(); WatchFrameList = new List <WatchFrame_t>(); AutoScaleWatchValues = new AutoScale_t[Parameter.WatchSize]; TimeOrigin = CommonConstants.NotDefined; }
/// <summary> /// The event handler for the <c>Shown</c> event. /// </summary> /// <param name="sender">Reference to the object that raised the event.</param> /// <param name="e">Parameter passed from the object that raised the event.</param> private void FormPlotDefine_Shown(object sender, EventArgs e) { if (CalledFrom == null) { return; } WatchFile_t watchFile = ((IWatchFile)CalledFrom).WatchFile; DataStreamTypeParameters_t datastreamTypeParameters = watchFile.DataStream.DataStreamTypeParameters; // Check whether the workset is a data stream rather than a recorded watch file or a simulated data stream and, if so, hide the TabPages, // Labels and TextBoxes that aren't required and update the TabPage header text. if (watchFile.DataStream.LogType.Equals(LogType.DataStream)) { // Only one column is required fot this workset so delete the tab pages associated with columns 2 and 3. m_TabControlColumn.TabPages.Remove(m_TabPageColumn2); m_TabControlColumn.TabPages.Remove(m_TabPageColumn3); m_LabelCountTotal.Visible = false; m_LegendHeader1.Visible = false; m_TextBoxHeader1.Enabled = false; m_TextBoxHeader1.Visible = false; m_TabPageColumn1.Text = Resources.HeaderTextDataStream; } }
/// <summary> /// Initializes a new instance of the structure. Used when initializing a datastream to store fault log data retrieved from the VCU. /// </summary> /// <param name="eventRecord">The event record associated with the data stream.</param> /// <param name="watchCount">The number of watch variables contained within the data stream.</param> /// <param name="sampleCount">The number of data samples associated with the data stream.</param> /// <param name="sampleMultiple">The multiple of the base sample interval at which the data is recorded.</param> /// <param name="workset">The workset associated with the data stream.</param> public DataStream_t(EventRecord eventRecord, short watchCount, short sampleCount, short sampleMultiple, Workset_t workset) { // Get the log information associated with the event record. Log log = Lookup.LogTable.Items[eventRecord.LogIdentifier]; DataStreamTypeParameters = log.DataStreamTypeParameters; StreamNumber = eventRecord.StreamNumber; LogType = LogType.DataStream; EventDescription = eventRecord.Description; FrameIntervalMs = (short)(sampleMultiple * log.SampleIntervalMs); SampleCount = sampleCount; DurationMs = (SampleCount - 1) * FrameIntervalMs; DurationPreTripMs = DataStreamTypeParameters.TripIndex * FrameIntervalMs; DurationPostTripMs = DurationMs - DurationPreTripMs; Workset = new Workset_t(); Workset = workset; WatchFrameList = new List <WatchFrame_t>(SampleCount); AutoScaleWatchValues = new AutoScale_t[workset.Count]; TimeOrigin = CommonConstants.NotDefined; }