Пример #1
0
 private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
 {
     CameraVisualization camera = (CameraVisualization)e.TagVisualization;
     switch (camera.VisualizedTag.Value)
     {
         case 0xC1:
             camera.CameraModel.Content = "KimY's Infuse";
             camera.myEllipse.Fill = SurfaceColors.Accent1Brush;
             break;
         case 0xC2:
             camera.CameraModel.Content = "Laptop";
             camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
             break;
         case 0xC3:
             camera.CameraModel.Content = "Laptop";
             camera.myEllipse.Fill = SurfaceColors.Accent3Brush;
             break;
         case 0xC4:
             camera.CameraModel.Content = "Fabrikam, Inc. JKL-78";
             camera.myEllipse.Fill = SurfaceColors.Accent4Brush;
             break;
         default:
             camera.CameraModel.Content = "UNKNOWN MODEL";
             camera.myEllipse.Fill = SurfaceColors.ControlAccentBrush;
             break;
     }
 }
Пример #2
0
        //======================================================================
        //                       TagVisualizer Functions
        //======================================================================

        // When tag is detected
        private void UrbanTagVisualizer_VisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            if (canPlaceRoad)
            {
                return;
            }
            tagDetected = true;
            TagVisualization1 objectTag = (TagVisualization1)e.TagVisualization;

            switch (objectTag.VisualizedTag.Value)
            {
            case 0:
                objectTag.HouseModel.Content = "HOUSE ADDED";
                objectTag.myHouse.Fill       = SurfaceColors.Accent1Brush;
                break;

            case 1:
                objectTag.HouseModel.Content = "BUILDING ADDED";
                objectTag.myHouse.Fill       = SurfaceColors.Accent1Brush;
                break;

            case 2:
                objectTag.HouseModel.Content = "SKYSCRAPER ADDED";
                objectTag.myHouse.Fill       = SurfaceColors.Accent1Brush;
                break;

            default:
                objectTag.HouseModel.Content = "UNKNOWN MODEL";
                objectTag.myHouse.Fill       = SurfaceColors.Accent1Brush;
                break;
            }
        }
Пример #3
0
        private void TagVisualizerIpad_VisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            if (e.TagVisualization.TrackedContact == null)
                return;

            //Left Tag
            if (e.TagVisualization.TrackedContact.Tag.Identity.Value == 3)
            {
                MapPoint p1 = mysurfacemap.MySkyhunterCanvas.myMap.ScreenToMap(e.TagVisualization.Center);
                MapPoint lp1 = Skyhunter_Core.PointManipulation.CalculateLinePoint(p1);
                leftValue = Skyhunter_Core.PointManipulation.CalculateLinePercent(lp1);

                mysurfacemap.MySkyhunterCanvas.rightBubble.Anchor = lp1;
                mysurfacemap.MySkyhunterCanvas.rightBubble.IsOpen = true;
                mysurfacemap.MySkyhunterCanvas.rightBubble.Visibility = Visibility.Visible;

                Console.Out.WriteLine("leftValue : " + leftValue);
            }
            //Left Tag
            else if (e.TagVisualization.TrackedContact.Tag.Identity.Value == 1)
            {
                MapPoint p2 = mysurfacemap.Map.ScreenToMap(e.TagVisualization.Center);
                MapPoint lp2 = Skyhunter_Core.PointManipulation.CalculateLinePoint(p2);
                rightValue = Skyhunter_Core.PointManipulation.CalculateLinePercent(lp2);

                mysurfacemap.MySkyhunterCanvas.leftBubble.Anchor = lp2;
                mysurfacemap.MySkyhunterCanvas.leftBubble.IsOpen = true;
                mysurfacemap.MySkyhunterCanvas.leftBubble.Visibility = Visibility.Visible;

                Console.Out.WriteLine("rightValue : " + rightValue);
            }
        }
Пример #4
0
        // Region concerning visualizing the phone.
        #region
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            PhoneVisualization camera = (PhoneVisualization)e.TagVisualization;

            switch (camera.VisualizedTag.Value)
            {
            case 1:
                camera.PhoneModel.Content = "SG2, Simmi";
                //camera.myEllipse.Fill = SurfaceColors.Accent1Brush;
                camera.image1.Source = new BitmapImage(new Uri("/MandatoryAssignmentSurface;component/Resources/galaxys2.jpg", UriKind.Relative));
                if (!simmiWorker.IsBusy)
                {
                    simmiWorker.RunWorkerAsync();
                }
                //camera.myImage.Source = galaxy
                //fetchPhotosFromSpecifcUser("simmisj");
                break;

            case 2:
                camera.PhoneModel.Content = "Nexus Galaxy, Daniel";
                camera.image1.Source      = new BitmapImage(new Uri("/MandatoryAssignmentSurface;component/Resources/NexusOne.png", UriKind.Relative));
                //camera.myEllipse.Fill = SurfaceColors.Accent2Brush;

                if (!danielWorker.IsBusy)
                {
                    danielWorker.RunWorkerAsync();
                }
                break;

            default:
                camera.PhoneModel.Content = "UNKNOWN MODEL";
                //camera.myEllipse.Fill = SurfaceColors.ControlAccentBrush;
                break;
            }
        }
Пример #5
0
        private void MyTagVisualizer_VisualizationMoved(object sender, TagVisualizerEventArgs e)
        {
            CameraVisualization camera = (CameraVisualization)e.TagVisualization;
            Point rp = camera.TranslatePoint(new Point(0, 0), this);

            niceLine((int)rp.X, (int)rp.Y);
        }
Пример #6
0
        /// <summary>
        /// This function recognises tag, and gets relative x and y axis. It also gets orientation of the tag.
        /// </summary>
        /// <param name="sender">object sender</param>
        /// <param name="e">TagVisualizerEvent Arguments</param>
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            textBox.Clear();
            LynxTagVisualization tag = (LynxTagVisualization)e.TagVisualization;

            //     Console.WriteLine(tag.VisualizedTag.Value);
            orientation          = tag.Orientation;
            xAxisTag             = tag.Center.X;
            yAxisTag             = tag.Center.Y;
            xAxisSend            = xAxisTag - (flashDist + 10);
            yAxisSend            = yAxisTag + ((40 * 2.22));
            x1AxisRecieveUpdated = xAxisTag + (flashDist - 40);
            y1AxisRecieveUpdated = yAxisTag + ((26 * 2.22));

            Canvas.SetLeft(sPanel, xAxisSend);
            Canvas.SetTop(sPanel, yAxisSend);
            LynxRect.Height = 465;
            LynxRect.Width  = 240;

            LynxRect.Fill = Brushes.Black;
            Canvas.SetZIndex(LynxRect, -1);
            Canvas.SetLeft(LynxRect, xAxisTag - 120);
            Canvas.SetTop(LynxRect, yAxisTag - 70);
            canvas.Children.Add(LynxRect);
            //    Console.WriteLine(orientation);

            for (int i = 1; i < 9; i++)
            {
                drawboxes(x1AxisRecieveUpdated, y1AxisRecieveUpdated + (i * (18 * 2.22)), orientation);
            }
        }
Пример #7
0
        public Point calculPoint(TagVisualizerEventArgs e)
        {
            Point pt = e.TagVisualization.Center;

            pt.Y = pt.Y + 210;
            return(pt);
        }
Пример #8
0
        // erzeugt Tag-Bereich
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            CameraVisualization camera = (CameraVisualization)e.TagVisualization;

            camera.GRABIT.Content   = "Auflagefläche des Smartphones";
            camera.myRectangle.Fill = SurfaceColors.Accent1Brush;
        }
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            CamerVisualization camera = (CamerVisualization)e.TagVisualization;
            switch (camera.VisualizedTag.Value)
            {
                case 1:
                    camera.CameraModel.Content = "JOhn Snow";
                    camera.myEllipse.Fill = SurfaceColors.Accent1Brush;
                    break;

                case 2:
                    camera.CameraModel.Content = "Ned Snow, Games of thrones";
                    camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
                    break;

                case 3:
                    camera.CameraModel.Content = "Snow, Games of thrones";
                    camera.myEllipse.Fill = SurfaceColors.Accent3Brush;
                    break;

                case 4:
                    camera.CameraModel.Content = "Winter is coming, Games of thrones";
                    camera.myEllipse.Fill = SurfaceColors.Accent4Brush;
                    break;

                default:
                    camera.CameraModel.Content = "Winter soldier";
                    camera.myEllipse.Fill = SurfaceColors.ControlAccentBrush;
                    break;

            }
        }
