예제 #1
0
        /// <summary>
        /// Отобразить форму модально
        /// </summary>
        public static bool ShowDialog(ServerComm serverComm,
            List<Config.ExportDestination> expDests, Config.ExportDestination selExpDest,
            ref int curDataCtrlCnlNum, ref int arcDataCtrlCnlNum, ref int eventsCtrlCnlNum)
        {
            FrmManualExport frmManualExport = new FrmManualExport();
            frmManualExport.ServerComm = serverComm;

            // заполнение списка источников данных
            foreach (Config.ExportDestination expDest in expDests)
            {
                int ind = frmManualExport.cbDataSource.Items.Add(expDest.DataSource);
                if (expDest == selExpDest)
                    frmManualExport.cbDataSource.SelectedIndex = ind;
            }

            // установка каналов управления
            frmManualExport.CurDataCtrlCnlNum = curDataCtrlCnlNum;
            frmManualExport.ArcDataCtrlCnlNum = arcDataCtrlCnlNum;
            frmManualExport.EventsCtrlCnlNum = eventsCtrlCnlNum;

            if (frmManualExport.ShowDialog() == DialogResult.OK)
            {
                // возврат каналов управления
                curDataCtrlCnlNum = frmManualExport.CurDataCtrlCnlNum;
                arcDataCtrlCnlNum = frmManualExport.ArcDataCtrlCnlNum;
                eventsCtrlCnlNum = frmManualExport.EventsCtrlCnlNum;
                return true;
            }
            else
            {
                return false;
            }
        }
예제 #2
0
        private void btnManualExport_Click(object sender, EventArgs e)
        {
            // отображение формы экспорта в ручном режиме
            int curDataCtrlCnlNum = config.CurDataCtrlCnlNum;
            int arcDataCtrlCnlNum = config.ArcDataCtrlCnlNum;
            int eventsCtrlCnlNum  = config.EventsCtrlCnlNum;

            if (FrmManualExport.ShowDialog(serverComm, config.ExportDestinations, selExpDest,
                                           ref curDataCtrlCnlNum, ref arcDataCtrlCnlNum, ref eventsCtrlCnlNum) &&
                (config.CurDataCtrlCnlNum != curDataCtrlCnlNum ||
                 config.ArcDataCtrlCnlNum != arcDataCtrlCnlNum ||
                 config.EventsCtrlCnlNum != eventsCtrlCnlNum))
            {
                // установка изменившихся номеров каналов управления
                config.CurDataCtrlCnlNum = curDataCtrlCnlNum;
                config.ArcDataCtrlCnlNum = arcDataCtrlCnlNum;
                config.EventsCtrlCnlNum  = eventsCtrlCnlNum;
                Modified = true;
            }
        }
예제 #3
0
        private void btnManualExport_Click(object sender, EventArgs e)
        {
            // manual export form display
            int curDataCtrlCnlNum = config.CurDataCtrlCnlNum;
            int arcDataCtrlCnlNum = config.ArcDataCtrlCnlNum;
            int eventsCtrlCnlNum  = config.EventsCtrlCnlNum;

            if (FrmManualExport.ShowDialog(serverComm, config.ExportDestinations, selExpDest,
                                           ref curDataCtrlCnlNum, ref arcDataCtrlCnlNum, ref eventsCtrlCnlNum) &&
                (config.CurDataCtrlCnlNum != curDataCtrlCnlNum ||
                 config.ArcDataCtrlCnlNum != arcDataCtrlCnlNum ||
                 config.EventsCtrlCnlNum != eventsCtrlCnlNum))
            {
                // setting changed control channel numbers
                config.CurDataCtrlCnlNum = curDataCtrlCnlNum;
                config.ArcDataCtrlCnlNum = arcDataCtrlCnlNum;
                config.EventsCtrlCnlNum  = eventsCtrlCnlNum;
                Modified = true;
            }
        }
예제 #4
0
        /// <summary>
        /// Отобразить форму модально
        /// </summary>
        public static bool ShowDialog(ServerComm serverComm,
                                      List <Config.ExportDestination> expDests, Config.ExportDestination selExpDest,
                                      ref int curDataCtrlCnlNum, ref int arcDataCtrlCnlNum, ref int eventsCtrlCnlNum)
        {
            FrmManualExport frmManualExport = new FrmManualExport();

            frmManualExport.ServerComm = serverComm;

            // заполнение списка источников данных
            foreach (Config.ExportDestination expDest in expDests)
            {
                int ind = frmManualExport.cbDataSource.Items.Add(expDest.DataSource);
                if (expDest == selExpDest)
                {
                    frmManualExport.cbDataSource.SelectedIndex = ind;
                }
            }

            // установка каналов управления
            frmManualExport.CurDataCtrlCnlNum = curDataCtrlCnlNum;
            frmManualExport.ArcDataCtrlCnlNum = arcDataCtrlCnlNum;
            frmManualExport.EventsCtrlCnlNum  = eventsCtrlCnlNum;

            if (frmManualExport.ShowDialog() == DialogResult.OK)
            {
                // возврат каналов управления
                curDataCtrlCnlNum = frmManualExport.CurDataCtrlCnlNum;
                arcDataCtrlCnlNum = frmManualExport.ArcDataCtrlCnlNum;
                eventsCtrlCnlNum  = frmManualExport.EventsCtrlCnlNum;
                return(true);
            }
            else
            {
                return(false);
            }
        }