Esempio n. 1
0
        private TimersTimingStruct getTimerElement(string timernamestring, ArrayList timers)
        {
            for (int i = 0; i < timers.Count; i++)
            {
                TimersTimingStruct timerElement = (TimersTimingStruct)timers[i];
                if (timerElement.timername == timernamestring)
                {
                    return(timerElement);
                }
            }
            TimersTimingStruct dummyElement = new TimersTimingStruct();

            dummyElement.timername = "notimerfound";
            return(dummyElement);
        }
Esempio n. 2
0
 private void CopySimInputsToDataGrid()
 {
     try
     {
         bool found = false;
         for (int j = 0; j < dataGridView1.RowCount; j++)
         {
             found = false;
             for (int i = 0; i < SimRungs.Count; i++)
             {
                 if ((string)dataGridView1.Rows[j].Cells[0].Value == SimRungs[i].ToString())
                 {
                     found = true;
                     TimersTimingStruct timerelement = getTimerElement((string)dataGridView1.Rows[j].Cells[0].Value, SimS2DTimers);
                     if (timerelement.timername != "notimerfound")
                     {
                         dataGridView1.Rows[j].Cells[1].Value = "High " + "- Low in " +
                                                                (timerelement.totaltime - timerelement.timeElapsed) + "s (" + timerelement.totaltime + "s timer)";
                     }
                     else
                     {
                         dataGridView1.Rows[j].Cells[1].Value = "High";
                     }
                     dataGridView1.Rows[j].DefaultCellStyle.ForeColor = Color.Red;
                 }
             }
             if (!found && (dataGridView1.Rows[j].Cells[0].Value != null))
             {
                 TimersTimingStruct timerelement = getTimerElement((string)dataGridView1.Rows[j].Cells[0].Value, SimS2PTimers);
                 if (timerelement.timername != "notimerfound")
                 {
                     dataGridView1.Rows[j].Cells[1].Value = "Low " + "- High in " +
                                                            (timerelement.totaltime - timerelement.timeElapsed) + "s (" + timerelement.totaltime + "s timer)";
                 }
                 else
                 {
                     dataGridView1.Rows[j].Cells[1].Value = "Low";
                 }
                 dataGridView1.Rows[j].DefaultCellStyle.ForeColor = Color.Blue;
             }
         }
     } catch { MessageBox.Show("Error Updating Simulation Rung Panel", "Logic Navigator failure", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); }
 }