Пример #10
0
        private void tVisualizer_VisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            String vncIp = vncAddress[e.TagVisualization.VisualizedTag.Byte.Value];

            (e.TagVisualization as PhoneVortexVisualization).VNCIP = vncIp;
            (e.TagVisualization as PhoneVortexVisualization).Connect();
        }
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            CamerVisualization camera = (CamerVisualization)e.TagVisualization;

            switch (camera.VisualizedTag.Value)
            {
            case 1:
                camera.CameraModel.Content = "JOhn Snow";
                camera.myEllipse.Fill      = SurfaceColors.Accent1Brush;
                break;

            case 2:
                camera.CameraModel.Content = "Ned Snow, Games of thrones";
                camera.myEllipse.Fill      = SurfaceColors.Accent2Brush;
                break;

            case 3:
                camera.CameraModel.Content = "Snow, Games of thrones";
                camera.myEllipse.Fill      = SurfaceColors.Accent3Brush;
                break;

            case 4:
                camera.CameraModel.Content = "Winter is coming, Games of thrones";
                camera.myEllipse.Fill      = SurfaceColors.Accent4Brush;
                break;

            default:
                camera.CameraModel.Content = "Winter soldier";
                camera.myEllipse.Fill      = SurfaceColors.ControlAccentBrush;
                break;
            }
        }
Пример #12
0
        private void TagVisualizerIpad_VisualizationRemoved(object sender, TagVisualizerEventArgs e)
        {
            mysurfacemap.MySkyhunterCanvas.rightBubble.Anchor = null;
            mysurfacemap.MySkyhunterCanvas.rightBubble.Visibility = Visibility.Hidden;
            mysurfacemap.MySkyhunterCanvas.rightBubble.IsOpen = false;

            mysurfacemap.MySkyhunterCanvas.leftBubble.Anchor = null;
            mysurfacemap.MySkyhunterCanvas.leftBubble.Visibility = Visibility.Hidden;
            mysurfacemap.MySkyhunterCanvas.leftBubble.IsOpen = false;

            if (e.TagVisualization.TrackedContact == null)
                return;

            if (e.TagVisualization.TrackedContact.Tag.Identity.Value == 3 || e.TagVisualization.TrackedContact.Tag.Identity.Value == 1)
            {
                leftValue = null;
                rightValue = null;

                mysurfacemap.MySkyhunterCanvas.rightBubble.Anchor = null;
                mysurfacemap.MySkyhunterCanvas.rightBubble.Visibility = Visibility.Hidden;

                mysurfacemap.MySkyhunterCanvas.leftBubble.Anchor = null;
                mysurfacemap.MySkyhunterCanvas.leftBubble.Visibility = Visibility.Hidden;

            }
        }
Пример #13
0
        public void OnVisualizationRemoved(object sender, TagVisualizerEventArgs e)
        {
            nbMinTagToSwitch--;
            long value = e.TagVisualization.VisualizedTag.Value;

            tagList[value].setPut(false);
            tagList[value].setPosition(new Point());
            switch (value)
            {
            case MyResources.valueBrosse:
                borderAideBrosseDent.BorderBrush  = Brushes.Transparent;
                borderAideBrosseDent2.BorderBrush = Brushes.Transparent;
                removeObject(value);
                break;

            case MyResources.valueDenti:
                borderDentifrice.BorderBrush  = Brushes.Transparent;
                borderDentifrice2.BorderBrush = Brushes.Transparent;
                removeObject(value);
                break;

            case MyResources.valueVerre:
                borderVerre.BorderBrush  = Brushes.Transparent;
                borderVerre2.BorderBrush = Brushes.Transparent;
                removeObject(value);
                break;

            default:
                removeAction(value);
                break;
            }
        }
Пример #14
0
        private void OnVisualizationMoved(object sender, TagVisualizerEventArgs e)
        {
            LynxTagVisualization tag = (LynxTagVisualization)e.TagVisualization;

            orientation          = tag.Orientation;
            xAxisTag             = tag.Center.X;
            yAxisTag             = tag.Center.Y;
            xAxisSend            = xAxisTag - (flashDist + 10);
            yAxisSend            = yAxisTag + ((40 * 2.22));
            x1AxisRecieveUpdated = xAxisTag + (flashDist - 40);
            y1AxisRecieveUpdated = yAxisTag + ((26 * 2.22));

            LynxRect.Fill = Brushes.Black;
            Canvas.SetLeft(LynxRect, xAxisTag - 120);
            Canvas.SetTop(LynxRect, yAxisTag - 70);

            int intTotalChildren = myGrid.Children.Count - 1;

            for (int intCounter = intTotalChildren; intCounter >= 0; intCounter--)
            {
                if (myGrid.Children[intCounter].GetType() == typeof(Line))
                {
                    Line ucCurrentChild = (Line)myGrid.Children[intCounter];
                    myGrid.Children.Remove(ucCurrentChild);
                }
            }
            Canvas.SetLeft(sPanel, xAxisSend);
            Canvas.SetTop(sPanel, yAxisSend);
            temp.Clear();
            temp1.Clear();
            for (int i = 1; i < 9; i++)
            {
                drawboxes(x1AxisRecieveUpdated, y1AxisRecieveUpdated + (i * (18 * 2.22)), orientation);
            }
        }
Пример #15
0
        public void putActionOnBot(object sender, TagVisualizerEventArgs e)
        {
            lastVideoBot = e.TagVisualization.VisualizedTag.Value;

            if (tagList[lastVideoBot].GetType() == typeof(Action))
            {
                startVideoBot(sender, e);
            }
        }
Пример #16
0
        private void itemPutOnTable(object sender, TagVisualizerEventArgs e)
        {
            hideWheel();

            //Ajout de l'item dans la list
            foundObject();

            OnVisualizationAdded(sender, e);
        }
        /// <summary>
        /// Changes the position of Lynx Reciever screen on table upon lynx movement. This function is not used by software.
        /// </summary>
        /// <param name="sender">object sender</param>
        /// <param name="e">tag visualizer event arguements</param>
        private void onTagMoved(object sender, TagVisualizerEventArgs e)
        {
            TagVisualization tag = e.TagVisualization;

            lynx.heading    = tag.Orientation;
            lynx.tagX       = tag.Center.X;
            lynx.tagY       = tag.Center.Y;
            lynx.xSendFirst = lynx.tagX - (((18 * 2.22) + 39) + 10) + ((18 * 2.22) + 39); //X is for border of read send ranger
            lynx.ySendFirst = lynx.tagY + ((40 * 2.22));
            lynx.xRecFirst  = lynx.tagX + (((18 * 2.22) + 39) - 40) - (18 * 2.22);
            lynx.yRecFirst  = lynx.tagY + ((26 * 2.22));
        }
Пример #18
0
        // erzeugt Tag-Bereich
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            this.auto.setStatus(true);

            CameraVisualization camera = (CameraVisualization)e.TagVisualization;

            camera.GRABIT.Content   = "Das Smartphone wurde erkannt";
            camera.myRectangle.Fill = SurfaceColors.Accent1Brush;
            camera.setAuto(this.getAuto());

            MongoDB.mongoDBconnection(this.auto);
        }
Пример #19
0
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            switch (e.TagVisualization.VisualizedTag.Value)
            {
            case 1: borderAideBrosseDent.BorderBrush = Brushes.Green; borderAideBrosseDent2.BorderBrush = Brushes.Green; brosseadentBool = true; valideObjet(); break;

            case 2: borderDentifrice.BorderBrush = Brushes.Green; borderDentifrice2.BorderBrush = Brushes.Green; borderDentifrice.Visibility = Visibility.Visible; dentifriceBool = true; valideObjet(); break;

            case 3: borderVerre.BorderBrush = Brushes.Green; borderVerre2.BorderBrush = Brushes.Green; borderVerre.Visibility = Visibility.Visible; verreBool = true; valideObjet(); break;

            default: break;
            }
        }
