Example #1
0
 public JobParams(string gcodefile, string jobname, string preview_image_file_name, FilamentSpool.TypeEnum filament_type, float estimatedTime, float estimatedFilamentNeeded)
 {
     jobMode        = JobParams.Mode.DirectPrinting;
     this.gcodefile = gcodefile;
     this.jobname   = jobname;
     this.preview_image_file_name = preview_image_file_name;
     this.filament_type           = filament_type;
     this.estimatedTime           = estimatedTime;
     this.estimatedFilamentNeeded = estimatedFilamentNeeded;
     options = new JobOptions
     {
         use_raft_DetailOnly                 = true,
         wipe_tower                          = false,
         ooze_shield                         = false,
         autostart_ignorewarnings            = false,
         use_wave_bonding                    = false,
         dont_use_preprocessors              = false,
         use_support_DetailOnly              = false,
         calibrate_before_print              = false,
         turn_on_fan_before_print            = false,
         bounds_check_xy                     = true,
         quality_layer_resolution_DetailOnly = 0,
         fill_density_DetailOnly             = 0
     };
     filament_temperature = 0;
     preprocessor         = new FilamentPreprocessorData();
     jobGuid   = Guid.NewGuid().ToString();
     autoprint = false;
 }
Example #2
0
        public void SetUntetheredOptions(bool allow_untethered, JobParams.Mode defaultmode)
        {
            if (!allow_untethered)
            {
                groupBoxSDCard.Enabled = false;
            }
            else
            {
                groupBoxSDCard.Enabled = true;
                switch (defaultmode)
                {
                case JobParams.Mode.SavingToSDCard:
                    comboBoxJobMode.SelectedIndex = 1;
                    break;

                case JobParams.Mode.SavingToSDCardAutoStartPrint:
                    comboBoxJobMode.SelectedIndex = 2;
                    break;

                default:
                    comboBoxJobMode.SelectedIndex = 0;
                    break;
                }
            }
        }
Example #3
0
 public JobParams()
 {
     options      = new JobOptions();
     preprocessor = new FilamentPreprocessorData();
     jobGuid      = Guid.NewGuid().ToString();
     jobMode      = JobParams.Mode.DirectPrinting;
     outputfile   = null;
 }
Example #4
0
 public JobParams(JobParams other)
 {
     options                 = new JobOptions(other.options);
     preprocessor            = new FilamentPreprocessorData(other.preprocessor);
     jobGuid                 = other.jobGuid;
     jobMode                 = other.jobMode;
     outputfile              = other.outputfile;
     autoprint               = other.autoprint;
     estimatedFilamentNeeded = other.estimatedFilamentNeeded;
     estimatedTime           = other.estimatedTime;
     filament_temperature    = other.filament_temperature;
     filament_type           = other.filament_type;
     gcodefile               = other.gcodefile;
     preview_image_file_name = other.preview_image_file_name;
 }
Example #5
0
        public bool VerifyOptionsWithPrinter(PrinterProfile profile, PrinterInfo printerInfo)
        {
            var flag1 = true;

            if (jobMode == JobParams.Mode.ReconnectToSDPrint)
            {
                throw new NotImplementedException("ReconnectToSDPrint jobs can only be started directly from the FirmwareController.");
            }

            if (options.calibrate_before_print && printerInfo.supportedFeatures.UsesSupportedFeatures && !printerInfo.supportedFeatures.Available("Single Point Bed Height Calibration", profile.SupportedFeaturesConstants))
            {
                flag1 = false;
                options.calibrate_before_print = false;
            }
            if (options.use_heated_bed)
            {
                var num   = profile.AccessoriesConstants.HeatedBedConstants.HasBuiltinHeatedBed ? 1 : 0;
                var flag2 = false;
                if (num != 0 && printerInfo.supportedFeatures.UsesSupportedFeatures)
                {
                    flag2 = printerInfo.supportedFeatures.Available("Heated Bed Control", profile.SupportedFeaturesConstants);
                }

                if (num == 0 || !flag2)
                {
                    flag1 = false;
                    options.use_heated_bed = false;
                }
            }
            if (jobMode != JobParams.Mode.DirectPrinting && printerInfo.supportedFeatures.UsesSupportedFeatures && !printerInfo.supportedFeatures.Available("Untethered Printing", profile.SupportedFeaturesConstants))
            {
                jobMode = JobParams.Mode.DirectPrinting;
            }

            return(flag1);
        }
Example #6
0
        public static PrintOptions GetOptions(FilamentSpool info, bool allow_untethered, JobParams.Mode defaultmode)
        {
            var manualPrintOptions = new ManualPrintOptions();

            manualPrintOptions.SetUntetheredOptions(allow_untethered, defaultmode);
            if (info != null)
            {
                manualPrintOptions.SelectFilament(info.filament_type);
                manualPrintOptions.textBoxFilamentTemp.Text = info.filament_temperature.ToString();
            }
            else
            {
                manualPrintOptions.SelectFilament(FilamentSpool.TypeEnum.PLA);
            }

            manualPrintOptions.groupBox1.Enabled           = false;
            manualPrintOptions.textBoxFilamentTemp.Enabled = false;
            manualPrintOptions.groupBox3.Enabled           = false;
            var num = (int)manualPrintOptions.ShowDialog();

            if (!manualPrintOptions.ok)
            {
                PrintOptions options = manualPrintOptions.options;
                options.type = FilamentSpool.TypeEnum.OtherOrUnknown;
                manualPrintOptions.options = options;
            }
            return(manualPrintOptions.options);
        }