소스 검색

Fixed variable names

Martin Edlund 5 년 전
부모
커밋
d64910ea7f

+ 7 - 7
SketchAssistant/SketchAssistantWPF/MVP_Model.cs

@@ -131,9 +131,9 @@ namespace SketchAssistantWPF
         /// </summary>
         private double WARNING_ZONE_BOUNDARY = 0.10; //10cm
         /// <summary>
-        /// object of class Armband used for controlling the vibrotactil armband
+        /// object of class wristband used for controlling the vibrotactile wristband
         /// </summary>
-        private Armband armband;
+        private Wristband wristband;
         /// <summary>
         /// Is set to true when the trackable has passed to the backside of the drawing surface, 
         /// invalidating all inputs on its way back.
@@ -173,7 +173,7 @@ namespace SketchAssistantWPF
             UpdateUI();
             rightImageSize = new ImageDimension(0, 0);
             connector = new OptiTrackConnector();
-            armband = new Armband();
+            wristband = new Wristband();
 
             //Set up Optitrack
             optitrackAvailable = false;
@@ -182,7 +182,7 @@ namespace SketchAssistantWPF
                 if (connector.Init(@"C:\Users\videowall-pc-user\Documents\BP-SketchAssistant\SketchAssistant\optitrack_setup.ttp"))
                 {
                     optitrackAvailable = true;
-                    connector.StartTracking(getOptiTrackPosition);
+                    connector.StartTracking(GetOptiTrackPosition);
                 }
             }
         }
@@ -207,7 +207,7 @@ namespace SketchAssistantWPF
         /// Function that is called by the OptitrackController to pass frames to the model.
         /// </summary>
         /// <param name="frame">An Optitrack Frame</param>
-        void getOptiTrackPosition(OptiTrack.Frame frame)
+        void GetOptiTrackPosition(OptiTrack.Frame frame)
         {
             if (frame.Trackables.Length >= 1)
             {
@@ -617,11 +617,11 @@ namespace SketchAssistantWPF
                     programPresenter.UpdateCurrentLine(currentLine);
                     if (optiTrackZ > WARNING_ZONE_BOUNDARY)
                     {
-                        armband.pushForward();
+                        wristband.pushForward();
                     }
                     else if (optiTrackZ < -1 * WARNING_ZONE_BOUNDARY)
                     {
-                        armband.pushBackward();
+                        wristband.pushBackward();
                     }
                 }
             }

+ 16 - 16
SketchAssistant/SketchAssistantWPF/MVP_Presenter.cs

@@ -30,19 +30,19 @@ namespace SketchAssistantWPF
         /// <summary>
         /// The actual size of the left canvas.
         /// </summary>
-        ImageDimension CanvasSizeLeft = new ImageDimension(0, 0);
+        ImageDimension canvasSizeLeft = new ImageDimension(0, 0);
         /// <summary>
         /// The actual size of the right canvas.
         /// </summary>
-        ImageDimension CanvasSizeRight = new ImageDimension(0, 0);
+        ImageDimension canvasSizeRight = new ImageDimension(0, 0);
         /// <summary>
         /// A list of line similarities, resulting in the similarity of the whole image.
         /// </summary>
-        List<double> ImageSimilarity = new List<double>();
+        List<double> imageSimilarity = new List<double>();
         /// <summary>
         /// The lines in the left canvas.
         /// </summary>
-        List<InternalLine> LeftLines = new List<InternalLine>();
+        List<InternalLine> leftLines = new List<InternalLine>();
 
         /*******************/
         /*** ENUMERATORS ***/
