Skip to content
Snippets Groups Projects
Commit 2c3e1e0c authored by quillford's avatar quillford
Browse files

added marlin profile

parent 0fcd129a
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,8 @@ public class LibInfo
SampleDriver.class,
ExportSVG.class,
GenericGcodeDriver.class,
SmoothieBoard.class
SmoothieBoard.class,
Marlin.class
};
}
}
/**
* This file is part of LibLaserCut.
* Copyright (C) 2011 - 2014 Thomas Oster <mail@thomas-oster.de>
*
* LibLaserCut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LibLaserCut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with LibLaserCut. If not, see <http://www.gnu.org/licenses/>.
*
**/
package com.t_oster.liblasercut.drivers;
import com.t_oster.liblasercut.drivers.GenericGcodeDriver;
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
/**
* This class implements a driver for the laser cutter fork of Marlin.
*
* @author quillford
*/
public class Marlin extends GenericGcodeDriver {
public Marlin()
{
//set some Marlin specific defaults
setIdentificationLine("start");
setWaitForOKafterEachLine(true);
setBaudRate(115200);
setLineend("CRLF");
setInitDelay(0);
setPreJobGcode(getPreJobGcode()+",G28 XY,M5");
setPostJobGcode(getPostJobGcode()+",G28 XY,M5");
//Marlin has no way to upload over the network so remove the upload url text
setHttpUploadUrl("");
}
@Override
public String getIdentificationLine()
{
return("start");
}
@Override
public String[] getPropertyKeys()
{
List<String> result = new LinkedList<String>();
result.addAll(Arrays.asList(super.getPropertyKeys()));
result.remove(GenericGcodeDriver.SETTING_IDENTIFICATION_STRING);
result.remove(GenericGcodeDriver.SETTING_WAIT_FOR_OK);
result.remove(GenericGcodeDriver.SETTING_BAUDRATE);
result.remove(GenericGcodeDriver.SETTING_LINEEND);
result.remove(GenericGcodeDriver.SETTING_INIT_DELAY);
return result.toArray(new String[0]);
}
/**
* Waits for the Identification line and returns null if it's alright
* Otherwise it returns the wrong line
* @return
* @throws IOException
*/
@Override
protected String waitForIdentificationLine() throws IOException
{
if (getIdentificationLine() != null && getIdentificationLine().length() > 0)
{
String line = waitForLine();
if (line.startsWith(getIdentificationLine()))
{//we received the first "start", now we have to skip the rest
while(!(waitForLine().startsWith("echo:SD init fail")))
{
//do nothing and wait until Marlin has dumped all of the settings
}
return null;
}
}
return null;
}
@Override
public String getModelName()
{
return "Marlin";
}
@Override
public Marlin clone()
{
Marlin clone = new Marlin();
clone.copyProperties(this);
return clone;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment