Exemplo n.º 1
0
 private void button_set_param_Click(object sender, EventArgs e)
 {
     akt.plc_send_IO(DataIOType.SetParam, new Int16[] {
         -1,
         Convert.ToInt16(checkBox_light_enable_lux.Checked),
         Convert.ToInt16(textBox_light_lux_off.Text),
         Convert.ToInt16(checkBox_light_enable_timer.Checked),
         Convert.ToInt16(textBox_light_time_h.Text),
         Convert.ToInt16(textBox_light_time_m.Text),
         Convert.ToInt16(textBox_light_time_s.Text)
     });
 }
Exemplo n.º 2
0
 public UC_heater(object _a)
 {
     InitializeComponent();
     akt             = (aktuator)_a;
     label_name.Text = "[" + akt.Index.ToString() + "] " + akt.Name;
     akt.plc_send_IO(DataIOType.GetParam);
 }
Exemplo n.º 3
0
 public UC_dialog_light(object aktor)
 {
     InitializeComponent();
     _aktor = (aktuator)aktor;
     _aktor.plc_send_IO(DataIOType.GetParam);
     //_aktor.plc_send(new Frame(Frame.GET_PARAM(_aktor.Index)));
 }
Exemplo n.º 4
0
        private void button_send_Click(object sender, EventArgs e)
        {
            try
            {
                Int16 minutes_on  = Convert.ToInt16(textBox_time_on.Text);
                Int16 minutes_off = Convert.ToInt16(textBox_time_off.Text);

                akt.plc_send_IO(DataIOType.SetParam, new Int16[] {
                    Convert.ToInt16(checkBox_ctrl_manuel.Checked),
                    Convert.ToInt16(checkBox_ctrl_on.Checked),
                    (Int16)(minutes_on / 60),  //time on -> hour
                    (Int16)(minutes_on % 60),  //time on -> minutes
                    (Int16)(minutes_off / 60), //time off -> hour
                    (Int16)(minutes_off % 60), //time off -> minutes
                    Convert.ToInt16(textBox_start_h.Text),
                    Convert.ToInt16(textBox_start_m.Text),
                    Convert.ToInt16(textBox_stop_h.Text),
                    Convert.ToInt16(textBox_stop_m.Text),
                    Convert.ToInt16(Convert.ToDouble(textBox_stop_at_degree.Text) * 100)
                });

                button_send.Visible = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 5
0
        public UC_dialog_jalousie(object aktor)
        {
            InitializeComponent();
            _aktor = (aktuator)aktor;
            _aktor.plc_send_IO(DataIOType.GetParam);

            init_event();
        }
Exemplo n.º 6
0
 private void checkBox_EditLock_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBox_EditLock.Checked)
     {
         panel_params.Enabled = true;
         for (int i = 0; i < EVENT_COUNT; i++)
         {
             list_UC_jalousie[i].Enabled = true;
         }
     }
     else
     {
         panel_params.Enabled = false;
         for (int i = 0; i < EVENT_COUNT; i++)
         {
             list_UC_jalousie[i].Enabled = false;
         }
         _aktor.plc_send_IO(cpsLIB.DataIOType.GetParam);
     }
 }
Exemplo n.º 7
0
 private void write_new_data()
 {
     try
     {
         akt.plc_send_IO(DataIOType.SetParamJalousieEvent, new Int16[] { count, Convert.ToInt16(textBox_event_time_hour.Text),
                                                                         Convert.ToInt16(textBox_event_time_min.Text), Convert.ToInt16(textBox_event_time_sec.Text),
                                                                         Convert.ToInt16(comboBox_event_position.Text), Convert.ToInt16(comboBox_event_angle.Text),
                                                                         Convert.ToInt16(checkBox_event_enable.Checked), Convert.ToInt16(radioButton_event_driving_up.Checked) });
     }
     catch (Exception) {
         //TODO: Fehleingaben vorher abfragen bzw defaultwerte setzen
         MessageBox.Show("Fehlerhafte eingabe (evtl nicht alle felder ausgefüllt?)", "Fehler");
     }
 }
Exemplo n.º 8
0
 private void button_jal_drive_to_Click(object sender, EventArgs e)
 {
     button_jal_drive_to.Visible = false;
     akt.plc_send_IO(DataIOType.SetState, new Int16[] { Convert.ToInt16(comboBox_new_position.Text), Convert.ToInt16(comboBox_new_angle.Text) });
 }
Exemplo n.º 9
0
 public UC_dialog_heater(object aktor)
 {
     InitializeComponent();
     akt = (aktuator)aktor;
     akt.plc_send_IO(cpsLIB.DataIOType.GetParam);
 }
Exemplo n.º 10
0
 private void button_switch_Click(object sender, EventArgs e)
 {
     //TODO: implement Frame SetState
     //_aktor.plc_send(new Frame(Frame.SET_STATE(_aktor.Index, true)));
     _aktor.plc_send_IO(DataIOType.SetState, new Int16[] { 1 });
 }