Exemple #1
0
    // ---- start buttons
    private void on_button_flicker_lights_start_clicked(object o, EventArgs args)
    {
        int speed = Convert.ToInt32(spinbutton_flicker_lights_speed.Value);
        ChronopicAuto cs = new ChronopicStartReactionTimeAnimation();
        cs.CharToSend = "f";
        cs.Write(cp2016.SP,speed);

        on_button_execute_test_clicked(o, args);
    }
Exemple #2
0
    // ---- start buttons

    private void on_button_flicker_lights_start_clicked(object o, EventArgs args)
    {
        int           speed = Convert.ToInt32(spinbutton_flicker_lights_speed.Value);
        ChronopicAuto cs    = new ChronopicStartReactionTimeAnimation();

        cs.CharToSend = "f";
        cs.Write(cp2016.SP, speed);

        on_button_execute_test_clicked(o, args);
    }
Exemple #3
0
    private void on_event_execute_reaction_time_start(object o, EventArgs args)
    {
        currentEventExecute.FakeButtonReactionTimeStart.Clicked -= new EventHandler(on_event_execute_reaction_time_start);

        //Fire leds or buzzer on discriminative (if not simulated)
        if(cp2016.StoredCanCaptureContacts)
        {
            if(extra_window_radio_reaction_time_discriminative.Active) {
                Thread.Sleep(Convert.ToInt32(discriminativeStartTime * 1000)); //in ms

                ChronopicAuto cs = new ChronopicStartReactionTimeAnimation();
                cs.CharToSend = discriminativeCharToSend;
                cs.Write(cp2016.SP, 0);
            }
            else if(extra_window_radio_reaction_time_animation_lights.Active) {
                int speed = Convert.ToInt32(spinbutton_animation_lights_speed.Value);
                ChronopicAuto cs = new ChronopicStartReactionTimeAnimation();
                cs.CharToSend = "l";
                cs.Write(cp2016.SP,speed);
            }

            LogB.Information("on_event_execute_reaction_time_start check if need to open SP");
            if(! cp2016.SP.IsOpen) {
                LogB.Information("opening SP...");
                cp2016.SP.Open();
            }

            /*
             * some machines needed to flush
             * - my Linux laptop two bytes
             * - a linux guest on windows host (virtual box) don't need
             * Note this will not allow reaction time be lower than 100 ms (DefaultTimeout on chronopic.cs)
             */
            LogB.Information("Going to flush by time out");	//needed on some machines
            cp2016.CP.FlushByTimeOut();
            LogB.Information("flushed!");
        }

        currentEventExecute.Manage2();
    }