Patch from Lubomír for CLI parameters

This commit is contained in:
tamasmeszaros 2018-07-03 17:05:09 +02:00
parent 797c812f31
commit 28bc54e5b7
5 changed files with 67 additions and 4 deletions

View file

@ -1253,8 +1253,14 @@ void Print::set_status(int percent, const std::string &message)
}
void Print::print_to_png(std::string dirpath) {
print_to<FilePrinterFormat::PNG>(*this, dirpath, 68.0, 120.0, 1440, 2560,
8.0, 35.0);
print_to<FilePrinterFormat::PNG>(*this,
dirpath,
float(this->config.bed_size_x.value),
float(this->config.bed_size_y.value),
int(this->config.pixel_width.value),
int(this->config.pixel_height.value),
float(this->config.exp_time.value),
float(this->config.exp_time_first.value));
}
}

View file

@ -1877,6 +1877,52 @@ PrintConfigDef::PrintConfigDef()
def->sidetext = L("mm");
def->cli = "z-offset=f";
def->default_value = new ConfigOptionFloat(0);
def = this->add("bed_size_x", coFloat);
def->label = L("Bed size X");
def->category = L("Dwarf");
def->sidetext = L("mm");
def->cli = "bed-size-x=f";
def->default_value = new ConfigOptionFloat(68.);
def = this->add("bed_size_y", coFloat);
def->label = L("Bed size Y");
def->category = L("Dwarf");
def->sidetext = L("mm");
def->cli = "bed-size-y=f";
def->default_value = new ConfigOptionFloat(120.);
def = this->add("pixel_width", coInt);
def->label = L("Picture resolution X");
def->category = L("Dwarf");
def->sidetext = L("px");
def->cli = "pixel-width=i";
def->min = 1;
def->default_value = new ConfigOptionInt(1440);
def = this->add("pixel_height", coInt);
def->label = L("Picture resolution Y");
def->category = L("Dwarf");
def->sidetext = L("px");
def->cli = "pixel-height=i";
def->min = 1;
def->default_value = new ConfigOptionInt(2560);
def = this->add("exp_time", coFloat);
def->label = L("Exposure time");
def->category = L("Dwarf");
def->sidetext = L("s");
def->cli = "exp-time=f";
def->min = 1;
def->default_value = new ConfigOptionFloat(8.);
def = this->add("exp_time_first", coFloat);
def->label = L("Exposure time first layers");
def->category = L("Dwarf");
def->sidetext = L("s");
def->cli = "exp-time-first=f";
def->min = 1;
def->default_value = new ConfigOptionFloat(35.);
}
void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &value)

View file

@ -637,6 +637,12 @@ public:
ConfigOptionFloats wiping_volumes_matrix;
ConfigOptionFloats wiping_volumes_extruders;
ConfigOptionFloat z_offset;
ConfigOptionFloat bed_size_x;
ConfigOptionFloat bed_size_y;
ConfigOptionInt pixel_width;
ConfigOptionInt pixel_height;
ConfigOptionFloat exp_time;
ConfigOptionFloat exp_time_first;
protected:
PrintConfig(int) : GCodeConfig(1) {}
@ -706,6 +712,12 @@ protected:
OPT_PTR(wiping_volumes_matrix);
OPT_PTR(wiping_volumes_extruders);
OPT_PTR(z_offset);
OPT_PTR(bed_size_x);
OPT_PTR(bed_size_y);
OPT_PTR(pixel_width);
OPT_PTR(pixel_height);
OPT_PTR(exp_time);
OPT_PTR(exp_time_first);
}
};

View file

@ -125,7 +125,7 @@ template<> class FilePrinter<FilePrinterFormat::PNG> {
"startdelay = 0\n"
"layerHeight = " + layerh_str + "\n"
"noteInfo = "
"expTime="+expt_str+"+resinType=FTD-IB-Black+layerHeight="
"expTime="+expt_str+"+resinType=generic+layerHeight="
+layerh_str+"+printer=DWARF3\n";
}

View file

@ -261,7 +261,6 @@ public:
*/
void set_print(Print *print) {
printctl = PrintController::create(print);
// printctl->progress_indicator(progress_indicator());
}
/**