protected virtual void OnGrav(GravEventArgs e) { if (Grav != null) { Grav(this, e); } }
private void nmea_Grav(object sender, GravEventArgs e) { switch (gravType) { case 0: // Feey this.gravity = string.Format("{0:0.000}", e.Gravity); this.Gravity = e.Gravity; this.AvgGrav = e.AvgGrav; this.avgGrav = string.Format("{0:0.000}", e.AvgGrav); this.gravLabel.Invoke(new EventHandler(WorkerUpdate)); break; case 1: // Meters gravLabel.Text = string.Format("{0:0.0} m", e.CrossLevel); if (gravChart == null) { gravChart = new LogChart(gravPictureBox.Width, gravPictureBox.Height, -50, 0, 10, 180, 60); } //gravChart.AddValue(-(int)e.CrossLevel); break; case 2: // Fathoms gravLabel.Text = string.Format("{0:0.0} fm", e.LongLevel); if (gravChart == null) { gravChart = new LogChart(gravPictureBox.Width, gravPictureBox.Height, -30, 0, 10, 180, 60); } //gravChart.AddValue(-(int)e.LongLevel); break; } this.gravPictureBox.Invoke(new EventHandler(ChartUpdate)); //gravPictureBox.Image = gravChart.Paint(); }
private void nmea_Grav(object sender, GravEventArgs e) { switch(gravType) { case 0: // Feey this.gravity = string.Format("{0:0.000}", e.Gravity); this.Gravity = e.Gravity; this.AvgGrav = e.AvgGrav; this.avgGrav = string.Format("{0:0.000}", e.AvgGrav); this.gravLabel.Invoke(new EventHandler(WorkerUpdate)); break; case 1: // Meters gravLabel.Text = string.Format("{0:0.0} m", e.CrossLevel); if(gravChart == null) gravChart = new LogChart(gravPictureBox.Width, gravPictureBox.Height, -50, 0, 10, 180, 60); //gravChart.AddValue(-(int)e.CrossLevel); break; case 2: // Fathoms gravLabel.Text = string.Format("{0:0.0} fm", e.LongLevel); if(gravChart == null) gravChart = new LogChart(gravPictureBox.Width, gravPictureBox.Height, -30, 0, 10, 180, 60); //gravChart.AddValue(-(int)e.LongLevel); break; } this.gravPictureBox.Invoke(new EventHandler(ChartUpdate)); //gravPictureBox.Image = gravChart.Paint(); }
protected virtual void OnGrav(GravEventArgs e) { if (Grav != null) Grav(this, e); }