Пример #1
0
        /// <summary>
        /// Calculate and display channel numbers
        /// </summary>
        private void CalcAndShowCnlNums(bool showError)
        {
            // getting numbers of existing channels
            if (inCnlNums == null)
            {
                inCnlNums = Tables.GetInCnlNums();
            }
            if (ctrlCnlNums == null)
            {
                ctrlCnlNums = Tables.GetCtrlCnlNums();
            }

            // getting numbering parameters
            var inCnlNumParams = new CreateCnls.CnlNumParams()
            {
                Start    = decimal.ToInt32(numInCnlsStart.Value),
                Multiple = decimal.ToInt32(numInCnlsMultiple.Value),
                Shift    = decimal.ToInt32(numInCnlsShift.Value),
                Space    = decimal.ToInt32(numInCnlsSpace.Value)
            };

            var ctrlCnlNumParams = new CreateCnls.CnlNumParams()
            {
                Start    = decimal.ToInt32(numCtrlCnlsStart.Value),
                Multiple = decimal.ToInt32(numCtrlCnlsMultiple.Value),
                Shift    = decimal.ToInt32(numCtrlCnlsShift.Value),
                Space    = decimal.ToInt32(numCtrlCnlsSpace.Value)
            };

            // calculation of channel numbers
            string errMsg;
            bool   calcOk = CreateCnls.CalcCnlNums(kpViewTypes, kpInfoList, commDirs,
                                                   inCnlNums, inCnlNumParams, ctrlCnlNums, ctrlCnlNumParams, out errMsg);

            // output to form
            SwitchCalcCreateEnabled(!calcOk);
            gvKPSel.Invalidate();
            if (showError && errMsg != "")
            {
                AppUtils.ProcError(errMsg);
            }
        }
Пример #2
0
        /// <summary>
        /// Рассчитать и отобразить номера каналов
        /// </summary>
        private void CalcAndShowCnlNums(bool showError)
        {
            // получение номеров существующих каналов
            if (inCnlNums == null)
            {
                inCnlNums = Tables.GetInCnlNums();
            }
            if (ctrlCnlNums == null)
            {
                ctrlCnlNums = Tables.GetCtrlCnlNums();
            }

            // получение параметров нумерации
            CreateCnls.CnlNumParams inCnlNumParams = new CreateCnls.CnlNumParams()
            {
                Start    = decimal.ToInt32(numInCnlsStart.Value),
                Multiple = decimal.ToInt32(numInCnlsMultiple.Value),
                Shift    = decimal.ToInt32(numInCnlsShift.Value),
                Space    = decimal.ToInt32(numInCnlsSpace.Value)
            };

            CreateCnls.CnlNumParams ctrlCnlNumParams = new CreateCnls.CnlNumParams()
            {
                Start    = decimal.ToInt32(numCtrlCnlsStart.Value),
                Multiple = decimal.ToInt32(numCtrlCnlsMultiple.Value),
                Shift    = decimal.ToInt32(numCtrlCnlsShift.Value),
                Space    = decimal.ToInt32(numCtrlCnlsSpace.Value)
            };

            // рассчёт номеров каналов
            string errMsg;
            bool   calcOk = CreateCnls.CalcCnlNums(kpViewTypes, kpInfoList, commDirs,
                                                   inCnlNums, inCnlNumParams, ctrlCnlNums, ctrlCnlNumParams, out errMsg);

            // вывод на форму
            SwitchCalcCreateEnabled(!calcOk);
            gvKPSel.Invalidate();
            if (showError && errMsg != "")
            {
                AppUtils.ProcError(errMsg);
            }
        }