public void AddPanel(DataPanel panel) { Invoke((Action)(() => { flowLayoutPanel.Controls.Add(panel); } )); }
private void button1_Click(object sender, EventArgs e) { DataPanel panel = new DataPanel(this, connection, new Identifier("test", 123)); Client client = new Client(new Identifier("test", 123), panel); clients.Add(client); Invoke((Action)(() => { flowLayoutPanel.Controls.Add(panel); } )); }
public void LoadMeasurements(List <Measurement> mes) { DataPanel panel = new DataPanel(this, connection, new Identifier("test", 123)); List <Measurement> measurements = mes; Invoke((Action)(() => { flowLayoutPanel.Controls.Add(panel); foreach (Measurement measurement in measurements) { string _pulse = measurement.pulse; string _rpm = measurement.RPM; string _speed = measurement.speed; string _distance = measurement.distance; string _power = measurement.power; string _energy = measurement.energy; string _time = measurement.time; string _actualPower = measurement.AP; //Parse all strings to int int I_pulse = Int32.Parse(_pulse); int I_rpm = Int32.Parse(_rpm); int I_speed = Int32.Parse(_speed); int I_distance = Int32.Parse(_distance); int I_power = Int32.Parse(_power); int I_energy = Int32.Parse(_energy); TimeSpan ts = TimeSpan.Parse(_time); int I_sec = ts.Seconds; int I_min = ts.Minutes; int I_actualPower = Int32.Parse(_actualPower); //Adding coördinates to chart MethodInvoker miP = delegate() { panel.returnChart().Series["Pulse"].Points.AddXY(I_sec, I_pulse); }; panel.Invoke(miP); MethodInvoker miR = delegate() { panel.returnChart().Series["RPM"].Points.AddXY(I_sec, I_rpm); }; panel.Invoke(miR); MethodInvoker miS = delegate() { panel.returnChart().Series["Speed"].Points.AddXY(I_sec, I_speed); }; panel.Invoke(miS); MethodInvoker miD = delegate() { panel.returnChart().Series["Distance"].Points.AddXY(I_sec, I_distance); }; panel.Invoke(miD); MethodInvoker miPo = delegate() { panel.returnChart().Series["Power"].Points.AddXY(I_sec, I_power); }; panel.Invoke(miPo); MethodInvoker miE = delegate() { panel.returnChart().Series["Energy"].Points.AddXY(I_sec, I_energy); }; panel.Invoke(miE); MethodInvoker miAP = delegate() { panel.returnChart().Series["Actual Power"].Points.AddXY(I_sec, I_actualPower); }; panel.Invoke(miAP); } } )); }
public SessionsChooser(DataPanel panel, Connection connection, Form1 form1) { //send request for the requests connection.writePacket(new PacketRequestSessions() { id = panel.id.Id, username = "******" }); while (Connection.Sessions == null) { } InitializeComponent(); //sessies Connection.Sessions.ForEach(session => { this.box.Items.Add(session); }); }
public Powerform(Connection connection,DataPanel panel) { InitializeComponent(); this.connection = connection; this.panel = panel; }
public Client(Identifier identifier, DataPanel panel) { this.Identifier = identifier; Panel = panel; }
public NewSession(DataPanel panel, Connection connection) { InitializeComponent(); this.panel = panel; this.connection = connection; }
public Powerform(Connection connection, DataPanel panel) { InitializeComponent(); this.connection = connection; this.panel = panel; }
public void LoadMeasurements(List<Measurement> mes) { DataPanel panel = new DataPanel(this, connection, new Identifier("test", 123)); List<Measurement> measurements = mes; Invoke((Action)(() => { flowLayoutPanel.Controls.Add(panel); foreach (Measurement measurement in measurements) { string _pulse = measurement.pulse; string _rpm = measurement.RPM; string _speed = measurement.speed; string _distance = measurement.distance; string _power = measurement.power; string _energy = measurement.energy; string _time = measurement.time; string _actualPower = measurement.AP; //Parse all strings to int int I_pulse = Int32.Parse(_pulse); int I_rpm = Int32.Parse(_rpm); int I_speed = Int32.Parse(_speed); int I_distance = Int32.Parse(_distance); int I_power = Int32.Parse(_power); int I_energy = Int32.Parse(_energy); TimeSpan ts = TimeSpan.Parse(_time); int I_sec = ts.Seconds; int I_min = ts.Minutes; int I_actualPower = Int32.Parse(_actualPower); //Adding coördinates to chart MethodInvoker miP = delegate () { panel.returnChart().Series["Pulse"].Points.AddXY(I_sec, I_pulse); }; panel.Invoke(miP); MethodInvoker miR = delegate () { panel.returnChart().Series["RPM"].Points.AddXY(I_sec, I_rpm); }; panel.Invoke(miR); MethodInvoker miS = delegate () { panel.returnChart().Series["Speed"].Points.AddXY(I_sec, I_speed); }; panel.Invoke(miS); MethodInvoker miD = delegate () { panel.returnChart().Series["Distance"].Points.AddXY(I_sec, I_distance); }; panel.Invoke(miD); MethodInvoker miPo = delegate () { panel.returnChart().Series["Power"].Points.AddXY(I_sec, I_power); }; panel.Invoke(miPo); MethodInvoker miE = delegate () { panel.returnChart().Series["Energy"].Points.AddXY(I_sec, I_energy); }; panel.Invoke(miE); MethodInvoker miAP = delegate () { panel.returnChart().Series["Actual Power"].Points.AddXY(I_sec, I_actualPower); }; panel.Invoke(miAP); } } )); }
private void button1_Click(object sender, EventArgs e) { DataPanel panel = new DataPanel(this,connection, new Identifier("test", 123)); Client client = new Client(new Identifier("test", 123), panel); clients.Add(client); Invoke((Action)(() => { flowLayoutPanel.Controls.Add(panel); } )); }
public void receiveNewClient(PacketNewClient newClient) { //MessageBox.Show("Yeah new client: "+newClient.GetHashCode()); DataPanel panel = new DataPanel(form, this, newClient.Identifier); Client client = new Client(newClient.Identifier, panel); form.clients.Add(client); form.AddPanel(panel); }