public int Finit() { int ret = -1; if (_dvr != null) { for (int i = 0; i < _video_channel.Length; i++) { if (_video_channel[i] > -1) { _dvr.SDK_StopRealPlay(_video_channel[i]); } } _dvr.SDK_Logout(); _dvr.SDK_Cleanup(); } if (_lcd != null) { _lcd.Close(); } if (_led != null) { _led.Close(); } if (_iologic != null) { _iologic.Close(); } if (_card != null) { _card.Close(); } if (_weight != null) { _weight.Close(); } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ if (Cameras != null && Cameras.Length > 0) { for (int i = 0; i < Cameras.Length; i++) { if (Cameras[i] == null) { continue; } Cameras[i].StopRealPlay(); Cameras[i].Logout(); } SSNetSDK.XNS_DEV_Cleanup(); //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ } return(ret); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { _led.Close(); }
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); }