Пример #20
0
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            UserVisualization user = (UserVisualization)e.TagVisualization;

            if (user.VisualizedTag.Value > 0)
            {
                surfacelogin newuser = new surfacelogin(Convert.ToString(user.VisualizedTag.Value));


                user.Username.Content = "Welcome" + newuser.CurrentUser;
                user.myEllipse.Fill   = SurfaceColors.Accent2Brush;
            }
        }
Пример #21
0
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            nbMinTagToSwitch++;

            long  value = e.TagVisualization.VisualizedTag.Value;
            Point pt    = calculPoint(e);

            if (!tagList.ContainsKey(value))
            {
                if (value == MyResources.valueBrosse || value == MyResources.valueDenti || value == MyResources.valueVerre)
                {
                    tagList.Add(value, new Item(value, pt));
                }
                else
                {
                    tagList.Add(value, new Action(value, pt));
                }
                association(value);
            }

            tagList[value].setPutInFrise(false);
            tagList[value].setPosition(pt);
            tagList[value].setPut(true);

            switch (value)
            {
            case MyResources.valueBrosse:
                borderAideBrosseDent.BorderBrush = borderAideBrosseDent2.BorderBrush = colorValidationObjects;
                addLineWithObjects(value);
                hideHelp();
                break;

            case MyResources.valueDenti:
                borderDentifrice.BorderBrush = borderDentifrice2.BorderBrush = colorValidationObjects;
                addLineWithObjects(value);
                hideHelp();
                break;

            case MyResources.valueVerre:
                borderVerre.BorderBrush = borderVerre2.BorderBrush = colorValidationObjects;
                addLineWithObjects(value);
                hideHelp();
                break;

            default:
                addLineWithActions(value);
                break;
            }
            // if (nbMinTagToSwitch == nbTag)
            // switchViewOrdonnancement();
        }
Пример #22
0
        // When tag is removed, make scatterviewitem from last location
        private void UrbanTagVisualizer_VisualizationRemoved(object sender, TagVisualizerEventArgs e)
        {
            if (canPlaceRoad)
            {
                return;
            }
            tagDetected = false;
            TagVisualization1 objectTag = (TagVisualization1)e.TagVisualization;

            switch (objectTag.VisualizedTag.Value)
            {
            // house
            case 0:
                Point           p    = objectTag.Center;
                ScatterViewItem item = SetSVHouseImage("HouseEMI");
                item.Center      = p;
                item.Orientation = objectTag.Orientation;
                MainScatterview.Items.Add(item);
                history.Push(item);
                userPlacedHouses.Add(item);
                break;

            // building
            case 1:
                p                = objectTag.Center;
                item             = SetSVHouseImage("BuildingEMI");
                item.Center      = p;
                item.Orientation = objectTag.Orientation;;
                MainScatterview.Items.Add(item);
                history.Push(item);
                userPlacedHouses.Add(item);
                break;

            // skyscraper
            case 2:
                p                = objectTag.Center;
                item             = SetSVHouseImage("SkyscraperEMI");
                item.Center      = p;
                item.Orientation = objectTag.Orientation;;
                MainScatterview.Items.Add(item);
                history.Push(item);
                userPlacedHouses.Add(item);
                break;

            default:
                break;
            }
        }
Пример #23
0
        /// <summary>
        /// Destroys the transfer screen on removal of the lynx device.
        /// </summary>
        /// <param name="sender">sender object</param>
        /// <param name="e">Tag Visualizer Event</param>
        private void OnVisualizationRemoved(object sender, TagVisualizerEventArgs e)
        {
            canvas.Children.Remove(LynxRect);
            int intTotalChildren = myGrid.Children.Count - 1;

            for (int intCounter = intTotalChildren; intCounter >= 0; intCounter--)
            {
                if (myGrid.Children[intCounter].GetType() == typeof(Line))
                {
                    Line ucCurrentChild = (Line)myGrid.Children[intCounter];
                    myGrid.Children.Remove(ucCurrentChild);
                }
            }

            ClearCards();
        }
        /// <summary>
        /// This function recognises tag, and gets relative x and y axis. It also gets orientation of the tag. This function is not used by software.
        /// </summary>
        /// <param name="sender">object sender</param>
        /// <param name="e">tag visualizer event arguements</param>
        private void onTagAdded(object sender, TagVisualizerEventArgs e)
        {
            TagVisualization tag = e.TagVisualization;

            //     Console.WriteLine(tag.VisualizedTag.Value);
            lynx.heading = tag.Orientation;
            lynx.tagX    = tag.Center.X;
            lynx.tagY    = tag.Center.Y;

            lynx.xRecFirst  = lynx.tagX + 32;
            lynx.yRecFirst  = lynx.tagY + 99;
            lynx.xSendFirst = lynx.xRecFirst - (52 * 2.22); //X is for border of read send ranger
            lynx.ySendFirst = lynx.tagY + 99;

            LynxAvailable = true;
        }
Пример #25
0
        private void tagAddedFrieze(object sender, TagVisualizerEventArgs e)
        {
            long value = e.TagVisualization.VisualizedTag.Value;

            if (!tagList.ContainsKey(value))
            {
                Action action = new Action(value, new Point());
                tagList.Add(value, action);
                action.setPutInFrise(true);
                association(value);
            }


            tagList[value].setPut(true);

            if (tagList[value].GetType() == typeof(Action))
            {
                nbMinTagToSwitch++;
                Action action    = (Action)tagList[value];
                string tagChoose = ((TagVisualizer)sender).Name; //Choper le name de la frieze
                action.setPutInFrise(true);
                Console.WriteLine("TRUE");
                try
                {
                    if (linksFrieze[action.getValue()].Item1 == tagChoose || linksFrieze[action.getValue()].Item2 == tagChoose)
                    {
                        action.setPutInRightCase(true);
                        linksBorder[tagChoose].BorderBrush = colorValidationObjects;
                    }
                    else
                    {
                        action.setPutInRightCase(false);
                        linksBorder[tagChoose].BorderBrush = colorInValidationObjects;
                    }
                    friezesCompletes();
                }
                catch (System.Collections.Generic.KeyNotFoundException err)
                {
                    Console.WriteLine("Erreur : " + err);
                }
            }
            else
            {
                ((Item)tagList[value]).setPutInFrise(true);
            }
        }
Пример #26
0
        private void tagRemovedFrieze(object sender, TagVisualizerEventArgs e)
        {
            long value = e.TagVisualization.VisualizedTag.Value;

            if (tagList.ContainsKey(value))
            {
                if (tagList[value].GetType() == typeof(Action))
                {
                    nbMinTagToSwitch--;
                    Action action = (Action)tagList[value];//On choppe l'action
                    action.setPutInFrise(false);
                    action.setPut(false);
                    Console.WriteLine("FALSE");
                    action.setPutInRightCase(false);
                    linksBorder[((TagVisualizer)sender).Name].BorderBrush = Brushes.Transparent;
                }
            }
        }
        private void Visualizer_VisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            pinned[e.TagVisualization.VisualizedTag.Value] = false;
            PhoneThumbVisualization ptv = null;

            foreach (PhoneThumbVisualization i in Thumbs)
            {
                if (i.TagValue == e.TagVisualization.VisualizedTag.Value)
                {
                    ptv = i;
                }
            }
            if (ptv == null)
            {
                PhoneThumbVisualization newPtv = new PhoneThumbVisualization(e.TagVisualization.VisualizedTag.Value);
                scw.Dispatcher.Invoke(new Action(() => Thumbs.Add(newPtv)));
            }
        }
