Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DMDesign
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amanda Ghassaei
DMDesign
Commits
26de4b83
Commit
26de4b83
authored
Sep 18, 2015
by
Amanda Ghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comm working
parent
464ffb3e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
29 deletions
+43
-29
js/cam/processes/GCodeExporter.js
js/cam/processes/GCodeExporter.js
+1
-1
js/menus/SendMenuView.js
js/menus/SendMenuView.js
+19
-15
js/menus/templates/SendControlPanel.html
js/menus/templates/SendControlPanel.html
+14
-0
js/menus/templates/SendMenuView.html
js/menus/templates/SendMenuView.html
+1
-11
js/models/SerialComm.js
js/models/SerialComm.js
+7
-1
js/plists/CamPList.js
js/plists/CamPList.js
+1
-1
No files found.
js/cam/processes/GCodeExporter.js
View file @
26de4b83
...
...
@@ -85,7 +85,7 @@ define(['underscore', 'cam', 'lattice', 'three'], function(_, cam, lattice, THRE
z
=
"
Z
"
+
parseFloat
(
z
).
toFixed
(
3
);
}
if
(
command
)
return
this
.
addLine
(
command
,
[
x
,
y
,
z
]);
return
this
.
addLine
(
"
G
0
1
"
,
[
x
,
y
,
z
]);
return
this
.
addLine
(
"
G1
"
,
[
x
,
y
,
z
]);
};
GCodeExporter
.
prototype
.
_rapidXYZ
=
function
(
x
,
y
,
z
){
...
...
js/menus/SendMenuView.js
View file @
26de4b83
...
...
@@ -2,8 +2,8 @@
* Created by aghassaei on 3/11/15.
*/
define
([
'
jquery
'
,
'
underscore
'
,
'
menuParent
'
,
'
serialComm
'
,
'
commPlist
'
,
'
text!sendMenuTemplate
'
,
'
cam
'
,
'
camPlist
'
],
function
(
$
,
_
,
MenuParent
,
serialComm
,
commPlist
,
template
,
cam
,
camPlist
){
define
([
'
jquery
'
,
'
underscore
'
,
'
menuParent
'
,
'
serialComm
'
,
'
commPlist
'
,
'
text!sendMenuTemplate
'
,
'
text!menus/templates/SendControlPanel.html
'
,
'
cam
'
,
'
camPlist
'
],
function
(
$
,
_
,
MenuParent
,
serialComm
,
commPlist
,
template
,
c
ontrolPanelTemplate
,
c
am
,
camPlist
){
return
MenuParent
.
extend
({
...
...
@@ -20,13 +20,14 @@ define(['jquery', 'underscore', 'menuParent', 'serialComm', 'commPlist', 'text!s
_initialize
:
function
(){
this
.
listenTo
(
this
.
model
,
"
change:stockSimulationPlaying
"
,
this
.
render
);
this
.
listenTo
(
serialComm
,
"
change:isStreaming
"
,
this
.
render
);
this
.
listenTo
(
serialComm
,
"
change
"
,
this
.
_renderControls
);
this
.
listenTo
(
cam
,
"
change
"
,
this
.
_renderControls
);
this
.
listenTo
(
cam
,
"
change:simLineNumber
"
,
this
.
_lineNumChanged
);
},
_
getPropertyOwner
:
function
(
$target
){
getPropertyOwner
:
function
(
$target
){
if
(
$target
.
hasClass
(
"
cam
"
))
return
cam
;
if
(
$target
.
hasClass
(
"
comm
"
))
return
serialComm
;
return
null
;
},
...
...
@@ -64,12 +65,6 @@ define(['jquery', 'underscore', 'menuParent', 'serialComm', 'commPlist', 'text!s
cam
.
set
(
"
simLineNumber
"
,
nextLine
);
},
_showNextLine
:
function
(
nextLine
){
console
.
log
(
nextLine
);
$
(
"
#nextLine
"
).
val
(
nextLine
);
this
.
_drawGcodeHighlighter
(
nextLine
);
},
_openSerialMonitor
:
function
(
e
){
e
.
preventDefault
();
serialComm
.
openSerialMonitor
();
...
...
@@ -77,7 +72,7 @@ define(['jquery', 'underscore', 'menuParent', 'serialComm', 'commPlist', 'text!s
_lineNumChanged
:
function
(){
var
lineNum
=
cam
.
get
(
"
simLineNumber
"
);
this
.
_
showNextLine
(
lineNum
);
this
.
_
drawGcodeHighlighter
(
lineNum
);
},
_drawGcodeHighlighter
:
function
(
lineNum
){
...
...
@@ -100,16 +95,25 @@ define(['jquery', 'underscore', 'menuParent', 'serialComm', 'commPlist', 'text!s
$editor
.
css
({
height
:
height
+
"
px
"
});
},
_makeControlTemplateJSON
:
function
(){
},
_makeTemplateJSON
:
function
(){
return
_
.
extend
(
serialComm
.
toJSON
(),
commPlist
,
cam
.
toJSON
(),
camPlist
,
{
nextLine
:
this
.
nextLine
});
return
_
.
extend
(
serialComm
.
toJSON
(),
cam
.
toJSON
(),
camPlist
);
},
_renderControls
:
function
(){
$
(
"
#sendControls
"
).
html
(
this
.
controlPanelTemplate
(
this
.
_makeTemplateJSON
()));
},
_render
:
function
(){
if
(
serialComm
.
get
(
"
lastMessageReceived
"
)
===
null
)
$
(
"
#incomingSerialMessage
"
).
hide
();
this
.
_setEditorHeight
();
this
.
_drawGcodeHighlighter
(
this
.
nextLine
);
this
.
_drawGcodeHighlighter
(
cam
.
get
(
"
simLineNumber
"
));
this
.
_renderControls
();
},
controlPanelTemplate
:
_
.
template
(
controlPanelTemplate
),
template
:
_
.
template
(
template
)
});
...
...
js/menus/templates/SendControlPanel.html
0 → 100644
View file @
26de4b83
<
%
if
(
isStreaming
){
%
>
<a
href=
"#"
id=
"pauseStream"
class=
"btn btn-halfWidth btn-lg btn-warning"
>
Pause
</a>
<a
href=
"#"
id=
"stopMachine"
class=
"btn pull-right btn-halfWidth btn-lg btn-danger"
>
Stop
</a><br/>
<
%
}
else
{
%
>
<a
href=
"#"
id=
"streamCommands"
class=
"btn btn-block btn-lg btn-success"
>
Stream
</a>
<
%
}
%
>
<label
class=
"checkbox"
for=
"rapidPosRel"
>
<input
id=
"rapidPosRel"
data-property=
"singleStepMode"
type=
"checkbox"
<%
if
(
singleStepMode
){
%
>
checked="checked"
<
%
}
%
>
value="" data-toggle="checkbox" class="comm custom-checkbox">
<span
class=
"icons"
><span
class=
"icon-unchecked"
></span><span
class=
"icon-checked"
></span></span>
Single step mode
</label>
<a
href=
"#"
id=
"openSerialMonitor"
class=
"btn btn-block btn-lg btn-default"
>
Open Serial Monitor
</a><br/>
Next Line:
<input
id=
"nextLine"
property=
"simLineNumber"
value=
"<%= simLineNumber %>"
placeholder=
"##"
class=
"intInput form-control cam"
type=
"text"
>
<a
href=
"#"
id=
"previousLineButton"
class=
"btn btn-lg btn-default"
><span
class=
"fui-triangle-up"
></span></a>
<a
href=
"#"
id=
"nextLineButton"
class=
"btn btn-lg btn-default"
><span
class=
"fui-triangle-down"
></span></a><br/><br/>
\ No newline at end of file
js/menus/templates/SendMenuView.html
View file @
26de4b83
...
...
@@ -2,17 +2,7 @@
<
%
if(dataOut=
=0){
%
>
You need to go through the Assemble workflow to setup your machine and create
<
%=
allCamProcesses
[
camProcess
]
%
>
first.
<
%
}
else
{
%
>
<
%
if
(
isStreaming
){
%
>
<a
href=
"#"
id=
"pauseStream"
class=
"btn btn-halfWidth btn-lg btn-warning"
>
Pause
</a>
<a
href=
"#"
id=
"stopMachine"
class=
"btn pull-right btn-halfWidth btn-lg btn-danger"
>
Stop
</a><br/>
<
%
}
else
{
%
>
<a
href=
"#"
id=
"streamCommands"
class=
"btn btn-block btn-lg btn-success"
>
Stream
</a>
<
%
}
%
>
<br/>
<a
href=
"#"
id=
"openSerialMonitor"
class=
"btn btn-block btn-lg btn-default"
>
Open Serial Monitor
</a><br/>
Next Line:
<input
id=
"nextLine"
property=
"simLineNumber"
value=
"<%= nextLine %>"
placeholder=
"##"
class=
"intInput form-control cam"
type=
"text"
>
<a
href=
"#"
id=
"previousLineButton"
class=
"btn btn-lg btn-default"
><span
class=
"fui-triangle-up"
></span></a>
<a
href=
"#"
id=
"nextLineButton"
class=
"btn btn-lg btn-default"
><span
class=
"fui-triangle-down"
></span></a><br/><br/>
<div
id=
"sendControls"
></div>
<div
id=
"gcodeEditor"
><
%=
dataOut
%
></div><br/>
<
%
}
%
>
<
%
}
else
{
%
>
...
...
js/models/SerialComm.js
View file @
26de4b83
...
...
@@ -16,7 +16,8 @@ define(['underscore', 'backbone', 'socketio', 'machineState', 'cam'],
error
:
null
,
lastMessageReceived
:
null
,
lastMessageSent
:
""
,
isStreaming
:
false
isStreaming
:
false
,
singleStepMode
:
true
},
initialize
:
function
(){
...
...
@@ -79,11 +80,16 @@ define(['underscore', 'backbone', 'socketio', 'machineState', 'cam'],
self
.
listenToOnce
(
machineState
,
"
readyForNextCommand
"
,
function
(){
lineNum
++
;
cam
.
set
(
"
simLineNumber
"
,
lineNum
);
if
(
self
.
get
(
"
singleStepMode
"
)){
self
.
pauseStream
();
return
;
}
self
.
sendGCode
();
});
self
.
send
(
'
{"gc":"
'
+
line
+
'
"}
'
);
}
else
if
(
lineNum
==
allLines
.
length
){
self
.
pauseStream
();
cam
.
set
(
"
simLineNumber
"
,
0
);
}
else
{
console
.
warn
(
"
invalid line number
"
+
lineNum
);
}
...
...
js/plists/CamPList.js
View file @
26de4b83
...
...
@@ -132,7 +132,7 @@ define(['three'], function(THREE){
safeHeight
:
4
,
originPosition
:
new
THREE
.
Vector3
(
0
,
0
,
0
),
rapidSpeeds
:{
xy
:
250
,
z
:
250
},
feedRate
:{
xy
:
6
,
z
:
6
}
feedRate
:{
xy
:
100
,
z
:
100
}
},
customPost
:
{}
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment