Example #1
0
        /// <summary>
        /// Временно, проверка загрузки нод
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ThingsManager_NewOWLOSThing(object sender, OWLOSThingWrapperEventArgs e)
        {
            OWLOSThingControl ThingCountrol1 = new OWLOSThingControl(e.ThingWrapper);

            ThingGrid.Children.Add(ThingCountrol1.parentControl);
            ThingCountrol1.parentControl.Show();
        }
Example #2
0
        public OWLOSThingDriverControl(OWLOSThingControl parentOWLOSThingControl, OWLOSDriver driver, double radius, double angel, double length, double width) : base(parentOWLOSThingControl, radius, angel, length, width)
        {
            Rotate(angel);
            this.driver = driver;

            //создаем элемент таблицу отображающею свойста драйвера
            driverCountrol = new OWLOSDriverControl(driver);
            //передаем управление присоедененой панелью в радительский объект (сам Control является Child этой панели)
            base.RegistRelatedPanel(driverCountrol.parentControl);

            //Название драйвера, смотрите UserControl_Loaded - пересчет извиба надписи
            petalNameText.Text = driver.name;
        }
        public OWLOSThingTransportControl(OWLOSThingControl parentOWLOSThingControl, IOWLOSTransport transport, double radius, double angel, double length, double width) : base(parentOWLOSThingControl, radius, angel, length, width)
        {
            Rotate(angel);
            this.transport = transport;

            transport.OnTransportStatusChanger += OnTransportStatusChanger;

            transportCountrol = new OWLOSTransportControl(transport);

            base.RegistRelatedPanel(transportCountrol.parentControl);


            //Название драйвера, смотрите UserControl_Loaded - пересчет извиба надписи
            petalNameText.Text = transport.connection.name;
        }
Example #4
0
        public OWLOSPetalControl(OWLOSThingControl parentOWLOSThingControl, double radius, double angel, double length, double width)
        {
            InitializeComponent();

            this.parentOWLOSThingControl = parentOWLOSThingControl;
            this.radius = radius;
            this.angel  = angel;
            this.length = length;

            parentOWLOSThingControl.parentControl.OnPositionChanged += ParentControl_OnPositionChanged;

            double startAngel = 0;

            petalBackground.Data            = HudLibrary.DrawArc(Gold.center, Gold.center, radius, startAngel, length);
            petalBackground.StrokeThickness = width;
            petalBorder1.Data = HudLibrary.DrawArc(Gold.center, Gold.center, radius + width / 2, startAngel, length);
            petalBorder2.Data = HudLibrary.DrawArc(Gold.center, Gold.center, radius - width / 2, startAngel, length);

            //подготавливаем конектор - элементы экосистемы могут соединятся друг с другом, в данном случае
            //одна нода имеет множество присоединеных драйверов. По этой причине нужно инкапсулировать много элементов
            //для соединеня
            connector = new EcosystemControl(null);
            connector.MoveTransform(0, 0);
            connector.Width  = 10;
            connector.Height = 10;
            connector.HorizontalAlignment = HorizontalAlignment.Center;
            connector.VerticalAlignment   = VerticalAlignment.Top;
            connector.Margin = new Thickness(0, 0, 0, 0);
            connector.MoveTransform(0, 330 - radius);


            Ellipse elipse = new Ellipse
            {
                Width  = 10,
                Height = 10,
                Fill   = (SolidColorBrush)App.Current.Resources["OWLOSWarning"]
            };

            connector.childHolderGrid.Children.Add(elipse);

            petalMainGrid.Children.Add(connector);
        }
Example #5
0
        public OWLOSThingFileControl(OWLOSThingControl parentOWLOSThingControl, OWLOSFiles files, double radius, double angel, double length, double width) : base(parentOWLOSThingControl, radius, angel, length, width)
        {
            Rotate(angel);
            this.files = files;

            //file.OnFileStatusChanger += OnFileStatusChanger;

            fileCountrol = new OWLOSFileControl(files);
            fileCountrol.parentControl.Visibility = Visibility.Hidden;
            fileCountrol.parentControl.Hide();

            (parentOWLOSThingControl.parentControl.Parent as Grid).Children.Add(fileCountrol.parentControl);

            //Название драйвера, смотрите UserControl_Loaded - пересчет извиба надписи
            petalNameText.Text = "files";

            //создаем и настраиваем соеденительную линию
            relationLine = new EcosystemRelationLine(fileCountrol, fileCountrol.parentControl, connector, fileCountrol, parentOWLOSThingControl.parentControl.Parent as Grid);

            petalBackground.PreviewMouseLeftButtonDown += petalBackground_PreviewMouseLeftButtonDown;
        }