Browse Source

minor changes

Rumei 5 years ago
parent
commit
05365b087e

+ 3 - 0
SketchAssistant/SketchAssistantWPF/Armband.cs

@@ -1,9 +1,12 @@
 using System;
 using System;
+using System.Runtime.InteropServices;
 
 
 namespace SketchAssistantWPF
 namespace SketchAssistantWPF
 {
 {
     internal class Armband
     internal class Armband
     {
     {
+        //[DllImport("BodyActuator.dll")]
+        //static extern void pushForward(BodyActuator* self, uint8_t tactor, double intensity, uint64_t duration);
         internal void pushForward()
         internal void pushForward()
         {
         {
             Console.WriteLine("FORWARD_PUSH");
             Console.WriteLine("FORWARD_PUSH");

+ 10 - 2
SketchAssistant/SketchAssistantWPF/MVP_Model.cs

@@ -139,8 +139,8 @@ namespace SketchAssistantWPF
         [DllImport("user32.dll", EntryPoint = "SetCursorPos")]
         [DllImport("user32.dll", EntryPoint = "SetCursorPos")]
         private static extern bool SetCursorPos(int X, int Y);
         private static extern bool SetCursorPos(int X, int Y);
 
 
-        [DllImport("user32.dll")]
-        public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
+        //[DllImport("user32.dll")]
+        //public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
 
 
         public enum MouseEventType : int
         public enum MouseEventType : int
         {
         {
@@ -473,7 +473,9 @@ namespace SketchAssistantWPF
                         FinishCurrentLine();
                         FinishCurrentLine();
                     }
                     }
                 }
                 }
+                //projectPointOntoScreen(optiTrackX, optiTrackY);
             }
             }
+            SetCursorPos(800,800);
             if (cursorPositions.Count > 0) { previousCursorPosition = cursorPositions.Dequeue(); }
             if (cursorPositions.Count > 0) { previousCursorPosition = cursorPositions.Dequeue(); }
             else { previousCursorPosition = currentCursorPosition; }
             else { previousCursorPosition = currentCursorPosition; }
             cursorPositions.Enqueue(currentCursorPosition);
             cursorPositions.Enqueue(currentCursorPosition);
@@ -507,6 +509,12 @@ namespace SketchAssistantWPF
             }
             }
         }
         }
 
 
+        private void projectPointOntoScreen(float optiTrackX, float optiTrackY)
+        {
+            Point auxiliaryPoint = ConvertToPixels(new Point(optiTrackX, optiTrackY));
+            SetCursorPos((int)auxiliaryPoint.X, (int)auxiliaryPoint.Y);
+        }
+
         private bool CheckInsideDrawingZone(float optiTrackZ)
         private bool CheckInsideDrawingZone(float optiTrackZ)
         {
         {
             if (Math.Abs(optiTrackZ) > WARNING_ZONE_BOUNDARY * 2) return false;
             if (Math.Abs(optiTrackZ) > WARNING_ZONE_BOUNDARY * 2) return false;