Ejemplo n.º 1
0
        public VsPage(string pageName, long syncTimer)
        {
            try
            {
                this.pageName = pageName;
                this.bStream  = false;

                this.syncTimer = syncTimer;

                // Streamer
                vsStreamer   = new VsStreamer(syncTimer, 320, 240, 74);
                streamerSize = new Size(320, 240);

                // timer
                //tcallback = new TimerCallback(process_NewFrame);
                // define the dueTime and period
                //long dTime = 1000;           // wait before the first tick (in ms)
                // instantiate the Timer object
                //timer = new Timer(tcallback, null, dTime, syncTimer);
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
            }
        }
Ejemplo n.º 2
0
        // destructor
        public void Dispose()
        {
            try
            {
                if (vsStreamer != null)
                {
                    vsStreamer.Dispose();
                    vsStreamer = null;
                }

                if (vsEventAlert != null)
                {
                    vsEventAlert.Dispose();
                    vsEventAlert = null;
                }

                if (vsDataAlert != null)
                {
                    vsDataAlert.Dispose();
                    vsDataAlert = null;
                }

                // stop process
                if (timer != null)
                {
                    timer.Dispose();
                    timer = null;
                }
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
            }
        }
Ejemplo n.º 3
0
        // Constructor
        public VsChannel()
        {
            try
            {
                this.channelName = "";
                this.bStream     = false;

                syncTimer = 100;

                // Streamer
                vsStreamer   = new VsStreamer(syncTimer);
                streamerSize = new Size(Width, Height);

                // timer
                tcallback = new TimerCallback(process_NewFrame);
                // define the dueTime and period
                //long dTime = 1000;           // wait before the first tick (in ms)
                // instantiate the Timer object
                //timer = new Timer(tcallback, null, dTime, syncTimer);
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
            }
        }
Ejemplo n.º 4
0
        public VsCamera(string camName, long syncTimer)
        {
            try
            {
                // camera
                this.camName   = camName;
                this.syncTimer = syncTimer;

                // action
                this.bPreview    = true;
                this.bStream     = false;
                this.bAnalysis   = false;
                this.bRecord     = false;
                this.bDataAlert  = false;
                this.bEventAlert = false;

                // Streamer
                vsStreamer = new VsStreamer(syncTimer, 320, 240, 74);

                // Data Generator
                vsDataAlert = new VsDataGenerator(syncTimer, dbHost, dbUser, dbPasswd, dbDatabase);

                // Event Generator
                vsEventAlert = new VsEventGenerator(syncTimer, dbHost, dbUser, dbPasswd, dbDatabase);

                // syncronized queue
                imgBuffer = Queue.Synchronized(new Queue());

                // timer
                tcallback = new TimerCallback(process_NewFrame);

                // define the dueTime and period
                long dTime = 1000;           // wait before the first tick (in ms)
                // instantiate the Timer object
                timer = new Timer(tcallback, null, dTime, syncTimer);
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
            }
        }
Ejemplo n.º 5
0
        // destructor
        public void Dispose()
        {
            try
            {
                if (vsStreamer != null)
                {
                    vsStreamer.Dispose();
                    vsStreamer = null;
                }

                // stop process
                if (timer != null)
                {
                    timer.Dispose();
                    timer = null;
                }
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
            }
        } 
Ejemplo n.º 6
0
        public VsChannel(string channelName, long syncTimer, int streamWidth, int streamHeight, int streamQuality)
        {
            try
            {
                this.channelName = channelName;
                this.bStream = false;
                this.syncTimer = syncTimer;

                // Streamer 
                vsStreamer = new VsStreamer(syncTimer, streamWidth, streamHeight, streamQuality);
                streamerSize = new Size(streamWidth, streamHeight);

                // timer
                tcallback = new TimerCallback(process_NewFrame);
                // define the dueTime and period 
                //long dTime = 1000;           // wait before the first tick (in ms) 
                // instantiate the Timer object 
                //timer = new Timer(tcallback, null, dTime, syncTimer);
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
            }
        }
Ejemplo n.º 7
0
        public VsPage(string pageName, long syncTimer)
        {
            try
            {
                this.pageName = pageName;
                this.bStream = false;

                this.syncTimer = syncTimer;

                // Streamer 
                vsStreamer = new VsStreamer(syncTimer, 320, 240, 74);
                streamerSize = new Size(320, 240);

                // timer
                //tcallback = new TimerCallback(process_NewFrame);
                // define the dueTime and period 
                //long dTime = 1000;           // wait before the first tick (in ms) 
                // instantiate the Timer object 
                //timer = new Timer(tcallback, null, dTime, syncTimer);
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
            }
        }
