Beispiel #1
0
        private static void CancelStartupAndCloseDown()
        {
            if (applicationHelpers.ProcessIsRunning(MeatMaster2UiItems.Mm2ProcessName))
            {
                logger.LogInfo("Ui process is running.");

                while (!applicationHelpers.WindowIsVisible(MeatMaster2UiItems.Mm2ProcessName, MeatMaster2UiItems.Mm2MainWindowName))
                {
                    logger.LogInfo("Waiting for window {0}", MeatMaster2UiItems.Mm2MainWindowName);
                    Thread.Sleep(TimeSpan.FromSeconds(10));
                }

                logger.LogInfo("MeatMaster mainwindow is visible.");

                MeatMaster2Functions functions = new MeatMaster2Functions();

                functions.CancelStartup(TimeSpan.FromSeconds(10));

                functions.CloseDown();

                logger.LogInfo("Shutting down in 1 min...");

                Thread.Sleep(TimeSpan.FromMinutes(1));
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            string novaPath = @"C:\Program Files (x86)\FOSS\MeatMaster II\FOSS.Nova.UI.Antonius.Core.exe";
            MeatMaster2Functions helper;

            applicationHelpers = new ApplicationHelpers();

            while (true)
            {
                applicationHelpers.StartApplication(novaPath);
                WaitForNovaWindow();
                helper = new MeatMaster2Functions();

                //helper.HandleInstrumentDiagnostic();

                helper.CancelStartup(TimeSpan.FromSeconds(60));
                helper.SelectProduct("Reference");
                helper.ClickStartStopButton();
                helper.WaitForReference();

                helper.ClickApplicationswitchButton();

                applicationHelpers.KillProcess(UiItems.MantaProcessname);
                applicationHelpers.KillProcess(MeatMaster2UiItems.Mm2ProcessName);

                Thread.Sleep(TimeSpan.FromMinutes(5));
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            MeatMaster2Functions functions = new MeatMaster2Functions();

            while (true)
            {
                functions.StartDiagnostics();
                functions.GetDiagnosticsResult();
                functions.SwitchOffXray();
            }
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            MeatMaster2Functions functions = new MeatMaster2Functions();

            Random random = new Random();

            //int.Parse(Enumerable.FirstOrDefault<string>((IEnumerable<string>) args) ?? "120");
            while (true)
            {
                int secondsToWait = 3600 + random.Next(7200);
                functions.ClickStartStopButton();
                WaitHelpers.WaitSeconds(secondsToWait);
            }
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            MeatMaster2Functions functions = new MeatMaster2Functions();

            int csCounter = 0;

            while (true)
            {
                csCounter++;
                functions.ClickStartStopButton();
                Functions.logger.LogInfo("Running CS no {0}", csCounter);

                functions.StartAndWaitForCheckSample(25);
            }
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            MeatMaster2Functions helper = new MeatMaster2Functions();
            Logger logger = new Logger();

            int i = 0;

            while (true)
            {
                i++;

                helper.ClickStartStopButton();

                helper.WaitForReference();

                logger.LogInfo($"Reference number {i} done.");

                Thread.Sleep(TimeSpan.FromMinutes(30));
            }
        }
Beispiel #7
0
        private static void Main(string[] args)
        {
            ServiceCheck         serviceCheck       = new ServiceCheck();
            ApplicationHelpers   applicationHelpers = new ApplicationHelpers();
            MeatMaster2Functions functions          = new MeatMaster2Functions();

            Functions.logger.LogInfo("Program is starting.");

            serviceCheck.WaitForServiceToStart(ServiceCheck.ServiceManagerServiceName, 10);

            WaitHelpers.WaitFor(() => applicationHelpers.ProcessIsRunning(MeatMaster2UiItems.Mm2ProcessName),
                                TimeSpan.FromMinutes(15));

            DatabaseHelpers.DeleteLastDataMaintenanceDate();

            functions.CancelStartup();

            functions.CloseDown(false);

            applicationHelpers.RestartWindows();
        }