コード例 #1
0
        /// <summary>
        /// This function allows the GroundApp to request from the ground PIS the list of available
        /// elements. This list includes also missions that are running for each element, and the
        /// versions of the LMT and PIS Base data packages.
        /// </summary>
        /// <param name="sessionId">Identifier for the session.</param>
        /// <returns>
        /// The code “request accepted” when the command is valid and the list of elements, or and error
        /// code when the command is rejected.
        /// </returns>
        RealTimeAvailableElementListResult IRealTimeService.GetAvailableElementList(Guid sessionId)
        {
            var result = new RealTimeAvailableElementListResult();

            result.ResultCode  = RealTimeServiceErrorEnum.ElementListNotAvailable;
            result.ElementList = null;

            if (_sessionManager.IsSessionValid(sessionId))
            {
                T2GManagerErrorEnum rqstResult = _t2gManager.GetAvailableElementDataList(out result.ElementList);

                if (rqstResult == T2GManagerErrorEnum.eSuccess)
                {
                    result.ResultCode = RealTimeServiceErrorEnum.RequestAccepted;
                }
                else
                {
                    result.ResultCode = RealTimeServiceErrorEnum.ElementListNotAvailable;
                }
            }
            else
            {
                result.ResultCode = RealTimeServiceErrorEnum.ErrorInvalidSessionId;
            }

            return(result);
        }
コード例 #2
0
        /// <summary>
        /// LiveVideoControlService Web service method "StartVideoStreamingCommand" that sends a
        /// scheduled message to addressee.
        /// </summary>
        /// <param name="sessionId">The session identifier.</param>
        /// <param name="targetAddress">Addressee information.</param>
        /// <param name="url">The request timeout.</param>
        /// <returns>Response <see cref="LiveVideoControlResult"/>.</returns>
        LiveVideoControlResult ILiveVideoControlService.StartVideoStreamingCommand(
            Guid sessionId,
            TargetAddressType targetAddress,
            string url)
        {
            LiveVideoControlResult result = new LiveVideoControlResult();

            result.RequestId  = Guid.Empty;
            result.ResultCode = LiveVideoControlErrorEnum.RequestAccepted;

            string automaticModeURL;

            if (_sessionManager.IsSessionValid(sessionId))
            {
                if (GetAutomaticMode(out automaticModeURL) == false)
                {
                    _dicVideoHistory[targetAddress]            = url;
                    _dicVideoHistorySentService[targetAddress] = null;

                    result = SendStartStreamingCommand(
                        sessionId,
                        targetAddress,
                        url
                        );
                }
                else
                {
                    result.Url        = automaticModeURL;
                    result.ResultCode = LiveVideoControlErrorEnum.AutomaticModeActivated;
                }
            }
            else
            {
                result.ResultCode = LiveVideoControlErrorEnum.InvalidSessionId;
            }

            return(result);
        }