Disabled EEPROM editor for firmwares different from Repetier

This commit is contained in:
NeoTheFox 2015-03-08 18:22:49 +03:00
parent 2c09580633
commit 4b29cc979d
3 changed files with 101 additions and 77 deletions

View File

@ -7,8 +7,13 @@ EEPROMWindow::EEPROMWindow(QStringList eepromLines, QWidget *parent) :
{
ui->setupUi(this);
QSettings settings;
firmware = settings.value("printer/firmware").toInt();
QLayout *layout = new QVBoxLayout();
if(firmware == Repetier)
{
int j = 0;
foreach (QString str, eepromLines)
{
@ -70,8 +75,14 @@ EEPROMWindow::EEPROMWindow(QStringList eepromLines, QWidget *parent) :
j++; // increase counter
}
for(int i = 0; i < lines.size(); i++) changed.append(false);
ui->eepromWidgets->setLayout(layout);
}
else if(firmware == Marlin)
{
}
}
EEPROMWindow::~EEPROMWindow()
@ -81,15 +92,25 @@ EEPROMWindow::~EEPROMWindow()
void EEPROMWindow::lineChanged(QString s)
{
if(firmware == Repetier)
{
int num = sender()->objectName().remove(0, 1).toInt();
lines[num].S = s;
changed[num] = true;
}
else if(firmware == Marlin)
{
}
}
void EEPROMWindow::on_buttonBox_accepted()
{
QStringList gcode;
if(firmware == Repetier)
{
for(int i=0; i < changed.size(); i++)
{
if(changed.at(i))
@ -108,6 +129,11 @@ void EEPROMWindow::on_buttonBox_accepted()
gcode.append(command);
}
}
}
else if(firmware == Marlin)
{
}
emit changesComplete(gcode);
}

View File

@ -24,6 +24,7 @@ private:
Ui::EEPROMWindow *ui;
QVector <repetierEEPROMline> lines;
QVector <bool> changed;
int firmware;
signals:
void changesComplete(QStringList changed);

View File

@ -267,7 +267,7 @@ void MainWindow::serialconnect()
ui->consoleGroup->setDisabled(false);
ui->actionPrint_from_SD->setEnabled(true);
ui->actionSet_SD_printing_mode->setEnabled(true);
if(firmware != OtherFirmware) ui->actionEEPROM_editor->setDisabled(false);
if(firmware == Repetier) ui->actionEEPROM_editor->setDisabled(false);
//if(checkingTemperature) injectCommand("M105");
}
}
@ -708,9 +708,6 @@ void MainWindow::on_actionAbout_triggered()
void MainWindow::injectCommand(QString command)
{
//if(checkingTemperature && command == "M105" && userCommands.contains("M105")) return;
//if(chekingSDStatus && command == "M27" && userCommands.contains("M27")) return;
if(!userCommands.contains(command)) userCommands.enqueue(command);
}
@ -872,7 +869,7 @@ void MainWindow::requestEEPROMSettings()
switch(firmware)
{
case Marlin:
injectCommand("M501");
injectCommand("M503");
break;
case Repetier:
injectCommand("M205");