Beispiel #1
0
        /// <summary>
        /// TEMP Display result when possible
        /// </summary>
        private void sketchPanel_ResultReceived(SketchPanelLib.RecognitionResult result)
        {
            // Get the result
            TruthTableRecognitionResult ttResult;

            if (result is TruthTableRecognitionResult && result.UserTriggered)
            {
                ttResult = (TruthTableRecognitionResult)result;
            }
            else
            {
                return; // ignore other results
            }
            // Clear display
            clear();

            // Validate result as displayable; display error message otherwise
            if (ttResult.NumCols > 1 &&                       // Need at two columns
                ttResult.NumRows > 0 &&                       // Need at least one row
                ttResult.LabelPins.Count == ttResult.NumCols) // Need # labels == # columns
            {
                // Display the result
                currentResult = ttResult;
                displayResult();
            }
            else
            {
                System.Windows.MessageBox.Show("Error: Truth table could not be recognized.  " +
                                               "Please ensure that truth table is drawn according to necessary conventions");
            }
        }
        public override RecognitionResult Recognize(RecognitionArgs args)
        {
            Substroke[]       substrokes = args.Sketch.Substrokes;
            RecognitionResult result     = new RecognitionResult();

            result.UserTriggered = true;
            result.Sketch        = args.Sketch;

            Recognizers.Recognizer.Results results = classify.Recognize(substrokes);
            result.status = results.ToString();

            System.Drawing.Color c = classify.ToColor(results);

            foreach (Substroke s in substrokes)
            {
                s.XmlAttrs.Color = c.ToArgb();
            }

            return(result);
        }
Beispiel #3
0
 /// <summary>
 /// Initializes Error highlighting.
 /// </summary>
 /// <param name="result">The current recognition result.</param>
 private void sketchPanel_ResultReceived(SketchPanelLib.RecognitionResult result)
 {
     // Nothing for now - Should begin parsing
 }