summaryrefslogtreecommitdiff
path: root/AnotoData/AnotoRadarScreen.cs
diff options
context:
space:
mode:
Diffstat (limited to 'AnotoData/AnotoRadarScreen.cs')
-rw-r--r--AnotoData/AnotoRadarScreen.cs62
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);
+ }
+ }
+}