Esempio n. 1
0
        public static void CreateConnectionConfigData()
        {
            if (File.Exists("config.dat"))
            {
                Logger.WriteLine("Loading config file...");
                BinaryFormatter bf = new BinaryFormatter();
                FileStream fs = new FileStream("config.dat", FileMode.Open);
                fs.Seek(0, SeekOrigin.Begin);
                try
                {
                    _conf = (ConnectionConfigData)bf.Deserialize(fs);
                    Logger.WriteLine("Config file loaded !");
                }
                catch(Exception e)
                {
                    Logger.WriteLine("Error loading config file !");
                    Logger.WriteError(e);
                    _conf = new ConnectionConfigData();
                }

                fs.Close();
            }
            else
            {
                Logger.WriteLine("Config file not found !");
                _conf = new ConnectionConfigData();
            }
        }
Esempio n. 2
0
 public ConfigConnectionForm()
 {
     InitializeComponent();
     configData = ConnectionConfigData.Get();
     edtAddress.Text = configData.Address;
     edtUsername.Text = configData.UserName;
     edtPassword.Text = configData.Password;
     chk640.Checked = configData.HighResolution;
 }
Esempio n. 3
0
 public CameraController(ConnectionConfigData configuration)
 {
     Logger.WriteLine("Creating camera controller..");
     this._conf = configuration;
     Logger.WriteLine("Creating work thread..");
     workerThread = new Thread(doWork);
     jobEvent = new AutoResetEvent(false);
     stopEvent = new ManualResetEvent(false);
     Logger.WriteLine("Starting work thread..");
     workerThread.Start();
 }
Esempio n. 4
0
        public CameraRecorder(ConnectionConfigData conf, string path, double fps)
        {
            this.address = "http://"+conf.Address;
            this.path = path;
            this.fps = fps;

            stream = new MJPEGStream("http://"+ address + "/image?speed=0");
            stream.NewFrame += newFrameEvent;
            startRecord(path, (int)fps);
            stream.Login = conf.UserName;
            stream.Password = conf.Password;
            stream.Start();
        }
Esempio n. 5
0
        public static void CreateConnectionConfigData()
        {
            if (File.Exists("config.dat"))
            {
                Logger.WriteLine("Loading config file...");
                BinaryFormatter bf = new BinaryFormatter();
                FileStream fs = new FileStream("config.dat", FileMode.Open);
                fs.Seek(0, SeekOrigin.Begin);
                try
                {
                    _configuration = (ConnectionConfigDataList)bf.Deserialize(fs);
                    Logger.WriteLine("Config file loaded !");
                }
                catch (Exception e)
                {
                    Logger.WriteLine("Error loading config file !");
                    Logger.WriteError(e);
                    _configuration = new ConnectionConfigDataList();
                }

                fs.Close();
            }
            else
            {
                Logger.WriteLine("Config file not found !");
                _configuration = new ConnectionConfigDataList();

                ConnectionConfigData a = new ConnectionConfigData();
                a.Address = "10.10.30.5";
                a.UserName = "******";
                a.Password = "******";
                a.Path = "c:\\";

                _configuration.confList.Add(a);

            }
        }
Esempio n. 6
0
 public void Add(ConnectionConfigData conf)
 {
     confList.Add(conf);
     Save();
 }
Esempio n. 7
0
 public MainForm()
 {
     InitializeComponent();
     conf = ConnectionConfigData.Get();
     camController = new CameraController(conf);
 }
Esempio n. 8
0
 public FOSCAMController(ConnectionConfigData configuration)
     :base(configuration)
 {
 }