Ejemplo n.º 1
0
        public VsScanner()
        {
            InitializeComponent();

            // form load handler
            this.Load += new EventHandler(VsMonitor_Load);
            this.Resize += new EventHandler(VsMonitor_Resize);
            this.FormClosing += new FormClosingEventHandler(VsMonitor_FormClosing);

            try
            {
                // new object
                vsCoreMonitor = new VsCoreServer(Path.GetDirectoryName(Application.ExecutablePath));

                // allow to save all configs to files
                vsCoreMonitor.SaveConfigToFile = true;

                // Initial application core
                vsCoreMonitor.VsMonitorInitial();

                VsSplasher.Status = "Load application setting...";
                System.Threading.Thread.Sleep(1500);

                VsSplasher.Close();
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);
            }
        }
Ejemplo n.º 2
0
	    // Construction
		public VsChannelDialog(VsCoreServer vsCore)
		{
			this.AddPage(vsChannelDescription);
			this.AddPage(vsChannelStructure);
			this.Text = "Add Layout";

            vsCoreMonitor = vsCore;
            vsChannelDescription.CoreMonitor = vsCore;
            vsChannelStructure.CoreMonitor = vsCore;
            vsAnalyzerSetting.CoreMonitor = vsCore;
            vsEncoderSetting.CoreMonitor = vsCore;

            this.imagePanel.Visible = false;
		}
Ejemplo n.º 3
0
		// Construction
        public VsCameraPropertiesDialog(VsCoreServer vsCore)
		{
			this.AddPage(vsCameraDescription);
			this.AddPage(vsCameraSetting);
            this.AddPage(vsAnalyzerSetting);
            this.AddPage(vsEncoderSetting);
            this.Text = "Add New Camera";

            // set current core
            vsCoreMonitor = vsCore;
            vsCameraDescription.CoreMonitor = vsCore;
            vsCameraSetting.CoreMonitor = vsCore;
            vsAnalyzerSetting.CoreMonitor = vsCore;
            vsEncoderSetting.CoreMonitor = vsCore;
        }
Ejemplo n.º 4
0
		// Construction
		public VsAnalyzerDialog(VsCoreServer vsCore, VsCamera vsCam)
		{
            this.AddPage(vsAnalyzerSetting);
            vsAnalyzerSetting.CoreMonitor = vsCoreMonitor;
            vsAnalyzerSetting.Camera = vsCam;

            // set current core
            vsCamera = vsCam;
            vsCoreMonitor = vsCore;

            this.Text = "Analyzer";
            this.buttonApply.Visible = true;
            this.backButton.Visible = false;
            this.nextButton.Visible = false;
            this.imagePanel.Visible = false;
        }
Ejemplo n.º 5
0
		// Construction
		public VsCameraDialog(VsCoreServer vsCore)
		{
			this.AddPage(vsCameraDescription);
			this.AddPage(vsCameraSetting);

            this.Text = "Add Analyzer";

            // set current core
            vsCoreMonitor = vsCore;
            vsCameraDescription.CoreMonitor = vsCore;
            vsCameraSetting.CoreMonitor = vsCore;
            vsAnalyzerSetting.CoreMonitor = vsCore;
            vsEncoderSetting.CoreMonitor = vsCore;

            this.imagePanel.Visible = false;
        }
Ejemplo n.º 6
0
        // form close
        void VsMonitor_Close()
        {
            //formState.Restore(this);

            if (vsCoreMonitor != null)
            {
                // disconnect all camera
                vsCoreMonitor.DisconnectCameraAll();

                // Dispose
                vsCoreMonitor.Dispose();

                vsCoreMonitor = null;
            }
        }
Ejemplo n.º 7
0
        // ShutdownServer
        public void ShutdownServer()
        {
            try
            {
                if (this.vsClients != null)
                {
                    SaveSettings();

                    strMsg = String.Format("Shutdown VsServer.");
                    Console.WriteLine(strMsg); SendStatus(strMsg);

                    foreach (ClientManager mngr in this.vsClients) mngr.Disconnect();
                    GC.Collect();

                    this.vsBackgroundListener.CancelAsync();
                    this.vsBackgroundListener.Dispose();
                    this.vsListenerSocket.Close();

                    // mixer stop
                    vsServer.StopAll();
                    vsServer.Dispose();
                    vsServer = null;

                    Console.WriteLine("****VsServer Shutdown.**********************");
                }
            }
            catch (Exception err)
            {
                SendStatus(err.Message);
            }
        }
Ejemplo n.º 8
0
        public VsLive()
        {
            try
            {
                InitializeComponent();

                Vs.Monitor.VsSplasher.Status = "Load application setting...";
                System.Threading.Thread.Sleep(1000);

                Vs.Monitor.VsSplasher.LoginSerivce();

                while (Vs.Monitor.VsSplasher.Blocked) System.Threading.Thread.Sleep(100);


                if (!Vs.Monitor.VsSplasher.Connected)
                {
                    this.Hide();
                    bCancel = true;

                    // this.Close();
                    //VsMonitor_Close();

                    return;
                }
                else
                {
                    //VsSplasher.Close();

                    // form load handler
                    this.Load += new EventHandler(VsMonitor_Load);
                    this.Resize += new EventHandler(VsMonitor_Resize);
                    this.FormClosing += new FormClosingEventHandler(VsMonitor_FormClosing);


                    //Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);

                    // new object
                    string configPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "OpenVss\\VsClient\\"); ;
                    vsCoreMonitor = new VsCoreServer(Path.GetDirectoryName(Application.ExecutablePath));

                    // allow to save all configs to files
                    vsCoreMonitor.SaveConfigToFile = true;

                    // Initial application core
                    vsCoreMonitor.VsMonitorInitial(configPath);
                }
                VsSplasher.Close();
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);
            }
        }