예제 #1
0
        private string GetActiveSmus(Int64 slaveNo)
        {
            string        ret  = "";
            UInt64        smu  = 0;
            List <UInt64> smus = GetSmuSets();

            slaveLedSet.Select(slaveNo);

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

                    if (slaveLedSet.TurnOn == true)
                    {
                        smu |= smus[slaveLedSet.StrNo - 1];
                    }
                }
            }

            UlBinSets smuSets = new UlBinSets(8);

            smuSets.DDWord(0, smu);

            for (int i = 0; i < smuSets.Count * 8; i++)
            {
                if (smuSets[i] == true)
                {
                    if (ret == "")
                    {
                        ret = $"{i + 1}";
                    }
                    else
                    {
                        ret += $",{i + 1}";
                    }
                }
            }

            return(ret);
        }
예제 #2
0
        private void SetEditValueFromDataSet()
        {
            Int64 slaveNo;

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

            nameEdit.Properties.ReadOnly = true;
            memoEdit.Properties.ReadOnly = true;

            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();
                }
            }
        }
예제 #3
0
        private void Load(Int64 slaveNo)
        {
            slaveLedSet.Select(slaveNo);

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

                PatternLedObject item = new PatternLedObject();
                item.RecNo     = slaveLedSet.RecNo;
                item.PatternNo = slaveLedSet.SlavePatternNo;
                item.X         = slaveLedSet.X;
                item.Y         = slaveLedSet.Y;
                item.StrNo     = slaveLedSet.StrNo;
                item.LedNo     = slaveLedSet.LedNo;
                item.TurnOn    = slaveLedSet.TurnOn;
                item.Measuring = slaveLedSet.Measuring;
                item.Type      = slaveLedSet.Type;

                xyLeds.Add(item.XY, item);
                strLeds.Add(item.StrLed, item);
            }
        }