Exemplo n.º 1
0
        public NodeControl(Gateway_Version1.DeviceManager.DeviceDataTemplate device)
        {
            this.InitializeComponent();
            this.Resources["NameA"] = device.DeviceName;

            this.ID = device.ID;

            TooltipName.PlacementTarget = ellipse;
            TooltipName.IsOpen          = true;

            input = new List <Gateway_Version1.DeviceManager.DeviceDataTemplate>();

            input.Add(device);
            //  m = new ControlMenu();
            //  m.closeWindow +=HidecontextMenu;

            switch (device.ClusterID)
            {
            case 0: ellipse.Fill = Brushes.Azure; break;

            case 1: ellipse.Fill = Brushes.DarkMagenta; break;

            case 2: ellipse.Fill = Brushes.Chartreuse; break;

            default: break;
            }

            ellipse.SetValue(Canvas.TopProperty, device.position.X);
            ellipse.SetValue(Canvas.LeftProperty, device.position.Y);
        }
Exemplo n.º 2
0
        private void UpdataNode(Gateway_Version1.DeviceManager.DeviceDataTemplate device)
        {
            int ind = FindControlByName(device.ID);

            if (ind != 99999)
            {
                NodeControl nodec = (NodeControl)GridMain.Children[ind];
                nodec.Update(device);
            }
        }
Exemplo n.º 3
0
        private void NewNode(object sender, RoutedEventArgs e, Gateway_Version1.DeviceManager.DeviceDataTemplate device)
        {
            /* sbNew = this.FindResource("new") as Storyboard;
             * Storyboard.SetTarget(sbNew, ellipse);
             * sbNew.Begin();*/
            control = new NodeControl(device);
            control.HandlerMenuCreat += control_HandlerMenuCreat;
            GridMain.Children.Add(control);

            //    control.Move(device.position.X, device.position.Y);
        }
Exemplo n.º 4
0
        public void Update(Gateway_Version1.DeviceManager.DeviceDataTemplate device)
        {
            input[0].ClusterID = device.ClusterID;
            switch (device.ClusterID)
            {
            case 0: ellipse.Fill = ChangeColor(Colors.White, Colors.Orange, Colors.OliveDrab); break;

            case 1: ellipse.Fill = ChangeColor(Colors.White, Colors.Blue, Colors.Brown); break;

            case 2: ellipse.Fill = ChangeColor(Colors.White, Colors.Cyan, Colors.DarkCyan); break;

            default: break;
            }
        }
Exemplo n.º 5
0
 void _deviceManager_DeviceFoundEvent(Gateway_Version1.DeviceManager.DeviceDataTemplate device)
 {
     NewNode(new object(), new RoutedEventArgs(), device);
 }