Beispiel #1
0
        public static void M570SetFilamentUID(GCode gcode, FirmwareController connection)
        {
            EepromAddressInfo eepromInfo = connection.MyPrinterProfile.EEPROMConstants.GetEepromInfo("FilamentUID");

            connection.AddManualCommandToFront("M618 S" + eepromInfo.EepromAddr + " P" + gcode.P + " T" + eepromInfo.Size);
            StandardVirtualCodes.SendOK(connection);
        }
Beispiel #2
0
        public static void M577SetBedOffsets(GCode gcode, FirmwareController connection)
        {
            EepromAddressInfo eepromInfo1 = connection.MyPrinterProfile.EEPROMConstants.GetEepromInfo("ZCalibrationBLO");
            EepromAddressInfo eepromInfo2 = connection.MyPrinterProfile.EEPROMConstants.GetEepromInfo("ZCalibrationBRO");
            EepromAddressInfo eepromInfo3 = connection.MyPrinterProfile.EEPROMConstants.GetEepromInfo("ZCalibrationFRO");
            EepromAddressInfo eepromInfo4 = connection.MyPrinterProfile.EEPROMConstants.GetEepromInfo("ZCalibrationFLO");
            EepromAddressInfo eepromInfo5 = connection.MyPrinterProfile.EEPROMConstants.GetEepromInfo("ZCalibrationZO");
            var stringList = new List <string>();

            if (gcode.HasX && eepromInfo1 != null)
            {
                var int32 = BitConverter.ToInt32(BitConverter.GetBytes(gcode.X), 0);
                stringList.Add("M618 S" + eepromInfo1.EepromAddr + " P" + int32 + " T" + eepromInfo1.Size);
            }
            if (gcode.HasY && eepromInfo2 != null)
            {
                var int32 = BitConverter.ToInt32(BitConverter.GetBytes(gcode.Y), 0);
                stringList.Add("M618 S" + eepromInfo2.EepromAddr + " P" + int32 + " T" + eepromInfo2.Size);
            }
            if (gcode.HasZ && eepromInfo3 != null)
            {
                var int32 = BitConverter.ToInt32(BitConverter.GetBytes(gcode.Z), 0);
                stringList.Add("M618 S" + eepromInfo3.EepromAddr + " P" + int32 + " T" + eepromInfo3.Size);
            }
            if (gcode.HasE && eepromInfo4 != null)
            {
                var int32 = BitConverter.ToInt32(BitConverter.GetBytes(gcode.E), 0);
                stringList.Add("M618 S" + eepromInfo4.EepromAddr + " P" + int32 + " T" + eepromInfo4.Size);
            }
            if (gcode.hasF && eepromInfo5 != null)
            {
                var int32 = BitConverter.ToInt32(BitConverter.GetBytes(gcode.F), 0);
                stringList.Add("M618 S" + eepromInfo5.EepromAddr + " P" + int32 + " T" + eepromInfo5.Size);
            }
            if (connection.CalibrationDetails.UsesCalibrationOffset)
            {
                EepromAddressInfo eepromInfo6 = connection.MyPrinterProfile.EEPROMConstants.GetEepromInfo("CalibrationOffset");
                if (gcode.HasI && eepromInfo6 != null)
                {
                    var int32 = BitConverter.ToInt32(BitConverter.GetBytes(gcode.I), 0);
                    stringList.Add("M618 S" + eepromInfo6.EepromAddr + " P" + int32 + " T" + eepromInfo6.Size);
                }
            }
            if (stringList.Count > 0)
            {
                connection.AddManualCommandToFront(stringList.ToArray());
            }

            StandardVirtualCodes.SendOK(connection);
        }
Beispiel #3
0
        public static void M582SetNozzleWidth(GCode gcode, FirmwareController connection)
        {
            EepromAddressInfo eepromInfo = connection.MyPrinterProfile.EEPROMConstants.GetEepromInfo("NozzleSizeExtrusionWidth");

            if (eepromInfo == null)
            {
                connection.WriteLog(string.Format(">> Error:Printer doesn't have adjustable nozzle."), Logger.TextType.Read);
            }
            else
            {
                connection.AddManualCommandToFront("M618 S" + eepromInfo.EepromAddr + " P" + gcode.S + " T" + eepromInfo.Size);
            }

            StandardVirtualCodes.SendOK(connection);
        }