Exemple #1
0
        private void LoadSettings()
        {
            if (settings == null)
            {
                settings = new Settings();
            }
            string oldServer = settings.server;

            if (File.Exists("settings.xml"))
            {
                using (FileStream fs = new FileStream("settings.xml", FileMode.OpenOrCreate))
                {
                    settings = (Settings)formatter.Deserialize(fs);
                }
            }

            logName = System.IO.Path.Combine(settings.logPath, logName);
            if (tc != null)
            {
                SetHardware();
                if (oldServer != settings.server)
                {
                    tc.connectToServer(settings.server);
                }
            }
        }
Exemple #2
0
 internal void SetLoginData(string server, string iD, string password)
 {
     this.server   = server;
     this.iD       = iD;
     this.password = password;
     if (!string.IsNullOrEmpty(server) && isStarted)
     {
         sdk.connectToServer(server);
     }
 }
Exemple #3
0
        //------------- Tc_OnXAfterStart -------------//
        //Executed after 'Trueconf' com object started
        private void Tc_OnXAfterStart(object sender, EventArgs e)
        {
            WriteLog("Tc_OnXAfterStart()...");

            try
            {
                string sServer = INI.ReadINI("connection", "server");
                WriteLog("connectToServer: " + sServer);
                //Try connect to server
                tc.connectToServer(sServer);
                //Use camera
                string sCam  = INI.ReadINI("connection", "camera_id");
                int    idCam = System.Convert.ToInt32(sCam);
                WriteLog(String.Format("SetCameraByIndex( {0} )", idCam));
                // Try XSetCameraByIndex
                if (idCam >= 0 && idCam < 100)
                {
                    tc.XSetCameraByIndex(idCam);
                }
            }
            catch
            {
                WriteLog(String.Format("EXCEPTION !!! : connectToServer !!!"));
            }
        }