コード例 #1
0
        public void push(int width, int height, bool vertical)
        {
            var control = new PLCList();

            control.Vertical = vertical;
            setSize(control, width, height);
            this.CurrList.currentLayout().Controls.Add(control);
            this._currList.Push(control);
        }
コード例 #2
0
        public void createTrackingItem(PLCList list, String baseVar, int number)
        {
            for (int i = 1; i <= number; i++)
            {
                String varB = baseVar + "[" + i + "]";
                list.push(210, 240, true);
                list.addBool("Busy", varB + ".Busy");
                list.addNumberEdit("R", varB + ".Rotazione");
                list.addNumberEdit("L", varB + ".Larghezza");
                list.addNumberEdit("H", varB + ".Altezza");
                list.addNumberEdit("X", varB + ".Lunghezza");
                list.addNumberEdit("Scar", varB + ".Lato_scarico");
                list.addNumberEdit("Ric", varB + ".Nr_Ricetta");
                list.addButton("Reset", "").OnUIChanges += (control, e) =>
                {
                    control.PLC.doWithPLC((p) =>
                    {
                        p.writeBool(varB + ".Busy", false);
                        p.writeInt16(varB + ".Rotazione", 0);
                        p.writeDouble(varB + ".Larghezza", 0.0);
                        p.writeDouble(varB + ".Altezza", 0.0);
                        p.writeDouble(varB + ".Lunghezza", 0.0);
                        p.writeInt16(varB + ".Rotazione", 0);
                        p.writeInt16(varB + ".Nr_Ricetta", 0);
                    });
                };


                list.addButton("Set", "").OnUIChanges += (control, e) =>
                {
                    control.PLC.doWithPLC((p) =>
                    {
                        p.writeBool(varB + ".Busy", true);
                    });
                };
                list.pop();
            }
        }