コード例 #1
0
        /// <summary>
        /// Clean up the resources used by the form.
        /// </summary>
        /// <param name="disposing">True to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
        protected override void Cleanup(bool disposing)
        {
            try
            {
                if (disposing)
                {
                    // Method called by consumer code. Call the Dispose method of any managed data members that implement the dispose method.
                    // Cleanup managed objects by calling their Dispose() methods.
                    if (components != null)
                    {
                        components.Dispose();
                    }
                }

                // Whether called by consumer code or the garbage collector free all unmanaged resources and set the value of managed data
                // members to null.
                DisposeOfUserControls();

                m_WatchControlLayout = null;
                m_WatchControls      = null;

                #region - [Detach the event handler methods.] -
                #endregion - [Detach the event handler methods.] -
            }
            catch (Exception)
            {
                // Don't do anything, just ensure that an exception isn't thrown.
            }

            base.Cleanup(disposing);
        }
コード例 #2
0
        /// <summary>
        /// Form to view the watch variables in real time.
        /// </summary>
        public FormWatch(Workset_t workset)
        {
            InitializeComponent();

            m_Workset = workset;

            #region - [WatchControlSize Definitions] -
            m_WatchControlSize                        = new VariableControlSize_t();
            m_WatchControlSize.Margin.Left            = WatchControlLayout.MarginLeftWatchControl;
            m_WatchControlSize.Margin.Right           = WatchControlLayout.MarginRightWatchControl;
            m_WatchControlSize.Margin.Top             = WatchControlLayout.MarginTopWatchControl;
            m_WatchControlSize.Margin.Bottom          = WatchControlLayout.MarginBottomWatchControl;
            m_WatchControlSize.WidthVariableNameField = WatchControlLayout.WidthWatchControlVariableNameField;
            m_WatchControlSize.WidthValueField        = WatchControlLayout.WidthWatchControlValueField;
            m_WatchControlSize.WidthUnitsField        = WatchControlLayout.WidthWatchControlUnitsField;
            m_WatchControlSize.Height                 = WatchControlLayout.HeightWatchControl;
            #endregion - [WatchControlSize Definitions] -

            // Instantiate the class that helps manage the user controls.
            m_WatchControlLayout = new WatchControlLayout(this);

            ConfigureDisplayPanel(m_Workset, m_TabPage1, m_WatchControlSize);
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <param name="historicDataManager">Reference to the <c>HistoricDataManager</c> object containing the data frames that are to be displayed.</param>
        /// <param name="watchFile">The saved watch data file.</param>
        public FormDataStreamReplay(IHistoricDataManager historicDataManager, WatchFile_t watchFile ) : base(watchFile.DataStream.Workset)
        {
            InitializeComponent();

            WatchFile = watchFile;
            m_Workset = WatchFile.DataStream.Workset;
            m_HistoricDataManager = historicDataManager;

            // Instantiate the class that helps manage the user controls.
            m_WatchControlLayout = new WatchControlLayout(this, m_HistoricDataManager);

            #region - [Function Keys] -
            // Escape - Exit
            // F1 - Help
            // F2 - Print
            // F3 - Save (Not  Used)
            // F4 - YTPlot
            // F5 - Trip
            // F6 - First
            // F7 - Previous
            // F8 - Next
            // F9 - Last
            // F11 - Play
            // F12 - Header Information
            DisplayFunctionKey(F3, Resources.FunctionKeyTextSave, Resources.FunctionKeyToolTipSave, Resources.Save);
            F3.Enabled = false;
            DisplayFunctionKey(F4, Resources.FunctionKeyTextYTPlot, Resources.FunctionKeyToolTipYTPlot, Resources.YTPlot);

            // Only display the trip function key if the historic data is a fault log or simulated fault log.
            if ((m_HistoricDataManager.LogType == LogType.DataStream) || (m_HistoricDataManager.LogType == LogType.SimulatedDataStream))
            {
                DisplayFunctionKey(F5, Resources.FunctionKeyTextTrip, Resources.FunctionKeyToolTipTrip, Resources.Trip);
            }

            DisplayFunctionKey(F6, Resources.FunctionKeyTextFirst, Resources.FunctionKeyToolTipFirst, Resources.MoveFirst);
            DisplayFunctionKey(F7, Resources.FunctionKeyTextPrevious, Resources.FunctionKeyToolTipPrevious, Resources.MovePrevious);
            DisplayFunctionKey(F8, Resources.FunctionKeyTextNext, Resources.FunctionKeyToolTipNext, Resources.MoveNext);
            DisplayFunctionKey(F9, Resources.FunctionKeyTextLast, Resources.FunctionKeyToolTipLast, Resources.MoveLast);
            DisplayFunctionKey(F11, Resources.FunctionKeyTextPlay, Resources.FunctionKeyToolTipPlay, Resources.Play);
            DisplayFunctionKey(F12, Resources.FunctionKeyTextInfo, Resources.FunctionKeyToolTipInfo, Resources.FileInformation);
            #endregion - [Function Keys] -

            #region - [InformationLabels/Legend] -
            // InformationLabel 1  - Date
            // InformationLabel 2  - Start Time
            // InformationLabel 3  - Stop Time
            // InformationLabel 4  - Duration
            // InformationLabel 5  - Time
            // InformationLabel 6  - Frame
            DisplayLabel(InformationLabel1, Resources.InformationLegendDate, Color.MintCream);
            DisplayLabel(InformationLabel2, Resources.InformationLegendStartTime, Color.PaleGreen);
            DisplayLabel(InformationLabel3, Resources.InformationLegendStopTime, Color.LightCoral);
            DisplayLabel(InformationLabel4, Resources.InformationLegendDuration, Color.Khaki);
            DisplayLabel(InformationLabel5, Resources.InformationLegendRTC, Color.FromKnownColor(KnownColor.GradientInactiveCaption));
            DisplayLabel(InformationLabel6, Resources.InformationLegendFrame, Color.FromKnownColor(KnownColor.Info));
            #endregion - [InformationLabels/Legend] -

            #region - [Title] -
            Text =  Resources.TitleReplay + CommonConstants.Colon + WatchFile.Filename;
            #endregion - [Title] -

            #region - [Play Timer] -
            m_TimerPlay = new System.Windows.Forms.Timer();
            m_TimerPlay.Tick += new EventHandler(DisplayNextFrame);
            m_TimerPlay.Interval = IntervalTimerPlayInitialValue;
            m_TimerPlay.Enabled = true;
            m_TimerPlay.Stop();
            #endregion - [Play Timer] -
            
            UpdateStatusLabels();

            // Update the tab with the name of the workset.
            m_TabControl.TabPages[m_TabControl.SelectedIndex].Text = m_Workset.Name;

            // Display the values associated with the first frame.
            m_Index = 0;

            // Frame.
            InformationLabel6.Text = m_Index.ToString();

            // Don't allow the user to attempt to modify watch variable data values from this form.
            VariableControl.ReadOnly = true;
        }