コード例 #1
0
 public void AddPanel(DataPanel panel)
 {
     Invoke((Action)(() =>
     {
         flowLayoutPanel.Controls.Add(panel);
     }
         ));
 }
コード例 #2
0
 public void AddPanel(DataPanel panel)
 {
     Invoke((Action)(() =>
     {
         flowLayoutPanel.Controls.Add(panel);
     }
                     ));
 }
コード例 #3
0
        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);
            }
                            ));
        }
コード例 #4
0
        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);
                }
            }
                            ));
        }
コード例 #5
0
        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);
            });
        }
コード例 #6
0
        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);
            });
        }
コード例 #7
0
 public Powerform(Connection connection,DataPanel panel)
 {
     InitializeComponent();
     this.connection = connection;
     this.panel = panel;
 }
コード例 #8
0
 public Client(Identifier identifier, DataPanel panel)
 {
     this.Identifier = identifier;
     Panel           = panel;
 }
コード例 #9
0
 public Client(Identifier identifier, DataPanel panel)
 {
     this.Identifier = identifier;
     Panel = panel;
 }
コード例 #10
0
 public NewSession(DataPanel panel, Connection connection)
 {
     InitializeComponent();
     this.panel      = panel;
     this.connection = connection;
 }
コード例 #11
0
 public Powerform(Connection connection, DataPanel panel)
 {
     InitializeComponent();
     this.connection = connection;
     this.panel      = panel;
 }
コード例 #12
0
        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);
                }
            }
                ));
        }
コード例 #13
0
        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);
            }
                ));
        }
コード例 #14
0
        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);
        }