Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LibLaserCut
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Elektronikföreningen Admittansen
LibLaserCut
Commits
bdae9449
Commit
bdae9449
authored
9 years ago
by
Thomas Oster
Browse files
Options
Downloads
Plain Diff
Merge pull request #26 from quillford/smoothieboard
Marlin driver
parents
dd808c8f
4eca1174
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/com/t_oster/liblasercut/LibInfo.java
+2
-1
2 additions, 1 deletion
src/com/t_oster/liblasercut/LibInfo.java
src/com/t_oster/liblasercut/drivers/Marlin.java
+110
-0
110 additions, 0 deletions
src/com/t_oster/liblasercut/drivers/Marlin.java
with
112 additions
and
1 deletion
src/com/t_oster/liblasercut/LibInfo.java
+
2
−
1
View file @
bdae9449
...
@@ -46,7 +46,8 @@ public class LibInfo
...
@@ -46,7 +46,8 @@ public class LibInfo
SampleDriver
.
class
,
SampleDriver
.
class
,
ExportSVG
.
class
,
ExportSVG
.
class
,
GenericGcodeDriver
.
class
,
GenericGcodeDriver
.
class
,
SmoothieBoard
.
class
SmoothieBoard
.
class
,
Marlin
.
class
};
};
}
}
}
}
This diff is collapsed.
Click to expand it.
src/com/t_oster/liblasercut/drivers/Marlin.java
0 → 100644
+
110
−
0
View file @
bdae9449
/**
* 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
(
10
);
setPreJobGcode
(
getPreJobGcode
()+
",G28 XY,M3"
);
setPostJobGcode
(
getPostJobGcode
()+
",G0 X0Y0,M5"
);
//Marlin has no way to upload over the network so remove the upload url text
setHttpUploadUrl
(
""
);
setHost
(
""
);
}
@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
);
result
.
remove
(
GenericGcodeDriver
.
SETTING_HTTP_UPLOAD_URL
);
result
.
remove
(
GenericGcodeDriver
.
SETTING_HOST
);
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 identification line ("start"), now we have to skip the rest of Marlin's dump
while
(!(
waitForLine
().
startsWith
(
"echo:SD"
)))
{
//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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment