Exemplo n.º 1
0
        //private DependencyPropertyDescriptor dp = DependencyPropertyDescriptor.FromProperty(
        //Ellipse.RenderTransformProperty,
        //typeof(Ellipse));

        public EcosystemRelationLine(FrameworkElement parent, EcosystemControl aWorldObjectControl, EcosystemControl bWorldObjectControl,
                                     FrameworkElement frameworkElement, Panel panel,
                                     Point[] offsetA = null, Point[] offsetB = null)
        {
            Parent   = parent;
            aControl = aWorldObjectControl;
            bControl = bWorldObjectControl;
            this.frameworkElement = frameworkElement;
            this.panel            = panel;

            if (offsetA != null && offsetA.Length == 2)
            {
                this.offsetA = offsetA;
            }
            else
            {
                this.offsetA[0] = new Point(ellipseWidth, ellipseHeight / 2);
                this.offsetA[1] = new Point(100, 0);
            }

            if (offsetB != null && offsetB.Length == 2)
            {
                this.offsetB = offsetB;
            }
            else
            {
                this.offsetB[0] = new Point(0, 25);
                this.offsetB[1] = new Point(-100, 0);
            }
        }
Exemplo n.º 2
0
        public OWLOSNodeControl(OWLOSNodeWrapper nodeWrapper)
        {
            this.nodeWrapper = nodeWrapper;
            if (nodeWrapper != null)
            {
                nodeWrapper.node.OnNewDriver += Node_OnNewDriver;
            }

            InitializeComponent();

            parentControl = new EcosystemControl(this);

            nodeShadowPath.Data  =
                nodePath.Data    = HudLibrary.DrawArc(350, 350, radius, 0, 359);
            insideNodePath.Data  = HudLibrary.DrawArc(350, 350, radius - 80, 0, 359);
            insideNodePath2.Data = HudLibrary.DrawArc(350, 350, radius - 120, 0, 359);

            freeHeapPathBack.Data = HudLibrary.DrawArc(350, 350, radius - 20, 0, freeHeapAngelLimit);
            DrawFreeHeap(50);

            WiFiRSSIDPathBack.Data = HudLibrary.DrawArc(350, 350, radius - 40, 0, WiFiRSSIDAngelLimit);
            DrawWiFiRSSID(-50);

            PowerPathBack.Data = HudLibrary.DrawArc(350, 350, radius - 40, PowerAngeStart, PowerAngelLimit + PowerAngeStart);
            DrawPower(25000);

            scriptsPath.Data = HudLibrary.DrawArc(350, 350, radius - 40, 185, 300);

            script1Path.Data = HudLibrary.DrawArc(350, 350, radius - 60, 190, 210);
            script2Path.Data = HudLibrary.DrawArc(350, 350, radius - 60, 215, 235);
            script3Path.Data = HudLibrary.DrawArc(350, 350, radius - 60, 240, 260);

            filesPath.Data = HudLibrary.DrawArc(350, 350, radius - 40, 302, 315);

            propertiesPath.Data = HudLibrary.DrawArc(350, 350, radius - 40, 317, 359);
            restFullPath.Data   = HudLibrary.DrawArc(350, 350, radius - 100, 0, 40);
            MQTTPath.Data       = HudLibrary.DrawArc(350, 350, radius - 100, 45, 85);
            UARTPath.Data       = HudLibrary.DrawArc(350, 350, radius - 100, 90, 130);

            //RalationLines test

            /*
             * DoubleAnimation rotate = new DoubleAnimation
             * {
             *  From = 0.0f,
             *  To = 360.0f,
             *  Duration = new Duration(TimeSpan.FromMilliseconds(10000)),
             *  RepeatBehavior = RepeatBehavior.Forever,
             *  EasingFunction = new BackEase()
             *  //AutoReverse = true
             * };
             * RotateTransform rotateTransform = new RotateTransform();
             * this.RenderTransform = rotateTransform;
             * rotateTransform.BeginAnimation(RotateTransform.AngleProperty, rotate);
             * renderTransform.AddValueChanged(this, PositionChanged);
             * //nodeGrid.RenderTransform.Add
             */
        }
Exemplo n.º 3
0
        public LogControl(OWLOSNodeWrapper nodeWrapper)
        {
            InitializeComponent();
            parentControl = new EcosystemControl(this);

            this.nodeWrapper = nodeWrapper;
            if (nodeWrapper != null)
            {
                nodeWrapper.node.OnNewDriver += Node_NewDriver;
            }
        }
Exemplo n.º 4
0
        public OWLOSDriverControl(OWLOSDriver driver)
        {
            InitializeComponent();

            parentControl = new EcosystemControl(this);

            this.driver = driver;

            driverName.Text = driver.name;

            if (driver != null)
            {
                driver.OnPropertyCreate += Driver_NewProperty;
            }
        }
Exemplo n.º 5
0
        public void Dispose()
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException("Can't get access to disposed object.");
            }

            IsDisposed = true;
            RemoveRelationLine();
            ecosystemPathLine = default(EcosystemPathLine);
            aControl          = null;
            bControl          = null;
            frameworkElement  = null;
            panel             = null;
            ellipse           = null;
            curveLine         = null;
            Parent            = null;
        }
        public EcosystemExplorerWindow()
        {
            InitializeComponent();


            Admin admin = new Admin();

            adminControl = new EcosystemControl(null);
            nodeGrid.Children.Add(adminControl);

            admin.OnNewNode += Admin_NewOWLOSNode;
            admin.Load();


            nodeGrid.Width = nodeGrid.Height = cellSize;
            viewbox.Width  = viewbox.Height = cellSize / 10;

            autoScrollImage.Tag = (int)0;
            drawCellImage.Tag   = (int)1;

            // nodeGrid.Tag = nodeTreeView;


            Dispatcher.BeginInvoke((Action)DrawCell, DispatcherPriority.Send);


            double zoomTo = 10.0f;

            zoomTextBox.Text = (zoomTo).ToString(("F"));
            double zoom = zoomTo * (cellSize / 100);



            /*
             * NodeControl nodeCountrol2 = new NodeControl();
             * nodeGrid.Children.Add(nodeCountrol2);
             *
             * NodeControl nodeCountrol3 = new NodeControl();
             * nodeGrid.Children.Add(nodeCountrol3);
             */
        }