示例#1
0
        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
            {

            }
        }
示例#2
0
 private void connect_draw_stanZbiornik()
 {
     udp client = new udp();
     stanReturnZbiornik = client.udp_konfig(adres, port, byte_stanZbiornikSend);
     try
     {
         rysZbiornik rys2 = new rysZbiornik(pictureBox1.Width, pictureBox1.Height, Convert.ToInt32(stanReturnZbiornik));
         pictureBox1.Image = rys2.wypelnienie;
         pictureBox2.Image = rys2.wypelnienie;
         pictureBox3.Image = rys2.wypelnienie;
         stanLabel.Text = stanReturnZbiornik + " %";
         stanLabel.Visible = true;
         toolStripStatusLabel1.Text = "Połączono";
     }
     catch
     {
         //DateTime localDate = DateTime.Now;
         //listBox1.Items.Add(localDate.ToString("HH:mm")+ "\t" + stanReturn);
         //toolStripStatusLabel1.Text = stanReturnZbiornik;
         //stanLabel.Visible = false;
     }            
 }
示例#3
0
        private void onoff_tryb()
        {
            udp client = new udp();
            min = client.udp_konfig(adres, port, byte_zalaczenieSend);
            max = client.udp_konfig(adres, port, byte_wylaczenieSend);
            try
            {
                Convert.ToInt32(min);
                Convert.ToInt32(max);
                onoff.Text = min + "/" + max;
            }
            catch
            {

            }
            onoff.Visible = true;
        }
示例#4
0
 private void tryb_pompy()
 {
     udp client = new udp();
     trybReturnPompa = client.udp_konfig(adres, port, byte_trybPompaSend);
     if (trybReturnPompa == "0") trybLabelPompa.Text = "AUTO";
     if (trybReturnPompa == "1") trybLabelPompa.Text = "ON";
     if (trybReturnPompa == "2") trybLabelPompa.Text = "OFF";
     trybLabelPompa.Visible = true;
 }
示例#5
0
 private void ustawieniaToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ustawienia ustawienia = new ustawienia();
     if(ustawienia.ShowDialog()==DialogResult.OK)
     {
         udp client_tcp = new udp();
         client_tcp.tcp_konfig(tryb[ustawienia.tryb]);
         client_tcp.tcp_konfig(on_tryb[ustawienia.on]);
         client_tcp.tcp_konfig(off_tryb[ustawienia.off]);
     }
 }
示例#6
0
 private void wateczek()
 {
     client = new udp();
     RunOnUiThread(() =>
     {
         string stan = client.udp_konfig("192.168.42.42", "8888", sendData);
         try
         {
             Convert.ToInt32(stan);
             myTextView.Text = stan + " %";
             myProgress_1.Progress = Convert.ToInt32(stan);
             myProgress_2.Progress = Convert.ToInt32(stan);
             myProgress_3.Progress = Convert.ToInt32(stan);
             myTextView.Visibility = ViewStates.Visible;
             myrbtn1.Enabled = true;
             myrbtn2.Enabled = true;
             myrbtn3.Enabled = true;
         }
         catch
         {
             myTextView.Text = "Błąd";
             myTextView.Visibility = ViewStates.Visible;
             myrbtn1.Enabled = false;
             myrbtn2.Enabled = false;
             myrbtn3.Enabled = false;
         }
     });
 }
示例#7
0
 private void inicjalizacja_kontrolek()
 {
     myTextView = FindViewById<TextView>(Resource.Id.textView1);
     myTextView.Gravity = GravityFlags.Center;
     myProgress_1 = FindViewById<ProgressBar>(Resource.Id.progressBar1);
     myProgress_2 = FindViewById<ProgressBar>(Resource.Id.progressBar2);
     myProgress_3 = FindViewById<ProgressBar>(Resource.Id.progressBar3);
     myrbtn1 = FindViewById<RadioButton>(Resource.Id.radioButton1);
     myrbtn2 = FindViewById<RadioButton>(Resource.Id.radioButton2);
     myrbtn3 = FindViewById<RadioButton>(Resource.Id.radioButton3);
     timer1 = new System.Timers.Timer(1000);
     timer1.Enabled = true;
     client = new udp();
     tryb = client.udp_konfig("192.168.42.42", "8888", trybData);
 }
示例#8
0
 private void Myrbtn1_Click(object sender, EventArgs e)
 {
     client = new udp();
     client.tcp_konfig('X');
 }