Пример #1
0
        private void BindingAbaDimmer()
        {
            AutMachine.AND d0 = new AutMachine.AND("interruptor", "dimmer0", "UI.toggleBtn", "tgbEnableDimmer");
            d0.GetStatus += GetStatusDelegate;
            AutMachine.Dimmer di0 = new AutMachine.Dimmer();
            d0.AddAction(di0);

            Acao.Add(d0);
        }
Пример #2
0
        private void BindingAbaMotor()
        {
            AutMachine.AND m0 = new AutMachine.AND("motor", "control0", "sistema", "true");
            m0.GetStatus += GetStatusDelegate;

            AutMachine.AND m1 = new AutMachine.AND("motor", "control1", "sistema", "true");
            m1.GetStatus += GetStatusDelegate;

            //Acrescentando o botão de habilitar
            AutMachine.AND motor = new AutMachine.AND("UI.toggleBtn", "tgbEnableMotor", "sistema", "true");
            motor.GetStatus += GetStatusDelegate;
            motor.AddAction(m0);
            motor.AddAction(m1);

            Acao.Add(motor);
        }
Пример #3
0
        private void BindingAbaSensor()
        {
            AutMachine.AND s0 = new AutMachine.AND("sensor", "sensor0", "sistema", "true");
            s0.GetStatus += GetStatusDelegate;

            AutMachine.AND s1 = new AutMachine.AND("sensor", "sensor1", "sistema", "true");
            s1.GetStatus += GetStatusDelegate;

            //Acrescentando o botão de habilitar
            AutMachine.AND sensor = new AutMachine.AND("UI.toggleBtn", "tgbEnableSensor", "sistema", "true");
            sensor.GetStatus += GetStatusDelegate;
            sensor.AddAction(s0);
            sensor.AddAction(s1);

            Acao.Add(sensor);
        }
Пример #4
0
        private void BindingAbaInterruptor()
        {
            AutMachine.AND i0 = new AutMachine.AND("interruptor", "Int0", "sistema", "true");
            i0.GetStatus += GetStatusDelegate;

            AutMachine.AND i1 = new AutMachine.AND("interruptor", "Int1", "sistema", "true");
            i1.GetStatus += GetStatusDelegate;

            AutMachine.AND i2 = new AutMachine.AND("interruptor", "Int2", "sistema", "true");
            i2.GetStatus += GetStatusDelegate;

            //Acrescentando o botão de habilitar
            AutMachine.AND interruptor = new AutMachine.AND("UI.toggleBtn", "tgbEnableInterruptor", "sistema", "true");
            interruptor.GetStatus += GetStatusDelegate;
            interruptor.AddAction(i0);
            interruptor.AddAction(i1);
            interruptor.AddAction(i2);

            Acao.Add(interruptor);
        }
Пример #5
0
        private void RegistraComandosAoVivo()
        {
            //Registrando automação do interruptor do poste
            AutMachine.AND intPoste = new AutMachine.AND("UI.toggleBtn", "tgbIntPoste", "sistema", "true");
            intPoste.GetStatus += GetStatusDelegate;
            comm.devices[modulo2].io[0].AddAction(intPoste);

            //Registrando automação do interruptor da garagem
            AutMachine.AND intGaragem = new AutMachine.AND("UI.toggleBtn", "tgbIntGaragem", "sistema", "true");
            intGaragem.GetStatus += GetStatusDelegate;
            comm.devices[modulo2].io[1].AddAction(intGaragem);

            //Registrando automação do interruptor da área de serviços
            AutMachine.AND intServ = new AutMachine.AND("UI.toggleBtn", "tgbIntServico", "sistema", "true");
            intServ.GetStatus += GetStatusDelegate;
            comm.devices[modulo1].io[2].AddAction(intServ);

            //Registrando automação do interruptor da área externa
            AutMachine.AND intExt = new AutMachine.AND("UI.toggleBtn", "tgbIntExt", "sistema", "true");
            intExt.GetStatus += GetStatusDelegate;
            comm.devices[modulo1].io[1].AddAction(intExt);
        }
