public bool CheckConnection() { string adresIP = IP.Text; string port = Port.Text; if (!Nadklasa.Init(adresIP, port)) { return(false); } Console.WriteLine(Nadklasa.SendMessage("HLL\n")); return(true); }
public void LoadModules() { //-------Playground Mode-------- /*CheckBox t = new CheckBox(); * t.Content = "RGB"; * dostepne.listBox1.Items.Add(t); * t = new CheckBox(); * t.Content = "Buzzer"; * dostepne.listBox1.Items.Add(t); * t = new CheckBox(); * t.Content = "Humidity"; * dostepne.listBox1.Items.Add(t); * t = new CheckBox(); * t.Content = "Temperature"; * dostepne.listBox1.Items.Add(t); * t = new CheckBox(); * t.Content = "Distance"; * dostepne.listBox1.Items.Add(t); * t = new CheckBox(); * t.Content = "Light"; * dostepne.listBox1.Items.Add(t); * t = new CheckBox(); * t.Content = "Light"; * dostepne.listBox1.Items.Add(t); * return;*/ //------------------------------ string modolki = Nadklasa.SendMessage("ASK\n"); int dl = wyluskaj(modolki); int val = Convert.ToInt32(modolki.Substring(0, dl)); for (int i = 0; i < val; i++) { string nazwa = map[modolki.Substring(dl + 1 + 4 * i, 3)]; CheckBox temp = new CheckBox(); temp.Content = nazwa; dostepne.listBox1.Items.Add(temp); } }