Esempio n. 1
0
        public int Finit()
        {
            int ret = -1;

            if (_dvr != null)
            {
                try
                {
                    _dvr.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }


            if (_lcd != null && _lcd.SerialPort.IsOpen)
            {
                try
                {
                    _lcd.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            if (_led != null)
            {
                try
                {
                    _led.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            if (_iologic != null)
            {
                try
                {
                    _iologic.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            if (_card != null)
            {
                try
                {
                    _card.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            if (_weight != null)
            {
                try
                {
                    _weight.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            if (_rtu != null)
            {
                try
                {
                    _rtu.Close();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            return(ret);
        }