Пример #28
0
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            String tag = e.TagVisualization.VisualizedTag.Value.ToString();

            if (tag.Equals("9"))
            {
                InfoLabel.Content = "Showing videos";
                foreach (MediaData item in SurfaceListBoxPhotos)
                {
                    item.Visibility             = Visibility.Hidden;
                    surfaceListBox1.ItemsSource = SurfaceListBoxVideos;
                }
            }
            else if (tag.Equals("8"))   //default
            {
                InfoLabel.Content = "Showing photos";

                surfaceListBox1.ItemsSource = SurfaceListBoxPhotos;
            }
        }
Пример #29
0
        /// <summary>
        /// This function recognises tag, and gets relative x and y axis. It also gets orientation of the tag.
        /// </summary>
        /// <param name="sender">object sender</param>
        /// <param name="e">TagVisualizerEvent Arguments</param>
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            welcomeFlag = true;
            if (welcomeFlag)
            {
                canvas.Background = new ImageBrush()
                {
                    ImageSource = new BitmapImage((new Uri(@"C:\background.jpg", UriKind.Absolute)))
                };
                myGrid.Children.Remove(loadingImg);
            }
            textBox.Clear();

            LynxTagVisualization tag = (LynxTagVisualization)e.TagVisualization;

            orientation          = tag.Orientation;
            xAxisTag             = tag.Center.X;
            yAxisTag             = tag.Center.Y;
            xAxisSend            = xAxisTag - (flashDist + 10);
            yAxisSend            = yAxisTag + ((40 * 2.22));
            x1AxisRecieveUpdated = xAxisTag + (flashDist - 40);
            y1AxisRecieveUpdated = yAxisTag + ((26 * 2.22));

            Canvas.SetLeft(sPanel, xAxisSend);
            Canvas.SetTop(sPanel, yAxisSend);
            LynxRect.Height = 465;
            LynxRect.Width  = 240;

            LynxRect.Fill = Brushes.Black;
            Canvas.SetZIndex(LynxRect, -1);
            Canvas.SetLeft(LynxRect, xAxisTag - 120);
            Canvas.SetTop(LynxRect, yAxisTag - 70);
            canvas.Children.Add(LynxRect);

            for (int i = 1; i < 9; i++)
            {
                drawboxes(x1AxisRecieveUpdated, y1AxisRecieveUpdated + (i * (18 * 2.22)), orientation);
            }

            Init();
        }
Пример #30
0
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            Point p = e.TagVisualization.Center;

            Point t = new Point(p.X, p.Y + 210);

            try
            {
                switch (e.TagVisualization.VisualizedTag.Value)
                {
                case 0x01: createImageBrosse(t); borderAideBrosseDent.BorderBrush = Brushes.LightGreen; borderAideBrosseDent2.BorderBrush = Brushes.LightGreen; brosseadentBool = true; valideObjet(); break;

                case 0x20: createImageDentifrice(t); borderDentifrice.BorderBrush = Brushes.LightGreen; borderDentifrice2.BorderBrush = Brushes.LightGreen; borderDentifrice.Visibility = Visibility.Visible; dentifriceBool = true; valideObjet(); break;

                case 0xC5: createImageVerre(t); borderVerre.BorderBrush = Brushes.LightGreen; borderVerre2.BorderBrush = Brushes.LightGreen; borderVerre.Visibility = Visibility.Visible; verreBool = true; valideObjet(); break;

                default: break;
                }
            }
            catch (System.Exception ex) { Trace.WriteLine("exeption " + ex); }
        }
 private void Visualizer_VisualizationRemoved(object sender, TagVisualizerEventArgs e)
 {
     if (pinned.ContainsKey(e.TagVisualization.VisualizedTag.Value))
     {
         if (!pinned[e.TagVisualization.VisualizedTag.Value])
         {
             PhoneThumbVisualization ptv = null;
             foreach (PhoneThumbVisualization i in Thumbs)
             {
                 if (i.TagValue == e.TagVisualization.VisualizedTag.Value)
                 {
                     ptv = i;
                 }
             }
             if (ptv != null)
             {
                 Thumbs.Remove(ptv);
             }
         }
     }
 }
Пример #32
0
        private void OnVisualizationRemoved(object sender, TagVisualizerEventArgs e)
        {
            canvas.Children.Remove(LynxRect);
            int intTotalChildren = myGrid.Children.Count - 1;

            for (int intCounter = intTotalChildren; intCounter >= 0; intCounter--)
            {
                if (myGrid.Children[intCounter].GetType() == typeof(Line))
                {
                    Line ucCurrentChild = (Line)myGrid.Children[intCounter];
                    myGrid.Children.Remove(ucCurrentChild);
                }
            }


            string transferredData = "";

            if (AllPoints.Count > 0)
            {
                List <TouchPoint> letterList = new List <TouchPoint>();
                letterList.Add(AllPoints[0]);
                for (int i = 1; i < AllPoints.Count; i++)
                {
                    if (AllPoints[i].Position.Y < AllPoints[i - 1].Position.Y)
                    {
                        transferredData = transferredData + constructBin(letterList);
                        letterList.Clear();
                    }
                    letterList.Add(AllPoints[i]);
                }
                transferredData = transferredData + constructBin(letterList);
                Console.WriteLine(transferredData);
                textBox.Text    = transferredData;
                transferredData = "";
                AllPoints.Clear();
                letterList.Clear();
                temp.Clear();
                temp1.Clear();
            }
        }
Пример #33
0
        private void MyTagVisualizer_VisualizationRemoved(object sender, TagVisualizerEventArgs e)
        {
            CameraVisualization camera = (CameraVisualization)e.TagVisualization;

            switch (camera.VisualizedTag.Value)
            {
            case 1:
                aufTisch[1] = false;
                break;

            case 2:
                aufTisch[2] = false;
                break;

            case 3:
                //camera.CameraModel.Content = "Olivenöl";
                break;

            case 4:
                //camera.CameraModel.Content = "Frisches Basilikum";
                break;

            case 5:
                //camera.CameraModel.Content = "Creme Fraiche";
                break;

            default:
                //camera.CameraModel.Content = "Unbekannte Zutat";
                break;
            }
            foreach (UIElement ue in asd.Children)
            {
                if (ue.Uid == "penis")
                {
                    asd.Children.Remove(ue);
                    break;
                }
            }
        }
Пример #34
0
        private void OnvisualMoved(object sender, TagVisualizerEventArgs e)
        {
            Point p = e.TagVisualization.Center;
            Point t = new Point(p.X, p.Y + 210);

            try
            {
                switch (e.TagVisualization.VisualizedTag.Value)
                {
                case 0x01: moveImageBrosse(t); borderAideBrosseDent.BorderBrush = Brushes.LightGreen; borderAideBrosseDent2.BorderBrush = Brushes.LightGreen; break;

                case 0x20: moveImageDentifrice(t); borderDentifrice.BorderBrush = Brushes.LightGreen; borderDentifrice2.BorderBrush = Brushes.LightGreen; break;

                case 0xC5: moveImageVerre(t); borderVerre.BorderBrush = Brushes.LightGreen; borderVerre2.BorderBrush = Brushes.LightGreen; break;

                default: break;
                }
            }
            catch (System.Exception ex)
            {
                Trace.WriteLine("exeption " + ex);
            }
        }
 // When tag is removed, make scatterviewitem from last location
 private void UrbanTagVisualizer_VisualizationRemoved(object sender, TagVisualizerEventArgs e)
 {
     if (canPlaceRoad)
     {
         return;
     }
     tagDetected = false;
     TagVisualization1 objectTag = (TagVisualization1)e.TagVisualization;
     switch (objectTag.VisualizedTag.Value)
     {
         // house
         case 0:
             Point p = objectTag.Center;
             ScatterViewItem item = SetSVHouseImage("HouseEMI");
             item.Center = p;
             item.Orientation = objectTag.Orientation;
             MainScatterview.Items.Add(item);
             history.Push(item);
             userPlacedHouses.Add(item);
             break;
         // building
         case 1:
             p = objectTag.Center;
             item = SetSVHouseImage("BuildingEMI");
             item.Center = p;
             item.Orientation = objectTag.Orientation;;
             MainScatterview.Items.Add(item);
             history.Push(item);
             userPlacedHouses.Add(item);
             break;
         // skyscraper
         case 2:
             p = objectTag.Center;
             item = SetSVHouseImage("SkyscraperEMI");
             item.Center = p;
             item.Orientation = objectTag.Orientation;;
             MainScatterview.Items.Add(item);
             history.Push(item);
             userPlacedHouses.Add(item);
             break;
         default:
             break;
     }
 }
        /// <summary>
        /// This is called when a tag is removed from the SurfaceWindow
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnPlaneVisualizationRemoved(object sender, TagVisualizerEventArgs e)
        {
            PlaneTagVisualization camera = (PlaneTagVisualization)e.TagVisualization;

            if (planes.ContainsKey(camera.VisualizedTag.Value))
            {
                // Remove the plane from the 3D Environment
                behaviour.Remove(planes[camera.VisualizedTag.Value]);

                // Remove the plane from the dictionary
                planes.Remove(camera.VisualizedTag.Value);
            }
        }
