Пример #1
0
        System.Timers.Timer alertTimer;       //function for whether or not another alert can happen

        public homeServer(string port)
        //public homeServer()
        {
            string temp = port;

            //emailAddress = null;
            alarmLevel = 0;
            canAlert   = true;
            ard        = new arduino(port);
            cam1       = new camera(1, "Camera 1");
            cam2       = new camera(0, "Camera 2");
            web        = new webInterface("sensor_data.xml", ref isDoorLocked, ref ard.sensors);
            email      = new emailInterface();

            ard.dataChange   += changeFromArduino;
            web.dataChange   += changeFromWeb;
            email.dataChange += changeFromEmail;
            cam1.dataChange  += changeFromCamera; //May need to be cam2, depending on which one is facing the door

            //should be able to get rid of this, or at least part of it

            /*
             * Thread serverThread = new Thread(homeServerloop);
             * serverThread.IsBackground = true;
             * serverThread.Start();
             */
        }
Пример #2
0
        public cameraForm(ControlPanelForm parentForm, ref camera cam)
        {
            InitializeComponent();

            // Store pointer to Smart House Control Panel
            // for addressing/accessing cameras
            this.parentForm = parentForm;

            // Inform this form which camera it should look at
            this.cam = cam;

            // Change title of form to be camera specific
            this.Text = this.Text + cam.name;

            // Set feed to fit image to imageBox
            imageBox1.SizeMode = PictureBoxSizeMode.Zoom;

            Application.Idle += getCam;
        }