private void connect_draw_stanPompa() { udp client = new udp(); stanReturnPompa = client.udp_konfig(adres, port, byte_stanPompaSend); if (stanReturnPompa == "ON") { stanLabelPompa.Text = "ON"; stanPompa = 1; } if (stanReturnPompa == "OFF") { stanLabelPompa.Text = "OFF"; stanPompa = 2; } stanLabelPompa.Visible = true; try { //rysunek zbiornika rysPompa rys = new rysPompa(pictureBox4.Width, pictureBox4.Height, stanPompa); pictureBox4.Image = rys.wypelnienie; //zielony lub czerwony w zależności od stanu //wyslij 1 lub 2 do rysPompa //zwroc kolor rysunku //label stan Pompy } catch { } }
private void inicjalizacja() { rysZbiornik rys = new rysZbiornik(pictureBox1.Width, pictureBox1.Height); pictureBox1.Image = rys.wypelnienie; pictureBox2.Image = rys.wypelnienie; pictureBox3.Image = rys.wypelnienie; rysPompa rys3 = new rysPompa(pictureBox4.Width, pictureBox4.Height); pictureBox4.Image = rys3.wypelnienie; }