Ejemplo n.º 8
0
        public VsCamera(int camID, string camName, string camDesp,
                        long syncTimer,
                        string pcHost, string pcDirt,
                        string dbHost, string dbUser, string dbPasswd, string dbDatabase,
                        string smtpHost, string smtpUser, string smtpPasswd, string emailFrom, string emailTo,
                        bool bPreview, bool bStream, bool bAnalysis, bool bRecord, bool bEventAlert, bool bDataAlert, bool bMailAlert)
        {
            try
            {
                // camera
                this.camID     = camID;
                this.camName   = camName;
                this.camDesp   = camDesp;
                this.syncTimer = syncTimer;

                // local host
                this.pcHost = pcHost;
                this.pcDirt = pcDirt;

                // data host
                this.dbHost     = dbHost;
                this.dbUser     = dbUser;
                this.dbPasswd   = dbPasswd;
                this.dbDatabase = dbDatabase;

                // mail host
                this.smtpHost   = smtpHost;
                this.smtpUser   = smtpUser;
                this.smtpPasswd = smtpPasswd;
                this.emailFrom  = emailFrom;
                this.emailTo    = emailTo;

                // action
                this.bPreview    = bPreview;
                this.bStream     = bStream;
                this.bAnalysis   = bAnalysis;
                this.bRecord     = bRecord;
                this.bDataAlert  = bDataAlert;
                this.bEventAlert = bEventAlert;
                this.bEmailAlert = bMailAlert;

                // Streamer
                vsStreamer = new VsStreamer(syncTimer, 320, 240, 74);

                // Data Generator
                vsDataAlert = new VsDataGenerator(syncTimer, dbHost, dbUser, dbPasswd, dbDatabase);

                // Event Generator
                vsEventAlert = new VsEventGenerator(syncTimer, dbHost, dbUser, dbPasswd, dbDatabase);

                // Email Generation
                vsEmailAlert = new VsEmailGenerator(syncTimer, smtpHost, smtpUser, smtpPasswd, emailFrom, emailTo);

                // syncronized queue
                imgBuffer = Queue.Synchronized(new Queue());

                // timer
                tcallback = new TimerCallback(process_NewFrame);

                // define the dueTime and period
                long dTime = 1000;           // wait before the first tick (in ms)
                // instantiate the Timer object
                timer = new Timer(tcallback, null, dTime, syncTimer);
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
            }
        }
Ejemplo n.º 9
0
        public VsCamera(int camID, string camName, string camDesp,
            long syncTimer,
            string pcHost, string pcDirt,
            string dbHost, string dbUser, string dbPasswd, string dbDatabase,
            string smtpHost, string smtpUser, string smtpPasswd, string emailFrom, string emailTo,
            bool bPreview, bool bStream, bool bAnalysis, bool bRecord, bool bEventAlert, bool bDataAlert, bool bMailAlert)
        {
            try
            {
                // camera
                this.camID = camID;
                this.camName = camName;
                this.camDesp = camDesp;
                this.syncTimer = syncTimer;

                // local host
                this.pcHost = pcHost;
                this.pcDirt = pcDirt;

                // data host
                this.dbHost = dbHost;
                this.dbUser = dbUser;
                this.dbPasswd = dbPasswd;
                this.dbDatabase = dbDatabase;

                // mail host
                this.smtpHost = smtpHost;
                this.smtpUser = smtpUser;
                this.smtpPasswd = smtpPasswd;
                this.emailFrom = emailFrom;
                this.emailTo = emailTo;

                // action
                this.bPreview = bPreview;
                this.bStream = bStream;
                this.bAnalysis = bAnalysis;
                this.bRecord = bRecord;
                this.bDataAlert = bDataAlert;
                this.bEventAlert = bEventAlert;
                this.bEmailAlert = bMailAlert;

                // Streamer 
                vsStreamer = new VsStreamer(syncTimer, 320, 240, 74);

                // Data Generator 
                vsDataAlert = new VsDataGenerator(syncTimer, dbHost, dbUser, dbPasswd, dbDatabase);

                // Event Generator
                vsEventAlert = new VsEventGenerator(syncTimer, dbHost, dbUser, dbPasswd, dbDatabase);

                // Email Generation
                vsEmailAlert = new VsEmailGenerator(syncTimer, smtpHost, smtpUser, smtpPasswd, emailFrom, emailTo);

                // syncronized queue
                imgBuffer = Queue.Synchronized(new Queue());

                // timer
                tcallback = new TimerCallback(process_NewFrame);

                // define the dueTime and period 
                long dTime = 1000;           // wait before the first tick (in ms) 
                // instantiate the Timer object 
                timer = new Timer(tcallback, null, dTime, syncTimer);
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
            }
        }
Ejemplo n.º 10
0
        public VsCamera(string camName, long syncTimer)
        {
            try
            {
                // camera
                this.camName = camName;
                this.syncTimer = syncTimer;

                // action
                this.bPreview = true;
                this.bStream = false;
                this.bAnalysis = false;
                this.bRecord = false;
                this.bDataAlert = false;
                this.bEventAlert = false;

                // Streamer 
                vsStreamer = new VsStreamer(syncTimer, 320, 240, 74);

                // Data Generator 
                vsDataAlert = new VsDataGenerator(syncTimer, dbHost, dbUser, dbPasswd, dbDatabase);

                // Event Generator
                vsEventAlert = new VsEventGenerator(syncTimer, dbHost, dbUser, dbPasswd, dbDatabase);

                // syncronized queue
                imgBuffer = Queue.Synchronized(new Queue());

                // timer
                tcallback = new TimerCallback(process_NewFrame);

                // define the dueTime and period 
                long dTime = 1000;           // wait before the first tick (in ms) 
                // instantiate the Timer object 
                timer = new Timer(tcallback, null, dTime, syncTimer);
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);;
            }
        }