Пример #1
0
        public Form_Editor(PLUcommon p)
        {
            InitializeComponent();

            if (p == null)
            {
                //FIX ME we need a dymanic way of selecting which PLUcommon to instance
                p = new ER230_PLU();
                plu = p;
                return;
            }

            plu = p;

            Int32[] status = new Int32[1];
            status[0] = p.status;

            ba = new BitArray(status);

            this.checkBox_N1_1.Checked = ba.Get(0);
            this.checkBox_N1_2.Checked = ba.Get(1);
            this.checkBox_N1_4.Checked = ba.Get(2);

            this.checkBox_N2_1.Checked = ba.Get(3);
            this.checkBox_N2_2.Checked = ba.Get(4);
            this.checkBox_N2_4.Checked = ba.Get(5);

            this.checkBox_N3_1.Checked = ba.Get(6);
            this.checkBox_N3_2.Checked = ba.Get(7);
            this.checkBox_N3_4.Checked = ba.Get(8);

            this.checkBox_N4_1.Checked = ba.Get(9);
            this.checkBox_N4_2.Checked = ba.Get(10);
            this.checkBox_N4_4.Checked = ba.Get(11);

            this.checkBox_N5_1.Checked = ba.Get(12);
            this.checkBox_N5_2.Checked = ba.Get(13);
            //this.checkBox_N5_4.Checked = ba.Get(14);

            //this.checkBox_N6_1.Checked = ba.Get(15);
            this.checkBox_N6_2.Checked = ba.Get(16);
            this.checkBox_N6_4.Checked = ba.Get(17);

            this.checkBox_N7_1.Checked = ba.Get(18);
            //this.checkBox_N7_2.Checked = ba.Get(19);
            this.checkBox_N7_4.Checked = ba.Get(20);

            this.checkBox_N8_1.Checked = ba.Get(21);
            this.checkBox_N8_2.Checked = ba.Get(22);
            this.checkBox_N8_4.Checked = ba.Get(23);

            this.checkBox_N9_1.Checked = ba.Get(24);
            this.checkBox_N9_2.Checked = ba.Get(25);
            this.checkBox_N9_4.Checked = ba.Get(26);

            textBox_description.Text = plu.description;
            textBox_PLU.Text = plu.PLUcode.scode;
            textBox_price1.Text = String.Format("{0}",plu.price);
            textBox_price2.Text =  String.Format("{0}",plu.price2);

            numericUpDown_group1.Value = plu.groups[0];
            numericUpDown_group2.Value = plu.groups[1];
            numericUpDown_group3.Value = plu.groups[2];

            textBox_linkPLU.Text = plu.linkPLUcode.scode;

            numericUpDown_autotare.Value = plu.autotare;
            numericUpDown_mixmatch.Value = plu.mixandmatch;
        }
Пример #2
0
        void getPLUs(List<byte> data)
        {
            Application.UseWaitCursor = true;

            plus.Clear();
            listView1.Items.Clear();

            //List<byte> data = Program.ecr.getprogram(ECRComms.program.PLU);
            int offset = 0;
            byte[] allbytes =  data.ToArray();

            int plucount = 0;
            while (offset <= allbytes.Length-ER230_PLU.Length)
            {

                ER230_PLU ep = new ER230_PLU();
                byte[] pludata = new byte[ER230_PLU.Length];
                Buffer.BlockCopy(allbytes, offset, pludata, 0, pludata.Length);
                ep.frombytes(pludata);

                addPLUtolist(ep);

                offset += ep.data.Length; //ER-230 PLU is 46 // 380M is 55;

                plucount++;

            }

            Application.UseWaitCursor = false;
        }