コード例 #1
0
 protected DoorControlServiceCapabilities GetDoorControlCapabilities()
 {
     DoorControlPortClient client = DoorControlPortClient;
     DoorControlServiceCapabilities capabilities = null;
     RunStep(() => { capabilities = client.GetServiceCapabilities(); }, "Get Service Capabilities");
     return capabilities;
 }
コード例 #2
0
        protected void CheckClientValid()
        {
            if (_doorControlClient != null)
            {
                string address = SMC.SmcData.Context.Instance.General.ManagementServiceAddress;
                if (address != _doorControlClient.Endpoint.Address.Uri.AbsoluteUri)
                {
                    _doorControlClient = null;
                }
            }

            if (_credentialClient != null)
            {
                string address = SMC.SmcData.Context.Instance.General.CredentialServiceAddress;
                if (address != _credentialClient.Endpoint.Address.Uri.AbsoluteUri)
                {
                    _credentialClient = null;
                }
            }

            if (_sensorServiceClient != null)
            {
                string address = SMC.SmcData.Context.Instance.General.SensorServiceAddress;
                if (address != _sensorServiceClient.Endpoint.Address.Uri.AbsoluteUri)
                {
                    _sensorServiceClient = null;
                }
            }
        }
コード例 #3
0
 protected override void UpdateAddress()
 {
     if (_eventControlClient != null)
     {
         string address = SMC.SmcData.Context.Instance.General.EventControlServiceAddress;
         if (address != _eventControlClient.Endpoint.Address.Uri.AbsoluteUri)
         {
             _eventControlClient = null;
         }
     }
     if (_pacsClient != null)
     {
         string address = SMC.SmcData.Context.Instance.General.PACSServiceAddress;
         if (address != _pacsClient.Endpoint.Address.Uri.AbsoluteUri)
         {
             _pacsClient = null;
         }
     }
     if (_doorControlClient != null)
     {
         string address = SMC.SmcData.Context.Instance.General.ManagementServiceAddress;
         if (address != _doorControlClient.Endpoint.Address.Uri.AbsoluteUri)
         {
             _doorControlClient = null;
         }
     }
     if (_schedulePortControlClient != null)
     {
         string address = SMC.SmcData.Context.Instance.General.ScheduleServiceAddress;
         if (address != _schedulePortControlClient.Endpoint.Address.Uri.AbsoluteUri)
         {
             _schedulePortControlClient = null;
         }
     }
 }
コード例 #4
0
        protected DoorInfo[] GetDoorInfo(string[] tokensList, string stepName)
        {
            DoorControlPortClient client = DoorControlPortClient;

            DoorInfo[] info = null;
            RunStep(() => { info = client.GetDoorInfo(tokensList); }, stepName);
            DoRequestDelay();
            return(info);
        }
コード例 #5
0
        protected string GetDoorInfoList(int?limit, string offset, out DoorInfo[] list, string stepName)
        {
            DoorControlPortClient client = DoorControlClient;
            string nextReference         = null;

            DoorInfo[] infos = null;
            RunStep(() => { nextReference = client.GetDoorInfoList(limit, offset, out infos); }, stepName);
            DoRequestDelay();
            list = infos;
            return(nextReference);
        }
コード例 #6
0
        protected DoorState GetDoorState(string token)
        {
            DoorControlPortClient client = DoorControlPortClient;

            DoorState state = null;

            RunStep(
                () => { state = client.GetDoorState(token); },
                string.Format("Get Door state [token='{0}']", token));
            DoRequestDelay();
            return(state);
        }
コード例 #7
0
 protected void AccessDoor(string token,
     bool? useExtendedTime,
     string accessTime,
     string openTooLongTime,
     string preAlarmTime,
     AccessDoorExtension extension)
 {
     DoorControlPortClient client = DoorControlPortClient;
     string stepName = string.Format("Access Door (token={0})", token);
     RunStep(() => { client.AccessDoor(token, useExtendedTime, accessTime, openTooLongTime, preAlarmTime, extension); }, stepName);
     DoRequestDelay();
 }
コード例 #8
0
        public void DoorControlServiceCapabilitiesConsistencyTest()
        {
            RunTest(() =>
            {
                DoorControlPortClient client = DoorControlPortClient;

                XmlElement capabilitiesElement = GetServiceCapabilities(OnvifService.DOORCONTROL, "Door Control");

                DoorControlServiceCapabilities capabilities = GetDoorControlCapabilities();

                DoorControlServiceCapabilities serviceCapabilities = ParseDoorControlCapabilities(capabilitiesElement);

                CompareCapabilities(serviceCapabilities, capabilities);
            });
        }
コード例 #9
0
        protected List <DoorInfo> GetDoorInfoList()
        {
            DoorControlPortClient client = DoorControlPortClient;

            PACS.GetListMethod <DoorInfo> getList =
                new PACS.GetListMethod <DoorInfo>(
                    (int?limit, string offset, out DoorInfo[] list) =>
            {
                string newOffset = null;
                DoorInfo[] infos = null;
                RunStep(() => { newOffset = client.GetDoorInfoList(limit, offset, out infos); }, "Get DoorInfo list");
                list = infos;
                return(newOffset);
            });

            List <DoorInfo> fullList = PACS.Extensions.GetFullList(getList, null, "DoorInfo", Assert);

            Assert(fullList.Count > 0,
                   "No Doors returned",
                   "Check that the list of Doors is not empty");

            return(fullList);
        }
コード例 #10
0
 protected void DoubleLockDoor(string token)
 {
     DoorControlPortClient client = DoorControlPortClient;
     RunStep(() => { client.DoubleLockDoor(token); }, string.Format("DoubleLock door [token='{0}']", token));
     DoRequestDelay();
 }
コード例 #11
0
 protected void LockOpenReleaseDoor(string token)
 {
     DoorControlPortClient client = DoorControlPortClient;
     RunStep(() => { client.LockOpenReleaseDoor(token); }, string.Format("LockOpenRelease door [token='{0}']", token));
     DoRequestDelay();
 }