Beispiel #1
0
 /// <summary>
 /// Event when the stepping model is applied.
 /// </summary>
 /// <param name="o">DataManager</param>
 /// <param name="e">SteppingModelEventArgs</param>
 private void ApplySteppingModelEvent(object o, SteppingModelEventArgs e)
 {
     if (m_status == ProjectStatus.Uninitialized || m_status == ProjectStatus.Loading)
         return;
     UpdatePropForSimulation();
 }
Beispiel #2
0
        /// <summary>
        /// Event when the stepping model is applied.
        /// </summary>
        /// <param name="o">DataManager</param>
        /// <param name="e">SteppingModelEventArgs</param>
        private void ApplySteppingModelEvent(object o, SteppingModelEventArgs e)
        {
            if (m_status == ProjectStatus.Uninitialized || m_status == ProjectStatus.Loading)
                return;
            ReloadProperties();

            int count = 0;
            foreach (int id in m_env.DataManager.SaveTime.Keys)
            {
                if (m_env.DataManager.SaveTime[id] == e.ApplyTime)
                {
                    if (count == 0)
                        m_dgv.ReadOnly = false;
                    else
                        m_dgv.ReadOnly = true;

                }
                count++;
            }
        }
Beispiel #3
0
        /// <summary>
        /// Event when the stepping model is changed.
        /// </summary>
        /// <param name="o">DataManager.</param>
        /// <param name="e">SteppingModelEventArgs</param>
        private void DataManager_SteppingModelEvent(object o, SteppingModelEventArgs e)
        {
            for (int i = 1; i <= 10; i++)
            {
                menuSteppingModelDic[i].Visible = false;
                menuSteppingModelDic[i].Enabled = false;
            }

            foreach (int id in m_dManager.SaveTime.Keys)
            {
                menuSteppingModelDic[id].Visible = true;
                menuSteppingModelDic[id].Enabled = true;
                menuSteppingModelDic[id].Text = m_dManager.SaveTime[id].ToString();
            }
            if (m_dManager.SaveTime.Count > 1)
            {
                menuSteppingModel.Enabled = true;
                m_backButton.Enabled = true;
                m_fowardButton.Enabled = false;
            }
            else
            {
                menuSteppingModel.Enabled = false;
                m_backButton.Enabled = false;
                m_fowardButton.Enabled = false;
            }
        }
Beispiel #4
0
        /// <summary>
        /// Event when the stepping model is applied.
        /// </summary>
        /// <param name="o">DataManager</param>
        /// <param name="e">SteppingModelEventArgs</param>
        private void DataManager_ApplySteppingModelEvent(object o, SteppingModelEventArgs e)
        {
            if (m_type == ProjectStatus.Uninitialized || m_type == ProjectStatus.Loading)
                return;
            if (e.ApplyTime < 0.0)
            {
                m_timeText.Text = DataManager.CurrentProject.Simulator.GetCurrentTime().ToString(m_env.DataManager.DisplayStringFormat);
            }
            else
            {
                m_timeText.Text = e.ApplyTime.ToString(m_env.DataManager.DisplayStringFormat);
            }
            int index = m_dManager.SaveTime.Count;
            int count = 0;
            foreach (int id in m_dManager.SaveTime.Keys)
            {
                if (m_dManager.SaveTime[id] == e.ApplyTime)
                {
                    if (count == 0)
                        m_fowardButton.Enabled = false;
                    else
                        m_fowardButton.Enabled = true;

                    if (count == index - 1)
                        m_backButton.Enabled = false;
                    else
                        m_backButton.Enabled = true;
                }
                count++;
            }
        }
 public void TestConstructor()
 {
     Assert.AreEqual(0.0, _unitUnderTest.ApplyTime, "ApplyTime returns unexpected value.");
     _unitUnderTest = new SteppingModelEventArgs(100.0);
     Assert.AreEqual(100.0, _unitUnderTest.ApplyTime, "ApplyTime returns unexpected value.");
 }
 public void TearDown()
 {
     _unitUnderTest = null;
 }
 public void SetUp()
 {
     _unitUnderTest = new SteppingModelEventArgs(0.0d);
 }