Exemplo n.º 1
0
        public bool Initialize(ParameterBase Parameters)
        {
            CameraClient.Init();
            this.cameraParameter = Parameters as IPCameraParameter;
            this.cameraClient    = new CameraClient();
            int error = this.cameraClient.Login(this.cameraParameter.Address, this.cameraParameter.Port, this.cameraParameter.UserName, this.cameraParameter.Password, this.cameraParameter.DeviceSpecification, this.cameraParameter.DeviceSN);

            return(error <= 0);
        }
Exemplo n.º 2
0
        public static void SaveParameter(IPCameraParameter Parameter, string ConfigPath)
        {
            string xml = Utility.XmlSerialize(Parameter, null, "utf-8");

            using (FileStream fileStream = new FileStream(ConfigPath, FileMode.Create, FileAccess.Write, FileShare.Write))
            {
                using (StreamWriter streamWriter = new StreamWriter(fileStream))
                {
                    streamWriter.Write(xml);
                }
            }
        }
Exemplo n.º 3
0
        public static IPCameraParameter LoadParameter(string ConfigPath)
        {
            string xml = "";

            IPCameraParameter cameraParameter = null;

            using (FileStream fileStream = new FileStream(ConfigPath, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                using (StreamReader streamReader = new StreamReader(fileStream))
                {
                    xml = streamReader.ReadToEnd();
                }
            }

            cameraParameter = Utility.XmlDeserialize <IPCameraParameter>(xml, null, "utf-8");

            return(cameraParameter);
        }