Пример #6
0
        private void BindingAbaAlarme()
        {
            t0a = new AutMachine.ClockInterval();
            t1a = new AutMachine.ClockInterval();

            Binding bindAlarm = new Binding("T0InicA");

            bindAlarm.Source = this;
            bindAlarm.Mode   = BindingMode.TwoWay;

            dteAlarmInic0.SetBinding(VIBlend.WPF.Controls.DateTimeEditor.ValueProperty, bindAlarm);
            bindAlarm.Path.Path = "T0FimA";
            dteAlarmFim0.SetBinding(VIBlend.WPF.Controls.DateTimeEditor.ValueProperty, bindAlarm);

            bindAlarm.Path.Path = "T1InicA";
            dteAlarmInic1.SetBinding(VIBlend.WPF.Controls.DateTimeEditor.ValueProperty, bindAlarm);
            bindAlarm.Path.Path = "T1FimA";
            dteAlarmFim1.SetBinding(VIBlend.WPF.Controls.DateTimeEditor.ValueProperty, bindAlarm);


            List <AutMachine.Action> ands = new List <AutMachine.Action>();
            var a1 = new AutMachine.AND("UI.checkbox", "chbSeg1", "sistema", "true");

            a1.GetStatus += GetStatusDelegate;
            ands.Add(a1);
            var a2 = new AutMachine.AND("UI.checkbox", "chbTer1", "sistema", "true");

            a2.GetStatus += GetStatusDelegate;
            ands.Add(a2);
            var a3 = new AutMachine.AND("UI.checkbox", "chbQua1", "sistema", "true");

            a3.GetStatus += GetStatusDelegate;
            ands.Add(a3);
            var a4 = new AutMachine.AND("UI.checkbox", "chbQui1", "sistema", "true");

            a4.GetStatus += GetStatusDelegate;
            ands.Add(a4);
            var a5 = new AutMachine.AND("UI.checkbox", "chbSex1", "sistema", "true");

            a5.GetStatus += GetStatusDelegate;
            ands.Add(a5);
            var a6 = new AutMachine.AND("UI.checkbox", "chbSab1", "sistema", "true");

            a6.GetStatus += GetStatusDelegate;
            ands.Add(a6);
            var a7 = new AutMachine.AND("UI.checkbox", "chbDom1", "sistema", "true");

            a7.GetStatus += GetStatusDelegate;
            ands.Add(a7);

            for (int i = 0; i < 7; i++)
            {
                var dia = new AutMachine.DayWeekInterval(t0.inic.AddDays(i));

                dia.AddAction(t0a);
                dia.AddAction(t1a);

                ands[i].AddAction(dia);
            }

            //Insere a automação das datas em cada sensor e com o botão de habilita geral
            AutMachine.AND sa0 = new AutMachine.AND("sensor", "salarm0", "UI.toggleBtn", "tgbEnableAlarme");
            sa0.GetStatus += GetStatusDelegate;

            AutMachine.AND sa1 = new AutMachine.AND("sensor", "salarm1", "UI.toggleBtn", "tgbEnableAlarme");
            sa1.GetStatus += GetStatusDelegate;

            AutMachine.AND sa2 = new AutMachine.AND("sensor", "salarm2", "UI.toggleBtn", "tgbEnableAlarme");
            sa2.GetStatus += GetStatusDelegate;

            foreach (var item in ands)
            {
                sa0.AddAction(item);
                sa1.AddAction(item);
                sa2.AddAction(item);
            }

            //Acrescentando na lista geral de ações
            Acao.Add(sa0);
            Acao.Add(sa1);
            Acao.Add(sa2);
        }
Пример #7
0
        private void BindingAbaTempo()
        {
            t0 = new AutMachine.ClockInterval();
            t1 = new AutMachine.ClockInterval();
            t2 = new AutMachine.ClockInterval();
            d0 = new AutMachine.DateInterval();

            Binding bindTimers = new Binding("T0Inic");

            bindTimers.Source = this;
            bindTimers.Mode   = BindingMode.TwoWay;

            dteInic0.SetBinding(VIBlend.WPF.Controls.DateTimeEditor.ValueProperty, bindTimers);
            bindTimers.Path.Path = "T0Fim";
            dteFim0.SetBinding(VIBlend.WPF.Controls.DateTimeEditor.ValueProperty, bindTimers);

            bindTimers.Path.Path = "T1Inic";
            dteInic1.SetBinding(VIBlend.WPF.Controls.DateTimeEditor.ValueProperty, bindTimers);
            bindTimers.Path.Path = "T1Fim";
            dteFim1.SetBinding(VIBlend.WPF.Controls.DateTimeEditor.ValueProperty, bindTimers);

            bindTimers.Path.Path = "T2Inic";
            dteInic2.SetBinding(VIBlend.WPF.Controls.DateTimeEditor.ValueProperty, bindTimers);
            bindTimers.Path.Path = "T2Fim";
            dteFim2.SetBinding(VIBlend.WPF.Controls.DateTimeEditor.ValueProperty, bindTimers);

            List <AutMachine.Action> ands = new List <AutMachine.Action>();
            var a1 = new AutMachine.AND("UI.checkbox", "chbSeg", "sistema", "true");

            a1.GetStatus += GetStatusDelegate;
            ands.Add(a1);
            var a2 = new AutMachine.AND("UI.checkbox", "chbTer", "sistema", "true");

            a2.GetStatus += GetStatusDelegate;
            ands.Add(a2);
            var a3 = new AutMachine.AND("UI.checkbox", "chbQua", "sistema", "true");

            a3.GetStatus += GetStatusDelegate;
            ands.Add(a3);
            var a4 = new AutMachine.AND("UI.checkbox", "chbQui", "sistema", "true");

            a4.GetStatus += GetStatusDelegate;
            ands.Add(a4);
            var a5 = new AutMachine.AND("UI.checkbox", "chbSex", "sistema", "true");

            a5.GetStatus += GetStatusDelegate;
            ands.Add(a5);
            var a6 = new AutMachine.AND("UI.checkbox", "chbSab", "sistema", "true");

            a6.GetStatus += GetStatusDelegate;
            ands.Add(a6);
            var a7 = new AutMachine.AND("UI.checkbox", "chbDom", "sistema", "true");

            a7.GetStatus += GetStatusDelegate;
            ands.Add(a7);

            for (int i = 0; i < 7; i++)
            {
                var dia = new AutMachine.DayWeekInterval(t0.inic.AddDays(i));

                dia.AddAction(t0);
                dia.AddAction(t1);
                dia.AddAction(t2);

                ands[i].AddAction(dia);
            }

            bindTimers.Path.Path = "DInic";
            dtpInic.SetBinding(DatePicker.SelectedDateProperty, bindTimers);
            bindTimers.Path.Path = "DFim";
            dtpFim.SetBinding(DatePicker.SelectedDateProperty, bindTimers);

            foreach (var item in ands)
            {
                d0.AddAction(item);
            }

            //Acrescentando o botão de habilitar
            AutMachine.AND timer1 = new AutMachine.AND("UI.toggleBtn", "tgbEnableTimer", "sistema", "true");
            timer1.GetStatus += GetStatusDelegate;
            timer1.AddAction(d0);

            Acao.Add(timer1);
        }