Beispiel #1
0
        ///////////////////////////////////////////////////////////////////////
        public TestForm()
        {
            InitializeComponent();
            FakeEnable();
            this.FormClosing += new FormClosingEventHandler(TestForm_FormClosing);
            TR     = new TemplateRecognizer();
            Shapes = new ShapeTemplate();

            compareTimer          = new System.Windows.Forms.Timer();
            compareTimer.Tick    += new EventHandler(CompareShapes);
            compareTimer.Interval = 400;

            timerInterval = .1;

            timeoutTimer          = new System.Windows.Forms.Timer();
            timeoutTimer.Tick    += new EventHandler(TimeTick);
            timeoutTimer.Interval = (int)(timerInterval * 1000);

            reenableTimer          = new System.Windows.Forms.Timer();
            reenableTimer.Tick    += new EventHandler(ReenableScreen);
            reenableTimer.Interval = 3000;

            maxTime  = 20;
            timeLeft = maxTime;

            strokeNum     = 0;
            autoRecognize = true;
            loadSets();
            currentSet = 0;
            currentSeq = 0;
            seqIndex   = 0;

            screenEnabled  = true;
            timeoutEnabled = true;

            currentShape = sets[currentSet][currentSeq][seqIndex];
            CurrentTemplateLabel.Text = String.Format("{3}", currentSet, currentSeq, seqIndex, Shapes.getShape(currentShape).name);
            TimeLeftLabel.Text        = String.Format("Time left: {0:F1} s", timeLeft);

            debugButtonsOn   = false;
            showCurrentShape = true;

            this.KeyPreview = true;
            this.KeyPress  += new KeyPressEventHandler(Form1_KeyPress);
        }
Beispiel #2
0
        ///////////////////////////////////////////////////////////////////////
        public TestForm()
        {
            InitializeComponent();
            FakeEnable();
            this.FormClosing += new FormClosingEventHandler(TestForm_FormClosing);
            TR = new TemplateRecognizer();
            Shapes = new ShapeTemplate();

            compareTimer = new System.Windows.Forms.Timer();
            compareTimer.Tick += new EventHandler(CompareShapes);
            compareTimer.Interval = 400;

            timerInterval = .1;

            timeoutTimer = new System.Windows.Forms.Timer();
            timeoutTimer.Tick += new EventHandler(TimeTick);
            timeoutTimer.Interval = (int)(timerInterval * 1000);

            reenableTimer = new System.Windows.Forms.Timer();
            reenableTimer.Tick += new EventHandler(ReenableScreen);
            reenableTimer.Interval = 3000;

            maxTime = 20;
            timeLeft = maxTime;

            strokeNum = 0;
            autoRecognize = true;
            loadSets();
            currentSet = 0;
            currentSeq = 0;
            seqIndex = 0;

            screenEnabled = true;
            timeoutEnabled = true;

            currentShape = sets[currentSet][currentSeq][seqIndex];
            CurrentTemplateLabel.Text = String.Format("{3}", currentSet, currentSeq, seqIndex, Shapes.getShape(currentShape).name);
            TimeLeftLabel.Text = String.Format("Time left: {0:F1} s", timeLeft);

            debugButtonsOn = false;
            showCurrentShape = true;

            this.KeyPreview = true;
            this.KeyPress += new KeyPressEventHandler(Form1_KeyPress);
        }