Пример #37
0
        private void Visualizer_VisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            if (lblStart.Visibility == System.Windows.Visibility.Visible)
                lblStart.Visibility = System.Windows.Visibility.Hidden;

            if (!_lockedTags.Contains(e.TagVisualization.VisualizedTag.Value.ToString()))
            {
                if (Visualizer.ActiveVisualizations.Count > 0 && _pairedManager == null)
                {
                    SetDeskState(ActivityDesk.DeskState.Active);
                }
            }
            else
            {
                _documentContainer.RemoveDevice(e.TagVisualization.VisualizedTag.Value.ToString());
            }
            ((BaseVisualization)e.TagVisualization).Locked += new LockedEventHandler(Desk_Locked);
            RunDiscovery();
        }
        private void OnVisualizationRemoved(object sender, TagVisualizerEventArgs e)
        {
            TagVisualization1 camera = (TagVisualization1)e.TagVisualization;
            Point centreTag = camera.Center;
            int index = 0;
            int[] tab = new int[2];
            tab[0] = (int)Math.Floor(centreTag.X / 213.3);
            tab[1] = (int)Math.Floor(centreTag.Y / 216);
            //Console.WriteLine("i = " + i + "j= " + j);
            if (!(tab[0] == 8 && tab[1] == 4))
            {
                if (!(tab[0] == 7 && tab[1] == 4))
                {
                    if (!(tab[0] == 6 && tab[1] == 4))
                    {
                        for (int i = 0; i < BlackList.Count; i++)
                        {
                            if (((BlackList.ElementAt(i)[0] != tab[0]) && (BlackList.ElementAt(i)[1] != tab[1])) || ((BlackList.ElementAt(i)[0] == tab[0]) && (BlackList.ElementAt(i)[1] != tab[1])) ||
                                 ((BlackList.ElementAt(i)[0] != tab[0]) && (BlackList.ElementAt(i)[1] == tab[1])))
                            {
                                //Console.WriteLine("BlackList : " + BlackList.ElementAt(i)[0] + "," + BlackList.ElementAt(i)[1] + " et tab :" + tab[0] + "," + tab[1]);
                                index++;
                            }
                        }

                        if (index == BlackList.Count)
                        {
                            tags.Remove(camera.VisualizedTag.Value);
                            cells[tab[0], tab[1]].Fill = new SolidColorBrush(Colors.DarkSlateGray);
                        }
                    }
                }
            }

        }
Пример #39
0
 // Added
 void tagVis_VisualizationAdded(object sender, TagVisualizerEventArgs e)
 {
     // Adding the PieceVisulaization both helps identify squares with the objects AND makes it easier for the screen to see.
     PieceVisualization pv = (PieceVisualization)e.TagVisualization;
     pv.TagBase.Fill = Brushes.DarkTurquoise;
     //Console.WriteLine(pv.VisualizedTag.Value);
     Console.WriteLine("Tag in square " + name);
 }
Пример #40
0
 /// <summary>
 /// Here when a visualization is removed from a visualizer.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void OnRemoveVisualization(object sender, TagVisualizerEventArgs e)
 {
     TagVisualization visualization = e.TagVisualization;
     Debug.Assert(visualization != null);
     Debug.Assert(visualizationChains.ContainsKey(visualization));
     AncestryChain chain = visualizationChains[visualization];
     Debug.Assert(chain != null);
     OnVisualizationsLeave(chain, visualization);
 }
        private void OnVisualizationMoved(object sender, TagVisualizerEventArgs e)
        {
            TagVisualization1 camera = (TagVisualization1)e.TagVisualization;
            Point centreTag = camera.Center;
            int[] tab = new int[2];
            tab[0] = (int)Math.Floor(centreTag.X / 213.3);
            tab[1] = (int)Math.Floor(centreTag.Y / 216);
            int index = 0;


            for (int i = 0; i < BlackList.Count; i++)
            {
                if (((BlackList.ElementAt(i)[0] != tab[0]) && (BlackList.ElementAt(i)[1] != tab[1])) || ((BlackList.ElementAt(i)[0] == tab[0]) && (BlackList.ElementAt(i)[1] != tab[1])) ||
                     ((BlackList.ElementAt(i)[0] != tab[0]) && (BlackList.ElementAt(i)[1] == tab[1])))
                {
                    
                    index++;
                }
            }


            if (index == BlackList.Count)
            {
           
                if (tags.ContainsKey(camera.VisualizedTag.Value))
                {

                    if (tags[camera.VisualizedTag.Value][0] != tab[0] || tags[camera.VisualizedTag.Value][1] != tab[1])
                    {
                        cells[tab[0], tab[1]].Fill = new SolidColorBrush(Colors.Green);

                        cells[tags[camera.VisualizedTag.Value][0], tags[camera.VisualizedTag.Value][1]].Fill = new SolidColorBrush(Colors.DarkSlateGray);

                        tags[camera.VisualizedTag.Value][0] = tab[0];
                        tags[camera.VisualizedTag.Value][1] = tab[1];

                    }
                }

            }
            else
            {

                if (tags.ContainsKey(camera.VisualizedTag.Value))
                {

                    if (tags[camera.VisualizedTag.Value][0] != tab[0] || tags[camera.VisualizedTag.Value][1] != tab[1])
                    {

                        cells[tags[camera.VisualizedTag.Value][0], tags[camera.VisualizedTag.Value][1]].Fill = new SolidColorBrush(Colors.DarkSlateGray);
                        tags.Remove(camera.VisualizedTag.Value);
                    }

                    
                }

            }

        }
 private void TagVisualizer_VisualizationAdded(object sender, TagVisualizerEventArgs e)
 {
     ((TagVisualization1)e.TagVisualization).ExecuteMethod += new EventHandler(LoadTweets);
 }
