Пример #1
0
         private void buttonConnect_Click(object sender, EventArgs e)
        {
            if (activeDump == null) return;
            if (buttonConnect.Text.CompareTo("Подключить")>=0)
            {
                if (!activeDump.isConnected()) activeDump.Connect();
                if (activeDump.isConnected()) 
                {
                    viewTable.Redraw(activeSub, activeDump, seeking);
                }
            }
            else
            {
                if (activeDump.isConnected()) activeDump.Close();
            }
            if (activeDump.isConnected())
                buttonConnect.Text="Отключить";
            else buttonConnect.Text = "Подключить";

        }
Пример #2
0
        static public void Close(string nameSubs)
        {
            if (!nameSubs.Contains("."))
            {
                if (!dumps.ContainsKey(nameSubs))
                {
                    throw new ArgumentException("Subsystem " + nameSubs + " not supported!");
                }
                Dumper dump = dumps[nameSubs];
                dump.Close();
                dumps.Remove(nameSubs);
                return;
            }
            if (!masters.ContainsKey(nameSubs))
            {
                throw new ArgumentException("Subsystem and modbus " + nameSubs + " not supported!");
            }
            MasterModbus master = masters[nameSubs];

            master.Close();
            masters.Remove(nameSubs);
        }