Exemplo n.º 1
0
        /// <summary>
        /// Opens the COM interface for live view control.
        /// </summary>
        /// <returns>true if successfull and false if not.</returns>
        private bool GetAtmoLiveViewControl()
        {
            if (atmoRemoteControl == null)
            {
                return(false);
            }

            Log.Debug("AtmoWinHandler - Getting AtmoWin Live View Control.");
            if (TimeoutHandler(() => atmoLiveViewControl = (IAtmoLiveViewControl)Marshal.GetActiveObject("AtmoRemoteControl.1")))
            {
                Log.Debug("AtmoWinHandler - Successfully got AtmoWin Live View Control.");
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Disconnect from AtmoWin.
        /// </summary>
        /// <returns>true or false</returns>
        public bool Disconnect()
        {
            Log.Debug("AtmoWinHandler - Disconnecting from AtmoWin.");

            StopGetAtmoLiveViewSourceThread();

            if (atmoRemoteControl != null)
            {
                Marshal.ReleaseComObject(atmoRemoteControl);
                atmoRemoteControl = null;
            }
            if (atmoLiveViewControl != null)
            {
                Marshal.ReleaseComObject(atmoLiveViewControl);
                atmoLiveViewControl = null;
            }

            // Sleep timer to avoid Windows being to quick upon COM port unlocking
            Thread.Sleep(1500);

            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Opens the COM interface for live view control.
        /// </summary>
        /// <returns>true if successfull and false if not.</returns>
        private bool GetAtmoLiveViewControl()
        {
            if (atmoRemoteControl == null)
              {
            return false;
              }

              Log.Debug("AtmoWinHandler - Getting AtmoWin Live View Control.");
              if (TimeoutHandler(() => atmoLiveViewControl = (IAtmoLiveViewControl)Marshal.GetActiveObject("AtmoRemoteControl.1")))
              {
            Log.Debug("AtmoWinHandler - Successfully got AtmoWin Live View Control.");
            return true;
              }
              return false;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Disconnect from AtmoWin.
        /// </summary>
        /// <returns>true or false</returns>
        public bool Disconnect()
        {
            Log.Debug("AtmoWinHandler - Disconnecting from AtmoWin.");

              StopGetAtmoLiveViewSourceThread();

              if (atmoRemoteControl != null)
              {
            Marshal.ReleaseComObject(atmoRemoteControl);
            atmoRemoteControl = null;
              }
              if (atmoLiveViewControl != null)
              {
            Marshal.ReleaseComObject(atmoLiveViewControl);
            atmoLiveViewControl = null;
              }
              return true;
        }
Exemplo n.º 5
0
    /// <summary>
    /// Disconnect from AtmoWin.
    /// </summary>
    /// <returns>true or false</returns>
    public bool Disconnect()
    {
      Log.Debug("AtmoWinHandler - Disconnecting from AtmoWin.");

      StopGetAtmoLiveViewSourceThread();

      if (atmoRemoteControl != null)
      {
        Marshal.ReleaseComObject(atmoRemoteControl);
        atmoRemoteControl = null;
      }
      if (atmoLiveViewControl != null)
      {
        Marshal.ReleaseComObject(atmoLiveViewControl);
        atmoLiveViewControl = null;
      }

      // Sleep timer to avoid Windows being to quick upon COM port unlocking
      Thread.Sleep(1500);

      return true;
    }