Пример #43
0
 void UcSensiconMoved(object sender, TagVisualizerEventArgs e)
 {
 }
        private void OnVisualizationAddedd(object sender, TagVisualizerEventArgs e)
        {
            //object gestion fonction to change the game checks <=> dame
            CameraVisualization camera = (CameraVisualization)e.TagVisualization;
            Rectangle rect = (Rectangle)FindName("rectangleDroite");
            Rectangle rect1 = (Rectangle)FindName("rectangleBas");
            Microsoft.Surface.Presentation.Controls.TagVisualizer tagV = (Microsoft.Surface.Presentation.Controls.TagVisualizer)FindName("MyTagVisualizer");

            switch (camera.VisualizedTag.Value)
            {
                default:
                    if (echec) {
                        rect.Visibility = Visibility.Hidden;
                        rect1.Visibility = Visibility.Hidden;
                        tagV.Width = 900;
                        tagV.Height = 900;
                        echec = !echec;
                    } 
                    else {
                        rect.Visibility = Visibility.Visible;
                        rect1.Visibility = Visibility.Visible;
                        tagV.Width = 720;
                        tagV.Height = 720;
                        echec = !echec;
                    }

                    break;
            }
        }
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            //object gestion on the checker board
            CameraVisualization camera = (CameraVisualization)e.TagVisualization;
            Point centreTag = camera.Center;
            if (!echec) {
                switch (camera.VisualizedTag.Value)
                {   
                    
                    case 1 :
                        Color color;
                        if (camera.Orientation >= 0.0f && camera.Orientation < 180.0f)
                        {
                            camera.CameraModel.Content = "Dame blanche";
                            camera.myEllipse.Fill = SurfaceColors.Accent4Brush;
                            color = System.Windows.Media.Colors.DarkMagenta;
                        }
                        else
                        {   
                            camera.CameraModel.Content = "Dame noire";
                            camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
                            color = System.Windows.Media.Colors.Brown;
                        }
                        Boolean cont3 = true;
                        for (int i = 0; i < 10; i++)
                            {
                                if (!cont3)
                                    break;
                                for (int j = 0; j < 10; j++)
                                {
                                    Rectangle sq = squares[i][j];
                                    double left = Canvas.GetLeft(sq);
                                    double top = Canvas.GetTop(sq);
                                    if (left <= (centreTag.X) && (centreTag.X) <= (left + 90) && top <= centreTag.Y && (top + 90) >= centreTag.Y)
                                    {
                                        if (i != 9 && j != 0)
                                            squares[i + 1][j - 1].Fill = new SolidColorBrush(color);
                                        if (i < 8 && j > 1)
                                            squares[i + 2][j - 2].Fill = new SolidColorBrush(color);
                                        if (i < 7 && j > 2)
                                            squares[i + 3][j - 3].Fill = new SolidColorBrush(color);
                                        if (i < 6 && j > 3)
                                            squares[i + 4][j - 4].Fill = new SolidColorBrush(color);
                                        if (i < 5 && j > 4)
                                            squares[i + 5][j - 5].Fill = new SolidColorBrush(color);
                                        if (i < 4 && j > 5)
                                            squares[i + 6][j - 6].Fill = new SolidColorBrush(color);
                                        if (i < 3 && j > 6)
                                            squares[i + 7][j - 7].Fill = new SolidColorBrush(color);
                                        if (i < 2 && j > 7)
                                            squares[i + 8][j - 8].Fill = new SolidColorBrush(color);
                                        if (i < 1 && j > 8)
                                            squares[i + 9][j - 9].Fill = new SolidColorBrush(color);

                                        if (i != 9 && j != 9)
                                            squares[i + 1][j + 1].Fill = new SolidColorBrush(color);
                                        if (i < 8 && j < 8)
                                            squares[i + 2][j + 2].Fill = new SolidColorBrush(color);
                                        if (i < 7 && j < 7)
                                            squares[i + 3][j + 3].Fill = new SolidColorBrush(color);
                                        if (i < 6 && j < 6)
                                            squares[i + 4][j + 4].Fill = new SolidColorBrush(color);
                                        if (i < 5 && j < 5)
                                            squares[i + 5][j + 5].Fill = new SolidColorBrush(color);
                                        if (i < 4 && j < 4)
                                            squares[i + 6][j + 6].Fill = new SolidColorBrush(color);
                                        if (i < 3 && j < 3)
                                            squares[i + 7][j + 7].Fill = new SolidColorBrush(color);
                                        if (i < 2 && j < 2)
                                            squares[i + 8][j + 8].Fill = new SolidColorBrush(color);
                                        if (i < 1 && j < 1)
                                            squares[i + 9][j + 9].Fill = new SolidColorBrush(color);

                                        if (i != 0 && j != 0)
                                            squares[i - 1][j - 1].Fill = new SolidColorBrush(color);
                                        if (i > 1 && j > 1)
                                            squares[i - 2][j - 2].Fill = new SolidColorBrush(color);
                                        if (i > 2 && j > 2)
                                            squares[i - 3][j - 3].Fill = new SolidColorBrush(color);
                                        if (i > 3 && j > 3)
                                            squares[i - 4][j - 4].Fill = new SolidColorBrush(color);
                                        if (i > 4 && j > 4)
                                            squares[i - 5][j - 5].Fill = new SolidColorBrush(color);
                                        if (i > 5 && j > 5)
                                            squares[i - 6][j - 6].Fill = new SolidColorBrush(color);
                                        if (i > 6 && j > 6)
                                            squares[i - 7][j - 7].Fill = new SolidColorBrush(color);
                                        if (i > 7 && j > 7)
                                            squares[i - 8][j - 8].Fill = new SolidColorBrush(color);
                                        if (i > 8 && j > 8)
                                            squares[i - 9][j - 9].Fill = new SolidColorBrush(color);

                                        if (i != 0 && j != 9)
                                            squares[i - 1][j + 1].Fill = new SolidColorBrush(color);
                                        if (i > 1 && j < 8)
                                            squares[i - 2][j + 2].Fill = new SolidColorBrush(color);
                                        if (i > 2 && j < 7)
                                            squares[i - 3][j + 3].Fill = new SolidColorBrush(color);
                                        if (i > 3 && j < 6)
                                            squares[i - 4][j + 4].Fill = new SolidColorBrush(color);
                                        if (i > 4 && j < 5)
                                            squares[i - 5][j + 5].Fill = new SolidColorBrush(color);
                                        if (i > 5 && j < 4)
                                            squares[i - 6][j + 6].Fill = new SolidColorBrush(color);
                                        if (i > 6 && j < 3)
                                            squares[i - 7][j + 7].Fill = new SolidColorBrush(color);
                                        if (i > 7 && j < 2)
                                            squares[i - 8][j + 8].Fill = new SolidColorBrush(color);
                                        if (i > 8 && j < 1)
                                            squares[i - 9][j + 9].Fill = new SolidColorBrush(color);
                                        cont3 = false;
                                        break;
                                    }
                                }
                            }
                        break;
                    default:
                        if (camera.Orientation >= 0.0f && camera.Orientation < 180.0f)
                        {
                            camera.CameraModel.Content = "Pion noir";
                            camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
                            Boolean cont = true;
                            for (int i = 0; i < 10; i++)
                            {
                                if (!cont)
                                    break;
                                for (int j = 0; j < 10; j++)
                                {
                                    Rectangle sq = squares[i][j];
                                    double left = Canvas.GetLeft(sq);
                                    double top = Canvas.GetTop(sq);
                                    if (left <= (centreTag.X) && (centreTag.X) <= (left + 90) && top <= centreTag.Y && (top + 90) >= centreTag.Y)
                                    {
                                        Console.WriteLine(left.ToString() + "-" + top.ToString() + "-" + centreTag.X + "-" + centreTag.Y + "i" + i + "j" + j);
                                        if (i != 9 && j != 0)
                                            squares[i + 1][j - 1].Fill = new SolidColorBrush(System.Windows.Media.Colors.DarkMagenta);
                                        if (i != 9 && j != 9)
                                            squares[i + 1][j + 1].Fill = new SolidColorBrush(System.Windows.Media.Colors.DarkMagenta);
                                        cont = false;
                                        break;
                                    }
                                }
                            }
                           
                        }
                        else
                        {
                            camera.CameraModel.Content = "Pion blanc";
                            camera.myEllipse.Fill = SurfaceColors.Accent4Brush;
                            Boolean cont = true;
                            for (int i = 0; i < 10; i++)
                            {
                                if (!cont)
                                    break;
                                for (int j = 0; j < 10; j++)
                                {
                                    Rectangle sq = squares[i][j];
                                    double left = Canvas.GetLeft(sq);
                                    double top = Canvas.GetTop(sq);
                                    
                                    if (left <= (centreTag.X) && (centreTag.X) <= (left + 90) && top <= centreTag.Y && (top + 90) >= centreTag.Y)
                                    {
                                        Console.WriteLine(left.ToString() + "-" + top.ToString() + "-" + centreTag.X + "-" + centreTag.Y + "i" + i + "j" + j);
                                        if ( i != 0 && j != 0)
                                            squares[i - 1][j - 1].Fill = new SolidColorBrush(System.Windows.Media.Colors.Brown);
                                        if ( i !=0 && j != 9)
                                            squares[i - 1][j + 1].Fill = new SolidColorBrush(System.Windows.Media.Colors.Brown);
                                        cont = false;
                                        break;
                                    }
                                }
                            }
                        }
                        break;
                }
                
                return; 
            }
            switch (camera.VisualizedTag.Value)
            {
                case 1:
                    if (camera.Orientation >= 0.0f && camera.Orientation < 180.0f)
                    {
                        camera.CameraModel.Content = "Tour noire";
                        camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
                    }
                    else
                    {
                        camera.CameraModel.Content = "Tour blanche";
                        camera.myEllipse.Fill = SurfaceColors.Accent4Brush;
                    }
                    break;
                case 2:
                    if (camera.Orientation >= 0.0f && camera.Orientation < 180.0f)
                    {
                        camera.CameraModel.Content = "Fou noir";
                        camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
                    }
                    else
                    {
                        camera.CameraModel.Content = "Fou blanc";
                        camera.myEllipse.Fill = SurfaceColors.Accent4Brush;
                    }
                    break;
                case 3:
                    if (camera.Orientation >= 0.0f && camera.Orientation < 180.0f)
                    {
                        camera.CameraModel.Content = "Cavalier noir";
                        camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
                    }
                    else
                    {
                        camera.CameraModel.Content = "Cavalier blanc";
                        camera.myEllipse.Fill = SurfaceColors.Accent4Brush;
                    }
                    camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
                    break;
                case 4:
                    if (camera.Orientation >= 0.0f && camera.Orientation < 180.0f)
                    {
                        camera.CameraModel.Content = "Roi noir";
                        camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
                    }
                    else
                    {
                        camera.CameraModel.Content = "Roi blanc";
                        camera.myEllipse.Fill = SurfaceColors.Accent4Brush;
                    }

                    break;
                case 5:
                    if (camera.Orientation >= 0.0f && camera.Orientation < 180.0f)
                    {
                        camera.CameraModel.Content = "Renne noire";
                        camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
                    }
                    else
                    {
                        camera.CameraModel.Content = "Renne blanche";
                        camera.myEllipse.Fill = SurfaceColors.Accent4Brush;
                    }
                    break;
                case 6:
                    if (camera.Orientation >= 0.0f && camera.Orientation < 180.0f)
                    {
                        camera.CameraModel.Content = "Pion noir";
                        camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
                    }
                    else
                    {
                        camera.CameraModel.Content = "Pion blanche";
                        camera.myEllipse.Fill = SurfaceColors.Accent4Brush;
                    }
                    
                    break;
                default:
                    camera.CameraModel.Content = "rien";
                    camera.myEllipse.Fill = SurfaceColors.Accent2Brush;
                    break;
            }
        }
 private void OnVisualizationMoved(object sender, TagVisualizerEventArgs e) {
     
         CameraVisualization camera = (CameraVisualization)e.TagVisualization;
         Point centreTag = camera.Center;
         Boolean cont2 = true;
         for (int i = 0; i < 10; i++)
         {
             if (!cont2)
                 break;
             for (int j = 0; j < 10; j++)
             {
                 Rectangle sq = squares[i][j];
                 double left = Canvas.GetLeft(sq);
                 double top = Canvas.GetTop(sq);
                 if (left <= (centreTag.X) && (centreTag.X) <= (left + 90) && top <= centreTag.Y && (top + 90) >= centreTag.Y)
                 {
                     if ((left+20) <= (centreTag.X) && (centreTag.X) <= (left + 70) && (top+20) <= centreTag.Y && (top + 70) >= centreTag.Y)
                     { OnVisualizationAdded(sender, e); } 
                     else
                     { OnVisualizationRemoved(sender, e); }
                 }
             }
         }
         
    
 }
