Beispiel #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);
                }
            }
        }
Beispiel #2
0
        //8 distinct errors
        public ErrorBox(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
            {
                _errorHeader = new Indicator("header", text: "Hatalar");
                _errorHeader.Reorient(new Geometry.Rectangle(r.L, r.L + r.W, r.T, r.T + 30f));
                _errorHeader.BackColor = Color.LightGray;
                _errorHeader.TextAlign = ContentAlignment.TopCenter;


                _errorList = new Indicator("header", emSize: 9f);
                _errorList.Reorient(new Geometry.Rectangle(r.L, r.L + r.W, r.T + 30f, r.T + r.H - 80f));
                _errorList.BackColor = Color.LightGray;

                _fixButton = new ModifiedButton("fix", "Hataları Düzelt", 12f);
                _fixButton.Reorient(new Geometry.Rectangle(r.L, r.L + r.W, r.T + r.H - 80f, r.T + r.H));
            }
        }
Beispiel #3
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]);
            }
        }
Beispiel #4
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());
            }
        }
Beispiel #5
0
        public BoxVisuals(int x, int y, int w, int h, bool asVisual = false)
        {
            _asVisual = asVisual;
            _realSize = new Geometry.Rectangle(w, h, new Geometry.Point(x, y));
            if (asVisual)
            {
                _plotIndicator = new Indicator("plc", References.ProjectPath + "Images\\placeholder.jpg");
                _plotIndicator.PaintIndicator(Color.Chartreuse);
                Geometry.Rectangle r3 = _realSize.SliceVertical(0f, 1f);
                _plotIndicator.Reorient(r3);
            }
            else
            {
                // examples

                /*
                 * var sb = new SingleBox("111", "elma", "15", "152", "154",true,0);
                 * boxes.Add(sb);
                 * var sb2 = new SingleBox("111", "elma", "25", "252", "254",true,1);
                 * boxes.Add(sb2);
                 * var sb3 = new SingleBox("111", "elma3", "125", "152", "154",false,0);
                 * boxes.Add(sb3);
                 * var sb4 = new SingleBox("111", "elma1", "225", "252", "254",false,1);
                 * boxes.Add(sb4);
                 */

                // {BackColor = Color.Black};
                _beltIndicator = new Indicator("beltIndicator", References.ProjectPath + "Images\\belt.jpg");
                _beltIndicator.Reorient(_realSize.SubRectangle(_beltRect));
                for (int i = 0; i < 3; i++)
                {
                    //_palleteIndicators[i].BackColor = Color.Black;
                    _palleteIndicators[i].Reorient(_realSize.SubRectangle(_palleteRects[i]));
                    _robotIndicators[i].TextAlign = ContentAlignment.MiddleCenter;
                    _robotIndicators[i].Reorient(_realSize.SubRectangle(_palleteRects[i]).SubRectangle(new Geometry.Rectangle(0.3f, 0.7f, -0.15f, -0.05f)));
                    var j = i;
                    _robotIndicators[i].ClickAction = () =>
                    {
                        RobotOperation(j);
                    };
                }


                for (var j = 0; j < BeltCol; j++)
                {
                    for (var i = 0; i < BeltRow; i++)
                    {
                        var ml = new ModifiedLabel("aa", $"{i}, {j}", 8f)
                        {
                            ForeColor = Color.Black,
                            BackColor = Color.Goldenrod,
                            TextAlign = ContentAlignment.TopCenter
                        };
                        var otb = new Geometry.Rectangle((float)j / BeltCol,
                                                         (float)(j + 1) / BeltCol, (float)i / BeltRow, (float)
                                                         (i + 1) / BeltRow);
                        var tb = _realSize.SubRectangle(_beltRect.SubRectangle(otb)).SubRectangle(new Geometry.Rectangle(0.05f, 0.95f, 0.05f, 0.95f));
                        ml.Reorient(tb);
                        _beltBoxLabels.Add(ml);
                    }
                }

                for (var i = 0; i < RobotRow; i++)
                {
                    for (var j = 0; j < RobotCol; j++)
                    {
                        var index = 0;
                        foreach (var e in _palleteRects)
                        {
                            var ml = new ModifiedLabel("aa", $"{i}, {j}", 8f)
                            {
                                ForeColor = Color.Black,
                                BackColor = Color.Goldenrod,
                                TextAlign = ContentAlignment.TopCenter
                            };
                            var otb = new Geometry.Rectangle((float)j / RobotCol,
                                                             (float)(j + 1) / RobotCol, (float)i / RobotRow, (float)
                                                             (i + 1) / RobotRow);
                            var tb = _realSize.SubRectangle(e.SubRectangle(otb)).SubRectangle(new Geometry.Rectangle(0.05f, 0.95f, 0.05f, 0.95f));
                            ml.Reorient(tb);
                            _robotLabels[index].Add(ml);
                            index++;
                        }
                    }
                }
            }
            Refresh();
        }