@@ -84,9 +84,9 @@ namespace SketchAssistantWPF
         /// <param name="rightPBS">The new size of the left picture box.</param>
         public void Resize(Tuple<int, int> leftPBS, Tuple<int, int> rightPBS)
         {
-            CanvasSizeLeft.ChangeDimension(leftPBS.Item1, leftPBS.Item2);
-            CanvasSizeRight.ChangeDimension(rightPBS.Item1, rightPBS.Item2);
-            programModel.ResizeEvent(CanvasSizeLeft, CanvasSizeRight);
+            canvasSizeLeft.ChangeDimension(leftPBS.Item1, leftPBS.Item2);
+            canvasSizeRight.ChangeDimension(rightPBS.Item1, rightPBS.Item2);
+            programModel.ResizeEvent(canvasSizeLeft, canvasSizeRight);
         }
 
         /// <summary>
@@ -111,7 +111,7 @@ namespace SketchAssistantWPF
                         Tuple<int, int, List<InternalLine>> values = fileImporter.ParseSVGInputFile(fileNameTup.Item1, programModel.leftImageBoxWidth, programModel.leftImageBoxHeight);
                         values.Item3.ForEach(line => line.MakePermanent(0)); //Make all lines permanent
                         programModel.SetLeftLineList(values.Item1, values.Item2, values.Item3);
-                        programModel.ResizeEvent(CanvasSizeLeft, CanvasSizeRight);
+                        programModel.ResizeEvent(canvasSizeLeft, canvasSizeRight);
                         programModel.ResetRightImage();
                         programModel.CanvasActivated();
                         programModel.ChangeState(true);
@@ -206,7 +206,7 @@ namespace SketchAssistantWPF
             }
             if (okToContinue)
             {
-                programModel.ResizeEvent(CanvasSizeLeft, CanvasSizeRight);
+                programModel.ResizeEvent(canvasSizeLeft, canvasSizeRight);
                 programModel.ResetRightImage();
                 programModel.CanvasActivated();
                 programModel.ChangeState(true);
@@ -335,12 +335,12 @@ namespace SketchAssistantWPF
             }
             //Calculate similarity scores 
             UpdateSimilarityScore(Double.NaN); var templist = lines.Where(tup => tup.Item1).ToList();
-            if (LeftLines.Count > 0)
+            if (leftLines.Count > 0)
             {
-                for (int i = 0; i < LeftLines.Count; i++)
+                for (int i = 0; i < leftLines.Count; i++)
                 {
                     if (templist.Count == i) break;
-                    UpdateSimilarityScore(GeometryCalculator.CalculateSimilarity(templist[i].Item2, LeftLines[i]));
+                    UpdateSimilarityScore(GeometryCalculator.CalculateSimilarity(templist[i].Item2, leftLines[i]));
                 }
             }
             else if (templist.Count > 1)
@@ -365,7 +365,7 @@ namespace SketchAssistantWPF
             programView.SetCanvasState("LeftCanvas", true);
             programView.SetCanvasState("RightCanvas", true);
 
-            LeftLines = lines;
+            leftLines = lines;
         }
 
         /// <summary>
@@ -485,13 +485,13 @@ namespace SketchAssistantWPF
         {
             if (Double.IsNaN(score))
             {
-                ImageSimilarity.Clear();
+                imageSimilarity.Clear();
                 programView.SetImageSimilarityText("");
             }
             else
             {
-                if (score >= 0 && score <= 1) ImageSimilarity.Add(score);
-                programView.SetImageSimilarityText((ImageSimilarity.Sum() / ImageSimilarity.Count).ToString());
+                if (score >= 0 && score <= 1) imageSimilarity.Add(score);
+                programView.SetImageSimilarityText((imageSimilarity.Sum() / imageSimilarity.Count).ToString());
             }
         }
 

+ 6 - 6
SketchAssistant/SketchAssistantWPF/MainWindow.xaml.cs

@@ -103,7 +103,7 @@ namespace SketchAssistantWPF
         /// <summary>
         /// Dictionary containing the overlay elements
         /// </summary>
-        public Dictionary<String, Shape> OverlayDictionary = new Dictionary<string, Shape>();
+        public Dictionary<String, Shape> overlayDictionary = new Dictionary<string, Shape>();
 
         /********************************************/
         /*** WINDOW SPECIFIC FUNCTIONS START HERE ***/
