示例#1
0
        private void ResetEditValue()
        {
            nameEdit.Text = "";
            memoEdit.Text = "";

            ctrlPatternGrid.RefreshGrid();

            masterSet.Select((Int64)recipeCombo.SelectedValue);
            masterSet.Fetch();
            masterNo = masterSet.RecNo;

            masterLedSet.Select(masterNo);

            if (masterLedSet.Empty == false)
            {
                for (int i = 0; i < masterLedSet.RowCount; i++)
                {
                    masterLedSet.Fetch(i);

                    int x = masterLedSet.X;
                    int y = masterLedSet.Y;

                    ctrlPatternGrid.PatternRows[y].Leds[x].RecNo       = masterLedSet.RecNo;
                    ctrlPatternGrid.PatternRows[y].Leds[x].X           = x;
                    ctrlPatternGrid.PatternRows[y].Leds[x].Y           = y;
                    ctrlPatternGrid.PatternRows[y].Leds[x].StringIndex = masterLedSet.StrNo;
                    ctrlPatternGrid.PatternRows[y].Leds[x].LedIndex    = masterLedSet.LedNo;
                    ctrlPatternGrid.PatternRows[y].Leds[x].Type        = masterLedSet.Type;
                }

                ctrlPatternGrid.RefreshGridData();
            }
        }
        private void createButton_Click(object sender, EventArgs e)
        {
            int stringCount = (int)stringCountEdit.Value;

            RefreshStringToSmus(stringCount);

            ctrlPatternGrid.XLength     = (int)xLengthEdit.Value;
            ctrlPatternGrid.YHeight     = (int)yHeightEdit.Value;
            ctrlPatternGrid.StringCount = stringCount;
            ctrlPatternGrid.LedCount    = (int)ledCountEdit.Value;
            ctrlPatternGrid.RefreshGrid();

            RefreshSmuGrid(AppRes.Properties.SmuCount, stringCount);
        }
        private void SetEditValueFromDataSet()
        {
            Int64 slaveNo;

            if ((slaveSet.RecNo < 1) || (slaveSet.Empty == true))
            {
                slaveNo       = 0;
                nameEdit.Text = "";
                memoEdit.Text = "";
            }
            else
            {
                slaveNo       = slaveSet.RecNo;
                nameEdit.Text = slaveSet.Name;
                memoEdit.Text = slaveSet.Memo;
            }

            ctrlPatternGrid.RefreshGrid();

            if (slaveNo > 0)
            {
                slaveLedSet.Select(slaveNo);

                if (slaveLedSet.Empty == false)
                {
                    for (int i = 0; i < slaveLedSet.RowCount; i++)
                    {
                        slaveLedSet.Fetch(i);

                        int x = slaveLedSet.X;
                        int y = slaveLedSet.Y;

                        ctrlPatternGrid.PatternRows[y].Leds[x].RecNo       = slaveLedSet.RecNo;
                        ctrlPatternGrid.PatternRows[y].Leds[x].X           = x;
                        ctrlPatternGrid.PatternRows[y].Leds[x].Y           = y;
                        ctrlPatternGrid.PatternRows[y].Leds[x].StringIndex = slaveLedSet.StrNo;
                        ctrlPatternGrid.PatternRows[y].Leds[x].LedIndex    = slaveLedSet.LedNo;
                        ctrlPatternGrid.PatternRows[y].Leds[x].TurnOn      = slaveLedSet.TurnOn;
                        ctrlPatternGrid.PatternRows[y].Leds[x].Measuring   = slaveLedSet.Measuring;
                        ctrlPatternGrid.PatternRows[y].Leds[x].Type        = slaveLedSet.Type;
                    }

                    ctrlPatternGrid.RefreshGridData();
                }
            }
        }