Esempio n. 1
0
        public void OnUserSelection(PopupMessageBox.PopupResult result, MessageType type, PrinterSerialNumber sn, object data)
        {
            PrinterObject printerBySerialNumber = GetPrinterBySerialNumber(sn.ToString());

            if (printerBySerialNumber == null || type != MessageType.WarningABSPrintLarge || (printerBySerialNumber == null || !printerBySerialNumber.IsConnected()))
            {
                return;
            }

            if (result == PopupMessageBox.PopupResult.Button1_YesOK)
            {
                var num1 = (int)printerBySerialNumber.ClearCurrentWarning(null, null);
            }
            else
            {
                var num2 = (int)printerBySerialNumber.AbortPrint(null, null);
            }
        }
Esempio n. 2
0
 private void OnSelectedPrinterChanged(PrinterSerialNumber serial_number)
 {
     CheckAccessoriesAvailability(m_oSpoolerConnection.GetPrinterBySerialNumber(serial_number.ToString()));
 }
Esempio n. 3
0
        private void BootLoaderStartup()
        {
            FirmwareDetails firmware = MyPrinterProfile.ProductConstants.FirmwareList['M'];

            if (mInterfaceVersion == BootloaderController.BootloaderInterfaceVersion.V2)
            {
                SetBootloader('M');
            }

            MyPrinterInfo.hardware.machine_type = "The_Micro";
            var eepromMapping = new EEPROMMapping(m_oBootloaderConnection.ReadAllReadableEEPROM(), MyPrinterProfile.EEPROMConstants);
            var flag          = false;
            var str           = "";

            byte[] bytesFromLocation = eepromMapping.GetBytesFromLocation("SerialNumber", 16);
            for (var index = 0; index < 16; ++index)
            {
                if (bytesFromLocation[index] == byte.MaxValue)
                {
                    flag = true;
                }

                str += ((char)bytesFromLocation[index]).ToString();
            }
            if (flag)
            {
                BroadcastServer.BroadcastMessage(new SpoolerMessage(MessageType.UserDefined, MySerialNumber, "There was a major error in your printer. Please reset the printer. If the problem persist, contact M3D.").Serialize());
                Status = PrinterStatus.Error_PrinterNotAlive;
            }
            else
            {
                MySerialNumber = new PrinterSerialNumber(str);
                foreach (IFirstRunUpdater updater in MyPrinterProfile.FirstRunConstants.updater_list)
                {
                    updater.CheckForUpdate(str, eepromMapping.GetAllEEPROMData(), m_oBootloaderConnection, MyPrinterProfile);
                }

                logger.ResetWithSerialNumber(MySerialNumber.ToString());
                LoadPersistantData();
                PersistantDetails.hours_used     = eepromMapping.GetFloat("HoursCounterSpooler");
                HardwareDetails.firmware_version = eepromMapping.GetUInt32("FirmwareVersion");
                PersistantData.RestartOptions restartOptions = PersistantDetails.PopRestartAction();
                SavePersistantData();
                CurrentBootloaderStep = BootloaderController.BootLoaderStep.CheckFirmware;
                if (restartOptions.RestartAction == PersistantData.RestartAction.SetExtruderCurrent)
                {
                    SetExtruderCurrent((ushort)restartOptions.RestartActionParam);
                }
                else if (restartOptions.RestartAction == PersistantData.RestartAction.SetFan)
                {
                    SetFanConstants((FanConstValues.FanType)restartOptions.RestartActionParam);
                }
                else if (restartOptions.RestartAction == PersistantData.RestartAction.ForceStayBootloader)
                {
                    Status = PrinterStatus.Bootloader_Ready;
                    CurrentBootloaderStep = BootloaderController.BootLoaderStep.Waiting;
                }
                else
                {
                    if (restartOptions.RestartAction != PersistantData.RestartAction.ForceUpdateFirmware)
                    {
                        return;
                    }

                    CurrentBootloaderStep = BootloaderController.BootLoaderStep.ForceFirmwareUpdate;
                }
            }
        }