@@ -579,18 +579,18 @@ namespace SketchAssistantWPF
             StartPointOverlay.Height = markerRadius * 2; StartPointOverlay.Width = markerRadius * 2;
             StartPointOverlay.Fill = Brushes.Green;
             StartPointOverlay.Effect = effect;
-            OverlayDictionary.Add("startpoint", StartPointOverlay);
+            overlayDictionary.Add("startpoint", StartPointOverlay);
             //Endpoint of a line to be redrawn
             Ellipse EndPointOverlay = new Ellipse();
             EndPointOverlay.Height = markerRadius * 2; EndPointOverlay.Width = markerRadius * 2;
             EndPointOverlay.Fill = Brushes.Green;
             EndPointOverlay.Effect = effect;
-            OverlayDictionary.Add("endpoint", EndPointOverlay);
+            overlayDictionary.Add("endpoint", EndPointOverlay);
             //Pointer of the optitrack system
             Ellipse OptitrackMarker = new Ellipse(); OptitrackMarker.Height = 5; OptitrackMarker.Width = 5;
             OptitrackMarker.Fill = Brushes.LightGray;
             OptitrackMarker.Effect = effect;
-            OverlayDictionary.Add("optipoint", OptitrackMarker);
+            overlayDictionary.Add("optipoint", OptitrackMarker);
             //10 Dotted Lines for debugging (if more are needed simply extend the for-loop
             for (int x = 0; x < 10; x++)
             {
@@ -598,11 +598,11 @@ namespace SketchAssistantWPF
                 dotLine.Stroke = Brushes.Red;
                 dotLine.StrokeDashArray = new DoubleCollection { 2 + x, 2 + x };
                 dotLine.StrokeThickness = 1;
-                OverlayDictionary.Add("dotLine" + x.ToString(), dotLine);
+                overlayDictionary.Add("dotLine" + x.ToString(), dotLine);
             }
 
             //Common features of all overlay items
-            foreach (KeyValuePair<String, Shape> s in OverlayDictionary)
+            foreach (KeyValuePair<String, Shape> s in overlayDictionary)
             {
                 OverlayCanvas.Children.Add(s.Value);
                 s.Value.Opacity = 0.00001;

+ 1 - 1
SketchAssistant/SketchAssistantWPF/SketchAssistantWPF.csproj

@@ -101,7 +101,7 @@
       <SubType>Designer</SubType>
     </ApplicationDefinition>
     <Compile Include="ActionHistory.cs" />
-    <Compile Include="Armband.cs" />
+    <Compile Include="Wristband.cs" />
     <Compile Include="CustomCanvas.cs" />
     <Compile Include="DebugData.cs" />
     <Compile Include="FileImporter.cs" />

+ 7 - 1
SketchAssistant/SketchAssistantWPF/Armband.cs → SketchAssistant/SketchAssistantWPF/Wristband.cs

@@ -4,7 +4,7 @@ using System.Threading;
 
 namespace SketchAssistantWPF
 {
-    internal class Armband
+    internal class Wristband
     {
         //[StructLayout(LayoutKind.Sequential)]
         //public class BodyActuator
@@ -57,11 +57,17 @@ namespace SketchAssistantWPF
         //[DllImport("BodyActuator.dll", EntryPoint = "BodyActuator_actuate")]
         //static extern void pushForward(ref BodyActuator self, byte tactor, double intensity, ulong duration);
 
+        /// <summary>
+        /// Function to call when the wristband should push forwards.
+        /// </summary>
         internal void pushForward()
         {
             Console.WriteLine("FORWARD_PUSH");
         }
 
+        /// <summary>
+        /// Function to call when the wristband should push backwards.
+        /// </summary>
         internal void pushBackward()
         {
             Console.WriteLine("BACKWARD_PUSH");