Exemplo n.º 1
0
 private void updateGUI()
 {
     if (txtSSSI.InvokeRequired)
     {
         updateGUICallback d = new updateGUICallback(updateGUI);
         Invoke(d, new object[] { });
     }
     else
     {
         try
         {
             if (dataCollection.SSSI1.Count > 0)
             {
                 txtSSSI.Text = dataCollection.SSSI1[dataCollection.SSSI1.Count - 1].ToString();
             }
             if (dataCollection.CDSI1.Count > 0)
             {
                 txtCDSI.Text = dataCollection.CDSI1[dataCollection.CDSI1.Count - 1].ToString();
             }
             if (dataCollection.DSSI1.Count > 0)
             {
                 txtDSSI.Text = dataCollection.DSSI1[dataCollection.DSSI1.Count - 1].ToString();
             }
             if (dataCollection.SISI1.Count > 0)
             {
                 txtSISI.Text = dataCollection.SISI1[dataCollection.SISI1.Count - 1].ToString();
             }
             txtStride.Text = dataCollection.Stridelength.ToString();
         }
         catch (ArgumentOutOfRangeException) { }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Function to update the visibility of our intro panel.
 /// Gets called when we die, and when we successfully connect.
 /// </summary>
 /// <param name="visible"></param>
 private void updatePanel(bool visible)
 {
     if (IntroPanel.InvokeRequired)
     {
         updateGUICallback c = updatePanel;
         this.Invoke(c, new object[] { visible });
     }
     else
     {
         IntroPanel.Visible = visible;
     }
 }
Exemplo n.º 3
0
 void update_chart(power_data data)
 {
     if (chart1.InvokeRequired)
     {
         updateGUICallback d = new updateGUICallback(update_chart);
         this.Invoke(d, new object[] { data });
     }
     else
     {
         try
         {
             chart1.Series["Power"].Points.AddXY(data.time_stamp.ToLongTimeString(), data.current * data.voltage);
         }
         catch (Exception ex)
         {
             string msg = ex.Message;
         }
     }
 }
Exemplo n.º 4
0
        private void updateGUI()
        {
            if (txtSSSI.InvokeRequired)
            {
                updateGUICallback d = new updateGUICallback(updateGUI);
                Invoke(d, new object[] { });
            }
            else
            {
                try
                {
                    if (dataCollection.SSSI1.Count > 0) txtSSSI.Text = dataCollection.SSSI1[dataCollection.SSSI1.Count - 1].ToString();
                    if (dataCollection.CDSI1.Count > 0) txtCDSI.Text = dataCollection.CDSI1[dataCollection.CDSI1.Count - 1].ToString();
                    if (dataCollection.DSSI1.Count > 0) txtDSSI.Text = dataCollection.DSSI1[dataCollection.DSSI1.Count - 1].ToString();
                    if (dataCollection.SISI1.Count > 0) txtSISI.Text = dataCollection.SISI1[dataCollection.SISI1.Count - 1].ToString();
                    txtStride.Text = dataCollection.Stridelength.ToString();
                }
                catch (ArgumentOutOfRangeException) { }
            }

        }