Example #1
0
        private void B_Save_Click(object sender, EventArgs e)
        {
            // Copy Bags
            int emptyslots = 0;

            for (int i = 0; i < 12; i++)
            {
                var bag = dataGridView1.Rows[i].Cells[1].Value.ToString();
                if (Array.IndexOf(trba, bag) == 0)
                {
                    emptyslots++;
                    continue;
                }
                STB.SetBag(i - emptyslots, (byte)Array.IndexOf(trba, bag));
            }

            if (float.TryParse(TB_Time1.Text, out var t1))
            {
                SAV.SetData(BitConverter.GetBytes(t1), offsetTime + (4 * 30));
            }
            if (float.TryParse(TB_Time2.Text, out var t2))
            {
                SAV.SetData(BitConverter.GetBytes(t2), offsetTime + (4 * 31));
            }
            SAV.SetData(BitConverter.GetBytes((ushort)WinFormsUtil.GetIndex(CB_S2)), offsetSpec + (4 * 30));

            Origin.CopyChangesFrom(SAV);
            Close();
        }
Example #2
0
        private void B_Save_Click(object sender, EventArgs e)
        {
            // Copy Bags
            int emptyslots = 0;

            for (int i = 0; i < 12; i++)
            {
                var bag = dataGridView1.Rows[i].Cells[1].Value.ToString();
                if (Array.IndexOf(trba, bag) == 0)
                {
                    emptyslots++;
                    continue;
                }
                STB.SetBag(i - emptyslots, (byte)Array.IndexOf(trba, bag));
            }

            Origin.CopyChangesFrom(SAV);
            Close();
        }