Exemplo n.º 1
0
        private void PerProtocolControlsPriorityTimeClick(object sender, RoutedEventArgs e)
        {
            ProtocoloExp2 p = _exp2Class.GetProtocolo(((ProtocoloExp2)xpControlsPanel.DataContext).IndiceProtocolo);

            //p.PrioridadCiclos = false;
            p.PrioridadCiclos = true;
        }
Exemplo n.º 2
0
 private void UcProtocolListEnableAllClick(object sender, RoutedEventArgs e)
 {
     for (int i = 0; i < _exp2Class.NumberOfProtocols; i++)
     {
         ProtocoloExp2 p = _exp2Class.GetProtocolo(i);
         p.IsActive = true;
     }
     RefreshTree();
 }
Exemplo n.º 3
0
        public NewXP2()
        {
            InitializeComponent();

            _exp2Class.Started = false;

            for (int i = 0; i < _exp2Class.NumberOfProtocols; i++)
            {
                ProtocoloExp2 p = _exp2Class.GetProtocolo(i);
                p.IsActive = false;
                p.Invertir = (i % 2 == 0);
                p.EnNegro  = false;

                p.ActiveAnim  = ProtocoloExp2.AnimOptions.DerechoRecto;
                p.ActiveIllum = ProtocoloExp2.IllumOptions.Random;
                p.AutoAnim    = false;

                p.CyclesNextProtocol = 1;
                p.TimeNextProtocol   = 10f;
                p.PrioridadCiclos    = true;
                p.CiclosEntrePulso   = 0;

                p.TimeToShowTarget     = 1.0f;
                p.TimeToStartAnimation = 1.5f;
                p.TimeToEndAnimation   = 3.0f;
                p.ExtraWaitingTime     = 4.0f;

                p.DistanceBwnTargets   = 50.0f;
                p.ShouldLightenOnTouch = true;
                p.TimeToLightenTarget  = 1.2f;
                p.TimeToStopLighten    = 2.5f;
            }

            _tvProtocolos             = tvProtocolosControl.TreeViewProtocolos;
            _listaData                = GetData();
            _tvProtocolos.ItemsSource = _listaData;


            flowControls.DataContext    = _exp2Class;
            xpControlsPanel.DataContext = _exp2Class.GetProtocolo(0);


            _dispatcherTimer.Tick    += DispatcherTimerTick;
            _dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1);
            _dispatcherTimer.Start();


            _sm = SocketManager.Instance;
            _sm.CreateReceivingSocket(IPAddress.Any, 5001);

            for (int i = 0; i < nProtocolos; i++)
            {
                copyFromCombo.Items.Add("Protocolo " + (i + 1));
            }
            copyFromCombo.SelectedIndex = 0;
        }
Exemplo n.º 4
0
        private void TvProtocolosSelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            var t = (TreeView)sender;

            if (t == null)
            {
                return;
            }

            var g = t.SelectedItem as Composite;


            if (g != null)
            {
                wpanel.DataContext = _exp2Class.GetProtocolo(g.Indice);
                ProtocoloExp2 protocolo = _exp2Class.GetProtocolo(g.Indice);
                if (botonPriorizarCiclos != null)
                {
                    botonPriorizarCiclos.IsChecked = protocolo.PrioridadCiclos;
                    botonPriorizarTiempo.IsChecked = !protocolo.PrioridadCiclos;
                }

                if (rbRandom != null)
                {
                    rbRandom.IsChecked = (protocolo.ActiveIllum == ProtocoloExp2.IllumOptions.Random) ? true : false;
                }
                if (rbRightPanel != null)
                {
                    rbRightPanel.IsChecked = (protocolo.ActiveIllum == ProtocoloExp2.IllumOptions.RightPanel) ? true : false;
                }
                if (rbLeftPanel != null)
                {
                    rbLeftPanel.IsChecked = (protocolo.ActiveIllum == ProtocoloExp2.IllumOptions.LeftPanel) ? true : false;
                }

                if (animationRightStraight != null)
                {
                    animationRightStraight.IsChecked = (protocolo.ActiveAnim == ProtocoloExp2.AnimOptions.DerechoRecto) ? true : false;
                }
                if (animationLeftStraight != null)
                {
                    animationLeftStraight.IsChecked = (protocolo.ActiveAnim == ProtocoloExp2.AnimOptions.IzquierdoRecto) ? true : false;
                }
                if (animationRightOblique != null)
                {
                    animationRightOblique.IsChecked = (protocolo.ActiveAnim == ProtocoloExp2.AnimOptions.DerechoOblicuo) ? true : false;
                }
                if (animationLeftOblique != null)
                {
                    animationLeftOblique.IsChecked = (protocolo.ActiveAnim == ProtocoloExp2.AnimOptions.IzquierdoOblicuo) ? true : false;
                }
            }
            stackPanel4.DataContext = _exp2Class;
        }
Exemplo n.º 5
0
        private void PerProtocolControlsPriorityCycleClick(object sender, RoutedEventArgs e)
        {
            ProtocoloExp2 p = (ProtocoloExp2)xpControlsPanel.DataContext ?? _exp2Class.GetProtocolo(0);

            p.PrioridadCiclos = true;
        }
Exemplo n.º 6
0
        private void AnimationLeftObliqueChecked(object sender, RoutedEventArgs e)
        {
            ProtocoloExp2 p = (ProtocoloExp2)xpControlsPanel.DataContext ?? _exp2Class.GetProtocolo(0);

            p.ActiveAnim = ProtocoloExp2.AnimOptions.IzquierdoOblicuo;
        }
Exemplo n.º 7
0
        private void AnimationRightStraightChecked(object sender, RoutedEventArgs e)
        {
            ProtocoloExp2 p = (ProtocoloExp2)xpControlsPanel.DataContext ?? _exp2Class.GetProtocolo(0);

            p.ActiveAnim = ProtocoloExp2.AnimOptions.DerechoRecto;
        }
Exemplo n.º 8
0
        private void RbLeftPanelChecked(object sender, RoutedEventArgs e)
        {
            ProtocoloExp2 p = (ProtocoloExp2)xpControlsPanel.DataContext ?? _exp2Class.GetProtocolo(0);

            p.ActiveIllum = ProtocoloExp2.IllumOptions.LeftPanel;
        }
Exemplo n.º 9
0
        private void BotonPriorizarCiclosChecked(object sender, RoutedEventArgs e)
        {
            ProtocoloExp2 p = (ProtocoloExp2)wpanel.DataContext ?? _exp2Class.GetProtocolo(0);

            p.PrioridadCiclos = true;
        }
Exemplo n.º 10
0
        private void AnimationLeftStraightChecked(object sender, RoutedEventArgs e)
        {
            ProtocoloExp2 p = (ProtocoloExp2)wpanel.DataContext ?? _exp2Class.GetProtocolo(0);

            p.ActiveAnim = ProtocoloExp2.AnimOptions.IzquierdoRecto;
        }
Exemplo n.º 11
0
        private void AnimationRightObliqueChecked(object sender, RoutedEventArgs e)
        {
            ProtocoloExp2 p = (ProtocoloExp2)wpanel.DataContext ?? _exp2Class.GetProtocolo(0);

            p.ActiveAnim = ProtocoloExp2.AnimOptions.DerechoOblicuo;
        }
Exemplo n.º 12
0
        private void RbRandomChecked(object sender, RoutedEventArgs e)
        {
            ProtocoloExp2 p = (ProtocoloExp2)wpanel.DataContext ?? _exp2Class.GetProtocolo(0);

            p.ActiveIllum = ProtocoloExp2.IllumOptions.Random;
        }