diff options
author | hurter | 2011-08-31 16:25:05 +0000 |
---|---|---|
committer | hurter | 2011-08-31 16:25:05 +0000 |
commit | 42dc1d36235292786322d28340a81c6cb3fd46c0 (patch) | |
tree | 6f4ef0d4ad672c54500d9457af90fc599ac9b299 /AnotoData/AnotoRadarScreen.cs | |
parent | 5aa429a3e7e9f610f5b2dd8f8e2a865ecfd25ea3 (diff) | |
download | amilis-42dc1d36235292786322d28340a81c6cb3fd46c0.zip amilis-42dc1d36235292786322d28340a81c6cb3fd46c0.tar.gz amilis-42dc1d36235292786322d28340a81c6cb3fd46c0.tar.bz2 amilis-42dc1d36235292786322d28340a81c6cb3fd46c0.tar.xz |
Diffstat (limited to 'AnotoData/AnotoRadarScreen.cs')
-rw-r--r-- | AnotoData/AnotoRadarScreen.cs | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/AnotoData/AnotoRadarScreen.cs b/AnotoData/AnotoRadarScreen.cs new file mode 100644 index 0000000..d99c743 --- /dev/null +++ b/AnotoData/AnotoRadarScreen.cs @@ -0,0 +1,62 @@ +using System;
+using System.Collections.Generic;
+
+using System.Text;
+using System.Drawing;
+using System.Globalization;
+
+
+namespace AnotoData
+{
+ public class AnotoRadarScreen : AnotoHotArea
+ {
+ CultureInfo ci = new CultureInfo("en-US");
+
+ public AnotoRadarScreen()
+ {
+ this.Category = Categories.Screen;
+ this.PageIndex = -1; //Multi pages
+
+ LastX = -1;
+ LastY = -1;
+ LastPage = "";
+
+ }
+
+ public override bool IsInside(int x, int y, string page)
+ {
+ if ((page == "1728.0.0.8") || (page == "1728.0.0.9"))
+ return true;
+ return false;
+ }
+
+ private int LastX = -1;
+ private int LastY = -1;
+ private string LastPage = "";
+
+
+ public void SendIvyMsg(string penSerial, int x, int y, string page, IvyBus.IvyControl TheIvyBus)
+ {
+ if ((LastX != x) || (LastY != y) || (LastPage != page))
+ {
+ //Normalize the data
+ PointF ptN = GetNormilizedCoordinate(x, y, page);
+ TheIvyBus.SendMsg("RadarScreenPenDown PenId=" + penSerial + " X=" + ptN.X.ToString(ci) + " Y=" + ptN.Y.ToString(ci));
+
+ LastX = x;
+ LastY = y;
+ LastPage = page;
+ }
+
+ }
+
+ public PointF GetNormilizedCoordinate(int x, int y, string page)
+ {
+ float yn = (float)y / (float)AnotoHotArea.MaxY;
+ float xn = (float)x / (float)AnotoHotArea.MaxX / 2.0f;
+ if (page == "1728.0.0.9") xn += 0.5f;
+
+ return new PointF(xn, yn);
+ }
+ }
+}
|