コード例 #1
0
        public PalleteVisuals(Geometry.Rectangle boxRect, bool asVisual = false)
        {
            _asVisual = asVisual;
            Geometry.Rectangle r = makeMyRect(boxRect);

            if (asVisual)
            {
                _plotIndicator = new Indicator("plc", References.ProjectPath + "Images\\placeholder.jpg");
                _plotIndicator.PaintIndicator(Color.Fuchsia);
                Geometry.Rectangle r3 = r.SliceVertical(0f, 1f);
                _plotIndicator.Reorient(r3);
            }
            else
            {
                _background.Reorient(r);
                // indicators
                var a = r.Split(1, 3, 0.05f, 0.05f);

                a = new List <Geometry.Rectangle> {
                    new Geometry.Rectangle(177, 405, 388, 658),
                    new Geometry.Rectangle(455, 682, 388, 658),
                    new Geometry.Rectangle(732, 959, 388, 658)
                };

                for (int i = 0; i < 3; i++)
                {
                    //var centreRect = a[i].SubRectangle(new Geometry.Rectangle(0f, 1f, 0.2f, 0.6f)); // centre
                    var pv = new PalletteVisual(a[i], i);

                    _pallettes.Add(pv);
                }
            }
        }
コード例 #2
0
        public SystemControls(int x, int y, int w, int h, bool asVisual = false)
        {
            Geometry.Rectangle r = new Geometry.Rectangle(w, h, new Geometry.Point(x, y));
            this._asVisual = asVisual;
            if (asVisual)
            {
                _plotIndicator = new Indicator("plc", References.ProjectPath + "Images\\placeholder.jpg");
                _plotIndicator.PaintIndicator(Color.Aquamarine);
                Geometry.Rectangle r3 = r.SliceVertical(0f, 1f);
                _plotIndicator.Reorient(r3);
            }
            else
            {
                var a = r.Split(1, 4, 0.05f, 0.05f);

                PalleteButton = new ModifiedButton("pallete", "Palet Aç");
                PalleteButton.Reorient(a[0]);

                AddProductButton = new ModifiedButton("ap", "Pattern Aç");
                AddProductButton.Reorient(a[1]);

                ReconnectButton = new ModifiedButton("recon", "Yeniden Bağlan");
                ReconnectButton.Reorient(a[2]);

                BypassButton = new ModifiedButton("bp", "Bantlama Bypass");
                BypassButton.Reorient(a[3]);
            }
        }
コード例 #3
0
        public void resize(int x, int y, int w, int h)
        {
            Geometry.Rectangle r = new Geometry.Rectangle(w, h, new Geometry.Point(x, y));
            var a = r.Split(1, 3, 0.05f, 0.05f);

            _plcIndicator.Reorient(a[0]);
            _barcodeIndicator.Reorient(a[1]);
            _taperIndicator.Reorient(a[2]);
        }
コード例 #4
0
        public void resize(int x, int y, int w, int h)
        {
            Geometry.Rectangle r = new Geometry.Rectangle(w, h, new Geometry.Point(x, y));
            var a = r.Split(1, 4, 0.05f, 0.05f);

            PalleteButton.Reorient(a[0]);
            AddProductButton.Reorient(a[1]);
            ReconnectButton.Reorient(a[2]);
            BypassButton.Reorient(a[3]);
        }
コード例 #5
0
        public GenericWarning(string warningText = "ben bir uyarıyım", string buttonText = "onay")
        {
            AutoScaleMode = AutoScaleMode.Font;
            ClientSize    = new Size((int)W, (int)H);
            StartPosition = FormStartPosition.CenterParent;
            Text          = @"Uyarı";

            Geometry.Rectangle v = new Geometry.Rectangle(W * 0.1f, W * 0.9f, 0f, H);

            var a = v.Split(2, 1);

            ModifiedLabel textLabel = new ModifiedLabel("warning text", warningText, 12f);

            textLabel.Reorient(a[0]);
            textLabel.TextAlign = ContentAlignment.MiddleCenter;
            Controls.Add(textLabel);

            ModifiedButton confirm = new ModifiedButton("confirm", buttonText);

            confirm.Reorient(a[1].SubRectangle(new Geometry.Rectangle(0.25f, 0.75f, 0.2f, 0.7f)));
            confirm.ClickAction = Close;
            Controls.Add(confirm);
        }
コード例 #6
0
        public ConnectionIndicators(int x, int y, int w, int h, bool asVisual = false)
        {
            _asVisual = asVisual;
            Geometry.Rectangle r = new Geometry.Rectangle(w, h, new Geometry.Point(x, y));

            if (asVisual)
            {
                _plotIndicator = new Indicator("plc", References.ProjectPath + "Images\\placeholder.jpg");
                _plotIndicator.PaintIndicator(Color.Fuchsia);
                Geometry.Rectangle r3 = r.SliceVertical(0f, 1f);
                _plotIndicator.Reorient(r3);
            }
            else
            {
                // indicators
                var a = r.Split(1, 3, 0.05f, 0.05f);
                _plcIndicator = new Indicator("plc", References.ProjectPath + "Images\\plc_on.png");
                _plcIndicator.Reorient(a[0].FittingSquare());
                _barcodeIndicator = new Indicator("barcode", References.ProjectPath + "Images\\barcode_on.png");
                _barcodeIndicator.Reorient(a[1].FittingSquare());
                _taperIndicator = new Indicator("taper", References.ProjectPath + "Images\\tape_on.png");
                _taperIndicator.Reorient(a[2].FittingSquare());
            }
        }