Exemplo n.º 1
0
        public void diagnosticsFrameButtonCallback(ButtonWidget button)
        {
            PrinterObject selectedPrinter = spooler_connection.SelectedPrinter;

            if (selectedPrinter == null || !selectedPrinter.IsConnected())
            {
                return;
            }

            switch (button.ID)
            {
            case 1000:
                var num1 = (int)selectedPrinter.SendEmergencyStop(null, null);
                break;

            case 1020:
                var num2 = (int)selectedPrinter.DoFirmwareUpdate();
                break;

            case 1021:
                selectedPrinter.SendCommandAutoLockRelease(new M3D.Spooling.Client.AsyncCallback(selectedPrinter.ShowLockError), selectedPrinter, "G28");
                break;

            case 1022:
                var num3 = (int)selectedPrinter.AcquireLock(new M3D.Spooling.Client.AsyncCallback(FastRecenterOnLock), selectedPrinter);
                break;

            case 1023:
                List <string> xspeedTest = TestGeneration.CreateXSpeedTest(selectedPrinter.MyPrinterProfile);
                selectedPrinter.SendCommandAutoLockRelease(new M3D.Spooling.Client.AsyncCallback(selectedPrinter.ShowLockError), selectedPrinter, xspeedTest.ToArray());
                break;

            case 1024:
                List <string> yspeedTest = TestGeneration.CreateYSpeedTest(selectedPrinter.MyPrinterProfile);
                selectedPrinter.SendCommandAutoLockRelease(new M3D.Spooling.Client.AsyncCallback(selectedPrinter.ShowLockError), selectedPrinter, yspeedTest.ToArray());
                break;

            case 1025:
                var num4 = (int)selectedPrinter.AcquireLock(new M3D.Spooling.Client.AsyncCallback(DoBacklashPrintOnLock), selectedPrinter);
                break;

            case 1026:
                List <string> xskipTestMinus = TestGeneration.CreateXSkipTestMinus(selectedPrinter.MyPrinterProfile);
                selectedPrinter.SendCommandAutoLockRelease(new M3D.Spooling.Client.AsyncCallback(selectedPrinter.ShowLockError), selectedPrinter, xskipTestMinus.ToArray());
                break;

            case 1027:
                List <string> xskipTestPlus = TestGeneration.CreateXSkipTestPlus(selectedPrinter.MyPrinterProfile);
                selectedPrinter.SendCommandAutoLockRelease(new M3D.Spooling.Client.AsyncCallback(selectedPrinter.ShowLockError), selectedPrinter, xskipTestPlus.ToArray());
                break;

            case 1028:
                List <string> yskipTestMinus = TestGeneration.CreateYSkipTestMinus(selectedPrinter.MyPrinterProfile);
                selectedPrinter.SendCommandAutoLockRelease(new M3D.Spooling.Client.AsyncCallback(selectedPrinter.ShowLockError), selectedPrinter, yskipTestMinus.ToArray());
                break;

            case 1029:
                List <string> yskipTestPlus = TestGeneration.CreateYSkipTestPlus(selectedPrinter.MyPrinterProfile);
                selectedPrinter.SendCommandAutoLockRelease(new M3D.Spooling.Client.AsyncCallback(selectedPrinter.ShowLockError), selectedPrinter, yskipTestPlus.ToArray());
                break;
            }
        }