Esempio n. 1
0
        public void Start()
        {
            try
            {
                mRTStylus = new RealTimeStylus(mParent);
                mPlugin   = new SimpleStylusPlugin(this);
                mRTStylus.SyncPluginCollection.Add(mPlugin);
                Guid[] g = new Guid[] { PacketProperty.X, PacketProperty.Y, PacketProperty.NormalPressure, PacketProperty.XTiltOrientation, PacketProperty.YTiltOrientation };
                mRTStylus.SetDesiredPacketDescription(g);


                Tablets theTablets = new Tablets();
                string  theReport  = Environment.NewLine;
                foreach (Tablet theTablet in theTablets)
                {
                    if (theTablet.IsPacketPropertySupported(PacketProperty.NormalPressure))
                    {
                        TabletPropertyMetrics theMetrics = theTablet.GetPropertyMetrics(PacketProperty.NormalPressure);
                        mMaxPressure = theMetrics.Maximum;
                    }
                }



                mRTStylus.Enabled = true;
            }
            catch (System.Exception ex)
            {
                CoreGlobals.getErrorManager().OnSimpleWarning(ex.ToString());
            }
        }
Esempio n. 2
0
                public TabletPropertyDescription CreateTabletPropertyDescription()
                {
                    TabletPropertyMetrics metrics = new TabletPropertyMetrics();

                    metrics.Maximum    = this.TabletPropertyMetrics_Maximum;
                    metrics.Minimum    = this.TabletPropertyMetrics_Minimum;
                    metrics.Resolution = this.TabletPropertyMetrics_Resolution;
                    metrics.Units      = this.TabletPropertyMetrics_Units;

                    return(new TabletPropertyDescription(this.PacketPropertyId, metrics));
                }
        public static void Debug()
        {
            Console.WriteLine("Current Calibration:");
            Console.WriteLine("Maximum Raw Pressure: {0}", Current.MaximumRawPressure);
            Console.WriteLine("Maxium Calibrated Pressure: {0}", Current.MaximumCalibratedPressure);
            Console.WriteLine();
            Console.WriteLine();

            foreach (Tablet t in new Tablets())
            {
                Console.WriteLine("Tablet Information:");
                Console.WriteLine("Tablet Name: {0}", t.Name);
                Console.WriteLine("Tablet PPID: {0}", t.PlugAndPlayId);
                if (new Tablets().DefaultTablet == t)
                {
                    Console.WriteLine("DEFAULT");
                }

                Console.WriteLine("Supported Metrics:");

                foreach (System.Reflection.FieldInfo fi in typeof(PacketProperty).GetFields())
                {
                    Guid PProp = (Guid)fi.GetValue(null);

                    Console.WriteLine("{0}: {1}",
                                      fi.Name,
                                      t.IsPacketPropertySupported(PProp) ? "Supported" : "Not Supported");

                    if (t.IsPacketPropertySupported(PProp))
                    {
                        TabletPropertyMetrics Metrics = t.GetPropertyMetrics(PProp);
                        Console.WriteLine("[{0}, {1}], d{2} as {3}", Metrics.Minimum, Metrics.Maximum, Metrics.Resolution, Metrics.Units);
                    }
                }

                Console.WriteLine();
                Console.WriteLine();
            }
        }
                public TabletPropertyDescription CreateTabletPropertyDescription()
                {
                    TabletPropertyMetrics metrics = new TabletPropertyMetrics();
                    metrics.Maximum = this.TabletPropertyMetrics_Maximum;
                    metrics.Minimum = this.TabletPropertyMetrics_Minimum;
                    metrics.Resolution = this.TabletPropertyMetrics_Resolution;
                    metrics.Units = this.TabletPropertyMetrics_Units;

                    return new TabletPropertyDescription(this.PacketPropertyId, metrics);
                }