示例#1
0
        public void Execute(IJobExecutionContext context)
        {
            errorWriting = new ErrorLogging();
            try
            {
                retryCounter += 1;
                errorWriting.WriteErrorLog("iAutoLog Job has started on machine " + Environment.MachineName);
                var configurationCore = new TMT.Core.Camera.Interfaces.Configuration();

                var redRoomConfiguration = new cConfiguration();

                List <cCamera> cameras = redRoomConfiguration.GetCameras(Path.Combine(DefaultPath(), "Config"), "CameraConfig.xml");
                mPhysicalStudio = new cPhysicalStudio();

                // mPhysicalStudio.evFilmAdded += mPhysicalStudioFilmAdded;
                foreach (cCamera abstractCamera in cameras)
                {
                    mPhysicalStudio.Register(abstractCamera);
                }

                ConnectionStringSettings setting = ConfigurationManager.ConnectionStrings["CoreContext"];

                dataAccess = new cDataAccess(setting.ConnectionString);
                errorWriting.WriteErrorLog("Get Server Time.");
                serverDateTime = dataAccess.GetDatabaseDate();

                dataAccess.evNewCaseLoggedError += data_NewCaseLoggedError;

                bool success = dataAccess.getImagePath(Environment.MachineName, out mImagePath);
                if (!success)
                {
                    errorWriting.WriteErrorLog("Invalid Image path. Please check the computer name!");
                }

                errorWriting.WriteErrorLog("StartProcessing");
                StartProcessing();
            }
            catch (Exception ex)
            {
                errorWriting.WriteErrorLog(ex.Message);
                if (retryCounter <= 2)
                {
                    Thread.Sleep(60000);
                    Execute(context);
                }
            }
        }
示例#2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            mTree = new FileSystemTreeView();
            mTree.FolderSelected += tree_FolderSelected;
            treePanel.Controls.Add(mTree);
            mTree.Dock          = DockStyle.Fill;
            mTree.HideSelection = false;

            mUserId    = -1;
            mImagePath = "";

            lblVersion.Text = "Version " + Assembly.GetAssembly(typeof(MainForm)).GetName().Version.ToString();

#if (DEBUG)
            txtMachineName.Text = "HONB-RICHARDT";
#else
            txtMachineName.Text = Environment.MachineName;
#endif
            var configurationCore = new TMT.Core.Camera.Interfaces.Configuration();

            var redRoomConfiguration = new cConfiguration();

            List <cCamera> cameras = redRoomConfiguration.GetCameras(Path.Combine(DefaultPath(), "Config"), "CameraConfig.xml");
            mPhysicalStudio              = new cPhysicalStudio();
            mPhysicalStudio.evFilmAdded += mPhysicalStudioFilmAdded;
            foreach (cCamera abstractCamera in cameras)
            {
                mPhysicalStudio.Register(abstractCamera);
            }

            dateTimePickerFilterAfter.Value = DateTime.Now.Subtract(new TimeSpan(1, 0, 0, 0));

            resetForm();

            if (App.AuthenticatedUser != null)
            {
                btnLoginLogout.PerformClick();
            }
        }