Пример #47
0
        private void Visualizer_VisualizationMoved(object sender, TagVisualizerEventArgs e)
        {

        }
Пример #48
0
        private void Visualizer_VisualizationRemoved(object sender, TagVisualizerEventArgs e)
        {
            if (!_lockedTags.Contains(e.TagVisualization.VisualizedTag.Value.ToString()))
            {
                Thread.Sleep(3000);
                if (Visualizer.ActiveVisualizations.Count == 0)
                {
                    SetDeskState(ActivityDesk.DeskState.Ready);
                    lblStart.Visibility = System.Windows.Visibility.Visible;
                }
                if (_pairedManager != null)
                {
                    _pairedManager.Close();
                    _pairedManager = null;
                }


                this.Dispatcher.Invoke(DispatcherPriority.Background, new System.Action(() =>
                {
                    //documentContainer.Clear();
                }));
            }
            else
                _documentContainer.AddDevice(new Device(){TagValue=e.TagVisualization.VisualizedTag.Value},e.TagVisualization.Center);

        }
Пример #49
0
 /// <summary>
 /// Here when it's time to add or synchronize the state of a visualization.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void OnSynchronizeVisualization(object sender, TagVisualizerEventArgs e)
 {
     SynchronizeVisualization((TagVisualizer)sender, e.TagVisualization);
 }
 private void TagVisualizer_VisualizationAdded(object sender, TagVisualizerEventArgs e)
 {
     ((TagVisualization1)e.TagVisualization).ExecuteSearch += new EventHandler(SurfaceWindow1_ExecuteSearch);
     ((TagVisualization1)e.TagVisualization).ExecuteClear += new EventHandler(SurfaceWindow1_ExecuteClear);
 }
Пример #51
0
 private void TagVisualizer_VisualizationAdded(object sender, TagVisualizerEventArgs e)
 {
     SendToIpad();
 }
