Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DMDesign
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amanda Ghassaei
DMDesign
Commits
b79e3b8a
Commit
b79e3b8a
authored
10 years ago
by
Amanda Ghassaei
Browse files
Options
Downloads
Patches
Plain Diff
tiny g export
parent
0f053abb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/cam/TinyGExporter.js
+6
-10
6 additions, 10 deletions
js/cam/TinyGExporter.js
with
6 additions
and
10 deletions
js/cam/TinyGExporter.js
+
6
−
10
View file @
b79e3b8a
...
...
@@ -19,10 +19,6 @@ function TinyGExporter(){
}
TinyGExporter
.
prototype
=
Object
.
create
(
GCodeExporter
.
prototype
);
TinyGExporter
.
prototype
.
makeHeader
=
function
(){
return
this
.
goHome
();
};
TinyGExporter
.
prototype
.
_setSpeed
=
function
(
speed
){
return
"
F
"
+
speed
+
"
\n
"
;
};
...
...
@@ -34,11 +30,11 @@ TinyGExporter.prototype.goHome = function(){
TinyGExporter
.
prototype
.
engageZAxis
=
function
(
type
,
cellPosition
,
cell
,
wcs
){
var
data
=
""
;
if
(
type
==
"
cell
"
){
if
(
Math
.
abs
(
cellPosition
.
z
-
wcs
.
z
)
<
0.001
)
data
+=
"
M3
"
;
//lower height
else
data
+=
"
M
4
"
;
//upper height
if
(
Math
.
abs
(
cellPosition
.
z
-
wcs
.
z
)
<
0.001
)
data
+=
"
M3
\n
M5
\n
M3
\n
M5
\n
M3
\n
M5
\n
"
;
//lower height
else
data
+=
"
M
3
\n
M5
\n
M3
\n
M5
\n
M4
\n
M5
\n
"
;
//upper height
data
+=
this
.
addComment
(
JSON
.
stringify
(
cell
.
indices
));
}
else
if
(
type
==
"
stock
"
){
data
+=
"
M
8
\n
"
;
data
+=
"
M
3
\n
M5
\n
M4
\n
M5
\n
M3
\n
M5
\n
"
;
}
else
{
console
.
warn
(
"
tinyG type not recognized
"
);
return
""
;
...
...
@@ -54,17 +50,17 @@ TinyGExporter.prototype.simulate = function(line, machine, wcs, callback){
if
(
line
==
"
(home)
"
){
return
machine
.
moveTo
(
""
,
""
,
rapidHeight
,
rapidSpeed
,
wcs
,
callback
);
}
else
if
(
line
[
0
]
==
"
M
"
){
if
(
line
.
substr
(
0
,
3
)
==
"
M8
"
){
//get stock
if
(
line
==
"
M3 M5 M4 M5 M3 M5
"
){
//get stock
var
stockPosition
=
dmaGlobals
.
assembler
.
get
(
"
stockPosition
"
);
return
this
.
simulateZ
(
machine
,
rapidSpeed
,
wcs
,
rapidHeight
,
stockPosition
.
z
-
wcs
.
z
,
function
(){
machine
.
pickUpStock
();
},
callback
);
}
else
if
(
line
.
substr
(
0
,
3
)
==
"
M3
"
){
//lower height
}
else
if
(
line
==
"
M3 M5 M3 M5 M3 M5
"
){
//lower height
//stupid thing needs to do some math to force to float...
return
this
.
simulateZ
(
machine
,
rapidSpeed
,
wcs
,
rapidHeight
,
wcs
.
z
+
0.000001
,
function
(){
machine
.
releaseStock
(
line
.
substr
(
4
,
line
.
length
-
5
));
},
callback
);
}
else
if
(
line
.
substr
(
0
,
3
)
==
"
M4
"
){
//higher height
}
else
if
(
line
==
"
M3 M5 M3 M5 M4 M5
"
){
//higher height
return
this
.
simulateZ
(
machine
,
rapidSpeed
,
wcs
,
rapidHeight
,
wcs
.
z
+
dmaGlobals
.
lattice
.
zScale
(),
function
(){
machine
.
releaseStock
(
line
.
substr
(
4
,
line
.
length
-
5
));
},
callback
);
...
...
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