Merge remote-tracking branch 'origin/master' into gui3

This commit is contained in:
Alessandro Ranellucci 2017-03-26 15:06:12 +02:00
commit 815141f75e
4 changed files with 5 additions and 3 deletions

View File

@ -126,7 +126,7 @@ sub new {
my $serial_speed_sizer = Wx::BoxSizer->new(wxHORIZONTAL);
{
$self->{serial_speed_combobox} = Wx::ComboBox->new($self, -1, $config->serial_speed, wxDefaultPosition, wxDefaultSize,
["115200", "250000"]);
["57600", "115200", "250000"]);
$self->{serial_speed_combobox}->SetFont($Slic3r::GUI::small_font);
$serial_speed_sizer->Add($self->{serial_speed_combobox}, 0, wxALIGN_CENTER_VERTICAL, 0);
}

View File

@ -238,7 +238,7 @@ sub new {
EVT_LEFT_UP($self->{btn_send_gcode}, sub {
my (undef, $e) = @_;
my $alt = $e->AltDown;
my $alt = $e->ShiftDown;
wxTheApp->CallAfter(sub {
$self->prepare_send($alt);
});

View File

@ -355,6 +355,7 @@ GCodeSender::on_read(const boost::system::error_code& error,
// extract the first number from line
boost::algorithm::trim_left_if(line, !boost::algorithm::is_digit());
size_t toresend = boost::lexical_cast<size_t>(line.substr(0, line.find_first_not_of("0123456789")));
toresend++; // N is 0-based
if (toresend >= this->sent - this->last_sent.size()) {
{
boost::lock_guard<boost::mutex> l(this->queue_mutex);
@ -473,8 +474,8 @@ GCodeSender::do_send()
if (line.empty()) return;
// compute full line
this->sent++;
std::string full_line = "N" + boost::lexical_cast<std::string>(this->sent) + " " + line;
this->sent++;
// calculate checksum
int cs = 0;

View File

@ -1108,6 +1108,7 @@ PrintConfigDef::PrintConfigDef()
def->cli = "serial-speed=i";
def->min = 1;
def->max = 300000;
def->enum_values.push_back("57600");
def->enum_values.push_back("115200");
def->enum_values.push_back("250000");
def->default_value = new ConfigOptionInt(250000);