AForge.Robotics.TeRK.Qwerk.Video.Video C# (CSharp) Метод

Video() публичный Метод

Initializes a new instance of the Qwerk.Video class.
The passed reference to object is not connected to /// Qwerk board. Failed connecting to the requested service. Failed accessing to the requested service.
public Video ( AForge.Robotics.TeRK.Qwerk qwerk )
qwerk AForge.Robotics.TeRK.Qwerk Reference to object, which is connected to Qwerk board.
            public Video( Qwerk qwerk )
            {
                string hostAddress = qwerk.HostAddress;

                // check if connection was established
                if ( hostAddress != null )
                {
                    try
                    {
                        // prepare video source string
                        source = "'::TeRK::VideoStreamerServer':tcp -h " + hostAddress + " -p 10101";

                        Ice.ObjectPrx obj = qwerk.iceCommunicator.stringToProxy( source );
                        obj = obj.ice_timeout( Qwerk.TimeOut );
                        videoStreamer = TeRKIceLib.VideoStreamerServerPrxHelper.checkedCast( obj );
                    }
                    catch ( Ice.ObjectNotExistException )
                    {
                        // the object does not exist on the host
                        throw new ServiceAccessFailedException( "Failed accessing to the requested service." );
                    }
                    catch
                    {
                        throw new ConnectionFailedException( "Failed connecting to the requested service." );
                    }

                    if ( videoStreamer == null )
                    {
                        throw new ServiceAccessFailedException( "Failed accessing to the requested cervice." );
                    }
                }
                else
                {
                    throw new NotConnectedException( "Qwerk object is not connected to a board." );
                }
            }