Exemplo n.º 1
0
        /// <summary>
        /// 发送车道类型到设备
        /// </summary>
        /// <param name="model">车道实体</param>
        /// <param name="count">入口数量</param>
        /// <param name="commandType">业务类型</param>
        /// <returns></returns>
        public bool SendDriveWayType(DrivewayModel model, int entrywayCount, BussineCommand commandType)
        {
            try
            {
                if (model != null)
                {
                    CameraTypeModel sendmodel = new CameraTypeModel()
                    {
                        Type              = (int)model.Type,
                        DeviceIdentify    = model.DeviceMacAddress,
                        ParkingCode       = model.ParkCode,
                        EntrywayCount     = entrywayCount,
                        DeviceEntranceURI = model.DeviceEntranceURI,
                        DeviceAccount     = model.DeviceAccount
                    };
                    CommandEntity <CameraTypeModel> entity = new CommandEntity <CameraTypeModel>()
                    {
                        command = commandType,
                        idMsg   = Convert.ToBase64String(Guid.NewGuid().ToByteArray()),
                        message = sendmodel
                    };
                    string remark = string.Empty;
                    switch (commandType)
                    {
                    case BussineCommand.CameraInfo:
                        remark = "发送相机初始化类型指令命令";
                        break;

                    case BussineCommand.CameraDelete:
                        remark = "发送相机删除类型指令命令";
                        break;

                    default:
                        remark = "发送相机初始化类型指令命令";
                        break;
                    }
                    return(m_rabbitMQ.SendMessageForRabbitMQ(remark, m_serializer.Serialize(entity), entity.idMsg, model.ParkCode, "CameraParkInit", "FuJiCaYunCameraParkInit.fanout"));
                }
            }
            catch (Exception ex)
            {
                m_logger.LogFatal(LoggerLogicEnum.Bussiness, "", model.ParkCode, "", "Fujica.com.cn.Business.ParkLot.DrivewayManager.SendDriveWayType", "下发车道相机类型发生异常", ex.ToString());
            }
            return(false);
        }
Exemplo n.º 2
0
        public void LoadData()
        {
            CameraTypeModel typeModel = new CameraTypeModel()
            {
                TypeId   = "Hikvision",
                TypeName = "Hikvision IP Camera"
            };

            listTypeCamera.Add(typeModel);
            typeModel = new CameraTypeModel()
            {
                TypeId   = "Panasonic",
                TypeName = "Panasonic Ip Camera"
            };
            listTypeCamera.Add(typeModel);
            typeModel = new CameraTypeModel()
            {
                TypeId   = "HdCloud",
                TypeName = "Hd Cloud Ip Camera"
            };
            listTypeCamera.Add(typeModel);
            typeModel = new CameraTypeModel()
            {
                TypeId   = "Other",
                TypeName = "Camera Other"
            };
            listTypeCamera.Add(typeModel);
            cameraType.ItemsSource       = listTypeCamera;
            cameraType.DisplayMemberPath = "TypeName";
            cameraType.SelectedValuePath = "TypeId";

            try
            {
                var rs = serviceUtil.GetCameraAPI();
                if (rs.ServiceBase != null)
                {
                    ServiceBase.Text = rs.ServiceBase;
                    TotalFrame.Text  = rs.TotalFrame.ToString();
                    //Thông tin Queue
                    QueueURL.Text       = rs.QueueURL;
                    AccessKeyName.Text  = rs.AccessKeyName;
                    AccessKeyValue.Text = rs.AccessKeyValue;
                    SBTopicName.Text    = rs.BusTopicName;
                    SBKeySend.Text      = rs.BusKeySend;
                    //Thông tin Azure
                    ASAccountName.Text = rs.AzureName;
                    ASAccountKey.Text  = rs.AzureKey;
                    ASContainer.Text   = rs.AzureContainer;
                    ASUrlHost.Text     = rs.AzureUrlHost;
                    ServerId           = rs.ServerId;
                    IsUpdateApi        = true;
                }
                else
                {
                    IsUpdateApi = false;
                }
                if (rs.ListCamera != null)
                {
                    itemListView.ItemsSource = rs.ListCamera;
                }
            }
            catch (Exception ex)
            {
            }
        }