From 42dc1d36235292786322d28340a81c6cb3fd46c0 Mon Sep 17 00:00:00 2001 From: hurter Date: Wed, 31 Aug 2011 16:25:05 +0000 Subject: --- Backup/Anoto.sln | 20 ++++ Backup/Anoto.suo | Bin 0 -> 14848 bytes Backup/Anoto/Anoto.csproj | 103 +++++++++++++++++++ Backup/Anoto/Form1.Designer.cs | 96 +++++++++++++++++ Backup/Anoto/Form1.cs | 143 ++++++++++++++++++++++++++ Backup/Anoto/Form1.resx | 126 +++++++++++++++++++++++ Backup/Anoto/Program.cs | 21 ++++ Backup/Anoto/Properties/AssemblyInfo.cs | 36 +++++++ Backup/Anoto/Properties/Resources.Designer.cs | 71 +++++++++++++ Backup/Anoto/Properties/Resources.resx | 117 +++++++++++++++++++++ Backup/Anoto/Properties/Settings.Designer.cs | 30 ++++++ Backup/Anoto/Properties/Settings.settings | 7 ++ 12 files changed, 770 insertions(+) create mode 100644 Backup/Anoto.sln create mode 100644 Backup/Anoto.suo create mode 100644 Backup/Anoto/Anoto.csproj create mode 100644 Backup/Anoto/Form1.Designer.cs create mode 100644 Backup/Anoto/Form1.cs create mode 100644 Backup/Anoto/Form1.resx create mode 100644 Backup/Anoto/Program.cs create mode 100644 Backup/Anoto/Properties/AssemblyInfo.cs create mode 100644 Backup/Anoto/Properties/Resources.Designer.cs create mode 100644 Backup/Anoto/Properties/Resources.resx create mode 100644 Backup/Anoto/Properties/Settings.Designer.cs create mode 100644 Backup/Anoto/Properties/Settings.settings (limited to 'Backup') diff --git a/Backup/Anoto.sln b/Backup/Anoto.sln new file mode 100644 index 0000000..8060bad --- /dev/null +++ b/Backup/Anoto.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Anoto", "Anoto\Anoto.csproj", "{1625C3E8-5986-4F33-B33C-0B3F8A8EB56C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1625C3E8-5986-4F33-B33C-0B3F8A8EB56C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1625C3E8-5986-4F33-B33C-0B3F8A8EB56C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1625C3E8-5986-4F33-B33C-0B3F8A8EB56C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1625C3E8-5986-4F33-B33C-0B3F8A8EB56C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Backup/Anoto.suo b/Backup/Anoto.suo new file mode 100644 index 0000000..437c343 Binary files /dev/null and b/Backup/Anoto.suo differ diff --git a/Backup/Anoto/Anoto.csproj b/Backup/Anoto/Anoto.csproj new file mode 100644 index 0000000..d0e53d5 --- /dev/null +++ b/Backup/Anoto/Anoto.csproj @@ -0,0 +1,103 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {1625C3E8-5986-4F33-B33C-0B3F8A8EB56C} + WinExe + Properties + Anoto + Anoto + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\..\Program Files\Anoto\SPCD_1.2.0\Anoto.GenericStreamer.dll + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {0719D9B8-3212-443C-9853-BA7141D391A7} + 1 + 2 + 0 + tlbimp + False + + + + + \ No newline at end of file diff --git a/Backup/Anoto/Form1.Designer.cs b/Backup/Anoto/Form1.Designer.cs new file mode 100644 index 0000000..a1fbab0 --- /dev/null +++ b/Backup/Anoto/Form1.Designer.cs @@ -0,0 +1,96 @@ +namespace Anoto +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.contextMenuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox1.Location = new System.Drawing.Point(0, 0); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(746, 536); + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown); + this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint); + // + // timer1 + // + this.timer1.Enabled = true; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.clearToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(102, 26); + // + // clearToolStripMenuItem + // + this.clearToolStripMenuItem.Name = "clearToolStripMenuItem"; + this.clearToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.clearToolStripMenuItem.Text = "Clear"; + this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(746, 536); + this.Controls.Add(this.pictureBox1); + this.Name = "Form1"; + this.Text = "Form1"; + this.Load += new System.EventHandler(this.Form1_Load); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.contextMenuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem; + + + } +} + diff --git a/Backup/Anoto/Form1.cs b/Backup/Anoto/Form1.cs new file mode 100644 index 0000000..c3f97a9 --- /dev/null +++ b/Backup/Anoto/Form1.cs @@ -0,0 +1,143 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using Anoto; +using System.Threading; + + +namespace Anoto +{ + public struct Stroke + { + List Points; + } + + public partial class Form1 : Form + { + + Anoto.GenericStreamer.PenManagerClass PenManager; + + Dictionary PensStrocks; + + Dictionary> PensPoints; + Dictionary PensColor; + Mutex mutex; + Random Rnd; + + public Form1() + { + InitializeComponent(); + } + + private void Form1_Load(object sender, EventArgs e) + { + PenManager = new Anoto.GenericStreamer.PenManagerClass(); + + PenManager.PenConnected += new Anoto.GenericStreamer._IPenManagerEvents_PenConnectedEventHandler(pm_PenConnected); + PenManager.NewCoordinate += new Anoto.GenericStreamer._IPenManagerEvents_NewCoordinateEventHandler(PenManager_NewCoordinate); + PenManager.PenDown += new Anoto.GenericStreamer._IPenManagerEvents_PenDownEventHandler(PenManager_PenDown); + PenManager.PenUp += new Anoto.GenericStreamer._IPenManagerEvents_PenUpEventHandler(PenManager_PenUp); + PenManager.Start(); + + mutex = new Mutex(); + + InitDictionary(); + + Rnd = new Random(); + } + + private void InitDictionary() + { + PensPoints = new Dictionary>(); + PensColor = new Dictionary(); + + PensStrocks = new Dictionary(); + } + + void PenManager_PenUp(string penSerial, Anoto.GenericStreamer.PenType PenType, ulong time, byte penDownSeqNbr, int isSpcdGenerated) + { + Console.WriteLine("Pen Up " + penSerial + " time " + time); + } + + void PenManager_PenDown(string penSerial, Anoto.GenericStreamer.PenType PenType, ulong time, byte penDownSeqNbr, Anoto.GenericStreamer.PenTipType PenTipType, int isValidColor, byte r, byte g, byte b, int isSpcdGenerated) + { + Console.WriteLine("Pen Down " + penSerial + " time " + time); + // PensStrocks[penSerial]. + } + + void PenManager_NewCoordinate(string penSerial, Anoto.GenericStreamer.PenType PenType, ulong time, string page, int x, int y, byte imgSeqNbr, byte force) + { + mutex.WaitOne(); + PensPoints[penSerial].Add(new Point(x, y)); + mutex.ReleaseMutex(); + Console.WriteLine("Pen NewCoordinate " + penSerial + " time " + time + " x " + x + " y " + y); + pictureBox1.Invalidate(); + } + + void pm_PenConnected(string penSerial, Anoto.GenericStreamer.PenType PenType, ulong time, string productName, ushort pid) + { + + // Consol("Pen connected "); + // listBox1.Items.Add("Pen connected " + penSerial + " " + PenType.ToString() + " " + productName + "\n\r"); + Console.WriteLine("Pen connected " + penSerial + " " + PenType.ToString() + " " + productName); + PensPoints.Add(penSerial, new List()); + PensColor.Add(penSerial,new SolidBrush( Color.FromArgb(255,Rnd.Next(255),Rnd.Next(255),Rnd.Next(255)))); + // listBox1.Invalidate(); + } + + private void Form1_FormClosing(object sender, FormClosingEventArgs e) + { + + + PenManager.Stop(); + + } + + private void pictureBox1_Paint(object sender, PaintEventArgs e) + { + //draw the dots + Graphics g = e.Graphics; + g.FillRectangle(Brushes.White, new Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height)); + mutex.WaitOne(); + foreach (var pen in PensPoints) + { + foreach (var point in pen.Value) + { + g.FillEllipse(PensColor[pen.Key], (float)(point.X) / 10.0f, (float)(point.Y) / 10.0f, 2, 2); + } + } + mutex.ReleaseMutex(); + } + + private void timer1_Tick(object sender, EventArgs e) + { + pictureBox1.Invalidate(); + } + + private void clearToolStripMenuItem_Click(object sender, EventArgs e) + { + mutex.WaitOne(); + + foreach (var pen in PensPoints) + { + // pen.Value = new List(); + + } + + mutex.ReleaseMutex(); + } + + private void pictureBox1_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Right) + { + contextMenuStrip1.Show(); + } + } + } +} diff --git a/Backup/Anoto/Form1.resx b/Backup/Anoto/Form1.resx new file mode 100644 index 0000000..1248888 --- /dev/null +++ b/Backup/Anoto/Form1.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 104, 17 + + \ No newline at end of file diff --git a/Backup/Anoto/Program.cs b/Backup/Anoto/Program.cs new file mode 100644 index 0000000..2b16122 --- /dev/null +++ b/Backup/Anoto/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace Anoto +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Backup/Anoto/Properties/AssemblyInfo.cs b/Backup/Anoto/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ba7fe0d --- /dev/null +++ b/Backup/Anoto/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Anoto")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Anoto")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a9f20bdc-e709-4f8e-a0da-75dbdc2c74e7")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Backup/Anoto/Properties/Resources.Designer.cs b/Backup/Anoto/Properties/Resources.Designer.cs new file mode 100644 index 0000000..680e84a --- /dev/null +++ b/Backup/Anoto/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Anoto.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Anoto.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Backup/Anoto/Properties/Resources.resx b/Backup/Anoto/Properties/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/Backup/Anoto/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Backup/Anoto/Properties/Settings.Designer.cs b/Backup/Anoto/Properties/Settings.Designer.cs new file mode 100644 index 0000000..947d80f --- /dev/null +++ b/Backup/Anoto/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Anoto.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Backup/Anoto/Properties/Settings.settings b/Backup/Anoto/Properties/Settings.settings new file mode 100644 index 0000000..abf36c5 --- /dev/null +++ b/Backup/Anoto/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + -- cgit v1.1