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
68ed7c9a
Commit
68ed7c9a
authored
9 years ago
by
Thomas Oster
Browse files
Options
Downloads
Patches
Plain Diff
Added Option to Wait after serial connect (Grbl only)
parent
7fe600e5
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/drivers/GenericGcodeDriver.java
+37
-3
37 additions, 3 deletions
src/com/t_oster/liblasercut/drivers/GenericGcodeDriver.java
src/com/t_oster/liblasercut/drivers/SmoothieBoard.java
+2
-0
2 additions, 0 deletions
src/com/t_oster/liblasercut/drivers/SmoothieBoard.java
with
39 additions
and
3 deletions
src/com/t_oster/liblasercut/drivers/GenericGcodeDriver.java
+
37
−
3
View file @
68ed7c9a
...
...
@@ -56,10 +56,11 @@ public class GenericGcodeDriver extends LaserCutter {
protected
static
final
String
SETTING_PRE_JOB_GCODE
=
"Pre-Job GCode (comma separated)"
;
protected
static
final
String
SETTING_POST_JOB_GCODE
=
"Post-Job GCode (comma separated)"
;
protected
static
final
String
SETTING_RESOLUTIONS
=
"Supported DPI (comma separated)"
;
protected
static
final
String
SETTING_IDENTIFICATION_STRING
=
"Board Identification String"
;
protected
static
final
String
SETTING_IDENTIFICATION_STRING
=
"Board Identification String
(startsWith)
"
;
protected
static
final
String
SETTING_WAIT_FOR_OK
=
"Wait for OK after each line (interactive mode)"
;
protected
static
final
String
SETTING_INIT_DELAY
=
"Seconds to wait for board reset (Serial)"
;
private
String
lineend
=
"
\r\n
"
;
private
String
lineend
=
"
LF
"
;
public
String
getLineend
()
{
...
...
@@ -174,6 +175,22 @@ public class GenericGcodeDriver extends LaserCutter {
return
"Generic GRBL GCode Driver"
;
}
/**
* Time to wait before firsts reads of serial port.
* See autoreset feature on arduinos.
*/
protected
int
initDelay
=
5
;
public
int
getInitDelay
()
{
return
initDelay
;
}
public
void
setInitDelay
(
int
initDelay
)
{
this
.
initDelay
=
initDelay
;
}
protected
String
host
=
"10.10.10.222"
;
public
String
getHost
()
...
...
@@ -380,6 +397,18 @@ public class GenericGcodeDriver extends LaserCutter {
}
out
=
new
PrintStream
(
port
.
getOutputStream
(),
true
,
"US-ASCII"
);
in
=
new
BufferedReader
(
new
InputStreamReader
(
port
.
getInputStream
()));
// Wait 5 seconds since GRBL is long to wake up..
for
(
int
rest
=
getInitDelay
();
rest
>
0
;
rest
--)
{
pl
.
taskChanged
(
this
,
String
.
format
(
"Waiting %ds"
,
rest
));
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
ex
)
{
Thread
.
currentThread
().
interrupt
();
}
}
if
(
waitForIdentificationLine
()
!=
null
)
{
in
.
close
();
...
...
@@ -602,6 +631,7 @@ public class GenericGcodeDriver extends LaserCutter {
SETTING_HOST
,
SETTING_HTTP_UPLOAD_URL
,
SETTING_IDENTIFICATION_STRING
,
SETTING_INIT_DELAY
,
SETTING_LINEEND
,
SETTING_MAX_SPEED
,
SETTING_PRE_JOB_GCODE
,
...
...
@@ -633,6 +663,8 @@ public class GenericGcodeDriver extends LaserCutter {
return
this
.
getHttpUploadUrl
();
}
else
if
(
SETTING_IDENTIFICATION_STRING
.
equals
(
attribute
))
{
return
this
.
getIdentificationLine
();
}
else
if
(
SETTING_INIT_DELAY
.
equals
(
attribute
))
{
return
this
.
getInitDelay
();
}
else
if
(
SETTING_LINEEND
.
equals
(
attribute
))
{
return
this
.
getLineend
();
}
else
if
(
SETTING_MAX_SPEED
.
equals
(
attribute
))
{
...
...
@@ -668,10 +700,12 @@ public class GenericGcodeDriver extends LaserCutter {
this
.
setHttpUploadUrl
((
String
)
value
);
}
else
if
(
SETTING_IDENTIFICATION_STRING
.
equals
(
attribute
))
{
this
.
setIdentificationLine
((
String
)
value
);
}
else
if
(
SETTING_INIT_DELAY
.
equals
(
attribute
))
{
this
.
setInitDelay
((
Integer
)
value
);
}
else
if
(
SETTING_LINEEND
.
equals
(
attribute
))
{
this
.
setLineend
((
String
)
value
);
}
else
if
(
SETTING_MAX_SPEED
.
equals
(
attribute
))
{
this
.
setMax_speed
((
Double
)
max_speed
);
this
.
setMax_speed
((
Double
)
value
);
}
else
if
(
SETTING_PRE_JOB_GCODE
.
equals
(
attribute
))
{
this
.
setPreJobGcode
((
String
)
value
);
}
else
if
(
SETTING_POST_JOB_GCODE
.
equals
(
attribute
))
{
...
...
This diff is collapsed.
Click to expand it.
src/com/t_oster/liblasercut/drivers/SmoothieBoard.java
+
2
−
0
View file @
68ed7c9a
...
...
@@ -37,6 +37,7 @@ public class SmoothieBoard extends GenericGcodeDriver {
setWaitForOKafterEachLine
(
true
);
setBaudRate
(
115200
);
setLineend
(
"CRLF"
);
setInitDelay
(
0
);
}
@Override
...
...
@@ -73,6 +74,7 @@ public class SmoothieBoard extends GenericGcodeDriver {
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
]);
}
...
...
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