Пример #52
0
 private void TagVisualizer_VisualizationAdded(object sender, TagVisualizerEventArgs e)
 {
     //Console.Out.WriteLine("Dropped id card value 0");
 }
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            TagVisualization1 camera = (TagVisualization1)e.TagVisualization;
            Point centreTag = camera.Center;
            int index = 0;
            int[] tab= new int[2];
            tab[0]= (int)Math.Floor(centreTag.X / 213.3);
            tab[1]= (int)Math.Floor(centreTag.Y / 216);

            if (!(tab[0] == 8 && tab[1] == 4))
            {
                if (!(tab[0] == 7 && tab[1] == 4))
                {
                    if (!(tab[0] == 6 && tab[1] == 4))
                    {
                        //Console.WriteLine("i = "+tab[0]+ "j= "+tab[1]);
                        for (int i = 0; i < BlackList.Count; i++)
                        {
                            //Console.WriteLine("BlackList : " + BlackList.ElementAt(i)[0] + "," + BlackList.ElementAt(i)[1]);
                            if (((BlackList.ElementAt(i)[0] != tab[0]) && (BlackList.ElementAt(i)[1] != tab[1])) || ((BlackList.ElementAt(i)[0] == tab[0]) && (BlackList.ElementAt(i)[1] != tab[1])) ||
                                ((BlackList.ElementAt(i)[0] != tab[0]) && (BlackList.ElementAt(i)[1] == tab[1])))
                            {


                                //Console.WriteLine("BlackList : " + BlackList.ElementAt(i)[0] + "," + BlackList.ElementAt(i)[1]+  " et tab :" + tab[0]+ "," +  tab[1]);
                                index++;

                            }
                        }

                        //Console.WriteLine("index : " + index);

                        if (index == BlackList.Count)
                        {

                            cells[tab[0], tab[1]].Fill = new SolidColorBrush(Colors.Green);

                            if (!tags.ContainsKey(camera.VisualizedTag.Value))
                            {
                                tags.Add(camera.VisualizedTag.Value, tab);
                            }
                            else
                                tags[camera.VisualizedTag.Value] = tab;
                        }
                    }
                }
            }
        }
 private void Visualizer_VisualizationRemoved(object sender, TagVisualizerEventArgs e)
 {
     if (pinned.ContainsKey(e.TagVisualization.VisualizedTag.Value))
     {
         if (!pinned[e.TagVisualization.VisualizedTag.Value])
         {
             PhoneThumbVisualization ptv = null;
             foreach (PhoneThumbVisualization i in Thumbs)
             {
                 if (i.TagValue == e.TagVisualization.VisualizedTag.Value)
                 {
                     ptv = i;
                 }
             }
             if (ptv != null)
             {
                 Thumbs.Remove(ptv);
             }
         }
     }
 }
        private void OnVisualizationMoved(object sender, TagVisualizerEventArgs e)
        {
            TagVisualization1 camera = (TagVisualization1)e.TagVisualization;
            Point centreTag = camera.Center;
            int[] tab = new int[2];
            tab[0] = (int)Math.Floor(centreTag.X / 213.3);
            tab[1] = (int)Math.Floor(centreTag.Y / 216);
            int index = 0;


            for (int i = 0; i < BlackList.Count; i++)
            {
                if (((BlackList.ElementAt(i)[0] != tab[0]) && (BlackList.ElementAt(i)[1] != tab[1])) || ((BlackList.ElementAt(i)[0] == tab[0]) && (BlackList.ElementAt(i)[1] != tab[1])) ||
                     ((BlackList.ElementAt(i)[0] != tab[0]) && (BlackList.ElementAt(i)[1] == tab[1])))
                {
                    //Console.WriteLine("BlackList : " + BlackList.ElementAt(i)[0] + "," + BlackList.ElementAt(i)[1] + " et tab :" + tab[0] + "," + tab[1]);
                    index++;
                }
            }


            if (index == BlackList.Count)
            {
                Console.WriteLine("Tab :" + tab[0] + "," + tab[1]);
                if (tags.ContainsKey(camera.VisualizedTag.Value))
                {
                    Console.WriteLine("Tags before : " + tags[camera.VisualizedTag.Value][0] + "," + tags[camera.VisualizedTag.Value][1]);
                    if (tags[camera.VisualizedTag.Value][0] != tab[0] || tags[camera.VisualizedTag.Value][1] != tab[1])
                    {
                        cells[tab[0], tab[1]].Fill = new SolidColorBrush(Colors.Green);

                        cells[tags[camera.VisualizedTag.Value][0], tags[camera.VisualizedTag.Value][1]].Fill = new SolidColorBrush(Colors.DarkSlateGray);

                        tags[camera.VisualizedTag.Value][0] = tab[0];
                        tags[camera.VisualizedTag.Value][1] = tab[1];
                        Console.WriteLine("Tags after : " + tags[camera.VisualizedTag.Value][0] + "," + tags[camera.VisualizedTag.Value][1]);
                    }
                }
                else {
                    //Console.WriteLine("Compteur :"+compteur);
                    //if (!compteur)
                    //{
                    //    Console.WriteLine("Test2 ");
                    //    cells[tab[0], tab[1]].Fill = new SolidColorBrush(Colors.Green);
                    //    compteur = true;
                    //}
                    //else
                    //{
                    //    compteur = false;
                    //}
                }

            }
            else
            {
                Console.WriteLine("Tab :" + tab[0] + "," + tab[1]);
                if (tags.ContainsKey(camera.VisualizedTag.Value))
                {

                    if (tags[camera.VisualizedTag.Value][0] != tab[0] || tags[camera.VisualizedTag.Value][1] != tab[1])
                    {

                        cells[tags[camera.VisualizedTag.Value][0], tags[camera.VisualizedTag.Value][1]].Fill = new SolidColorBrush(Colors.DarkSlateGray);
                        tags.Remove(camera.VisualizedTag.Value);
                    }

                    
                }

            }

        }
 private void Visualizer_VisualizationAdded(object sender, TagVisualizerEventArgs e)
 {
     pinned[e.TagVisualization.VisualizedTag.Value] = false;
     PhoneThumbVisualization ptv = null;
     foreach (PhoneThumbVisualization i in Thumbs)
     {
         if (i.TagValue == e.TagVisualization.VisualizedTag.Value)
         {
             ptv = i;
         }
     }
     if (ptv == null)
     {
         PhoneThumbVisualization newPtv = new PhoneThumbVisualization(e.TagVisualization.VisualizedTag.Value);
         scw.Dispatcher.Invoke(new Action(() => Thumbs.Add(newPtv)));
     }
 }
Пример #57
0
 /****
  * Tag Visualization add/remove events.
  * Happen when tags enter/leave this square.
  */
 // Removed
 void tagVis_VisualizationRemoved(object sender, TagVisualizerEventArgs e)
 {
     Console.WriteLine("Tag left square " + name);
 }
        //======================================================================
        //                       TagVisualizer Functions
        //======================================================================

        // When tag is detected
        private void UrbanTagVisualizer_VisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            if (canPlaceRoad)
            {
                return;
            }
            tagDetected = true;
            TagVisualization1 objectTag = (TagVisualization1)e.TagVisualization;
            switch (objectTag.VisualizedTag.Value)
            {
                case 0:
                    objectTag.HouseModel.Content = "HOUSE ADDED";
                    objectTag.myHouse.Fill = SurfaceColors.Accent1Brush;
                    break;
                case 1:
                    objectTag.HouseModel.Content = "BUILDING ADDED";
                    objectTag.myHouse.Fill = SurfaceColors.Accent1Brush;
                    break;
                case 2:
                    objectTag.HouseModel.Content = "SKYSCRAPER ADDED";
                    objectTag.myHouse.Fill = SurfaceColors.Accent1Brush;
                    break;
                default:
                    objectTag.HouseModel.Content = "UNKNOWN MODEL";
                    objectTag.myHouse.Fill = SurfaceColors.Accent1Brush;
                    break;
            }
        }
Пример #59
0
        /// <summary>
        /// Tells the visualizer how to react when a tag is placed
        /// </summary>
        /// <param name="sender">the visualizer</param>
        /// <param name="e">the Event which contains the tag value</param>
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            UnitVisualization taggedUnit = (UnitVisualization)e.TagVisualization;
            taggedUnit.UnitName.Content = units[taggedUnit.VisualizedTag.Value].Name;
            BitmapImage testImage = new BitmapImage(new Uri(units[taggedUnit.VisualizedTag.Value].Photo, UriKind.Relative)); //Change for your PC
            taggedUnit.Photo.Source = testImage;
            if (units[taggedUnit.VisualizedTag.Value].Faction == 1)
            {
                taggedUnit.Faction.Content = "Dark Angels Space Marines";
            }
            else{
                taggedUnit.Faction.Content = "Chaos Space Marines";
            }

            if (units[taggedUnit.VisualizedTag.Value] is Mech)
            {
                Mech testMech = (Mech)units[taggedUnit.VisualizedTag.Value];
                taggedUnit.cat4.Content = "FA";
                taggedUnit.cat5.Content = "SA";
                taggedUnit.cat6.Content = "RA";
                taggedUnit.cat7.Content = "I";
                taggedUnit.cat8.Content = "A";
                taggedUnit.cat9.Content = "HP";
                taggedUnit.charWS.Content = "" + testMech.WS;
                taggedUnit.charBS.Content = "" + testMech.BS;
                taggedUnit.charS.Content = "" + testMech.S;
                taggedUnit.charT.Content = "" + testMech.FA;
                taggedUnit.charW.Content = "" + testMech.SA;
                taggedUnit.charI.Content = "" + testMech.RA;
                taggedUnit.charA.Content = "" + testMech.I;
                taggedUnit.charLd.Content = "" + testMech.A;
                taggedUnit.charSv.Content = "" + testMech.HP;
            }
            else
            {
                taggedUnit.charWS.Content = "" + units[taggedUnit.VisualizedTag.Value].WS;
                taggedUnit.charBS.Content = "" + units[taggedUnit.VisualizedTag.Value].BS;
                taggedUnit.charS.Content = "" + units[taggedUnit.VisualizedTag.Value].S;
                taggedUnit.charT.Content = "" + units[taggedUnit.VisualizedTag.Value].T;
                taggedUnit.charW.Content = "" + units[taggedUnit.VisualizedTag.Value].W;
                taggedUnit.charI.Content = "" + units[taggedUnit.VisualizedTag.Value].I;
                taggedUnit.charA.Content = "" + units[taggedUnit.VisualizedTag.Value].A;
                taggedUnit.charLd.Content = "" + units[taggedUnit.VisualizedTag.Value].Ld;
                taggedUnit.charSv.Content = "" + units[taggedUnit.VisualizedTag.Value].Sv + "+";
            }
        }
Пример #60
0
 void Visualizer_VisualizationInitialized(object sender, TagVisualizerEventArgs e)
 {
 }