Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
DMDesign
Commits
63a60e33
Commit
63a60e33
authored
Aug 19, 2015
by
Amanda Ghassaei
Browse files
stopping pt
parent
bffabbb2
Changes
5
Hide whitespace changes
Inline
Side-by-side
js/cam/assemblers/Assembler.js
View file @
63a60e33
...
...
@@ -26,6 +26,9 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', '
this
.
customHome
=
json
.
customHome
||
function
(){};
this
.
customPickUpStock
=
json
.
customPickUpStock
||
function
(){};
this
.
customPlacePart
=
json
.
customPlacePart
||
function
(){};
this
.
customFunctionsContext
=
{
clearHeight
:
8
};
this
.
object3D
=
new
THREE
.
Object3D
();
three
.
sceneAdd
(
this
.
object3D
);
...
...
@@ -422,6 +425,12 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', '
this
.
object3D
=
null
;
};
Assembler
.
prototype
.
saveJSON
=
function
(){
return
{
}
};
Assembler
.
prototype
.
toJSON
=
function
(){
var
componentsJSON
=
{};
_
.
each
(
this
.
components
,
function
(
component
,
id
){
...
...
js/cam/assemblers/Component.js
View file @
63a60e33
...
...
@@ -278,6 +278,11 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){
};
Component
.
prototype
.
saveJSON
=
function
(){
};
Component
.
prototype
.
toJSON
=
function
(){
var
childIDs
=
[];
_
.
each
(
this
.
children
,
function
(
child
){
...
...
js/main.js
View file @
63a60e33
...
...
@@ -14,6 +14,8 @@ require.config({
bootstrapSlider
:
'
../dependencies/bootstrap-slider/bootstrap-slider
'
,
fileSaverLib
:
'
../dependencies/loaders/FileSaver.min
'
,
numeric
:
'
../dependencies/numeric-1.2.6
'
,
codeMirrorJS
:
'
../dependencies/codemirror/javascript
'
,
codeMirror
:
'
../dependencies/codemirror/codemirror
'
,
//three
three
:
'
../dependencies/three
'
,
...
...
@@ -141,6 +143,7 @@ require.config({
navViewMenuTemplate
:
'
menus/templates/NavViewMenu.html
'
,
ribbonTemplate
:
'
menus/templates/Ribbon.html
'
,
modalViewTemplate
:
'
menus/templates/ModalView.html
'
,
scriptView
:
'
menus/ScriptView
'
,
menuWrapperTemplate
:
'
menus/templates/MenuWrapperView.html
'
,
latticeMenuTemplate
:
'
menus/templates/LatticeMenuView.html
'
,
importMenuTemplate
:
'
menus/templates/ImportMenuView.html
'
,
...
...
@@ -230,6 +233,10 @@ require.config({
},
'
numeric
'
:
{
exports
:
'
numeric
'
},
'
codeMirror
'
:
{
deps
:
[
'
codeMirrorJS
'
],
exports
:
'
CodeMirror
'
}
}
...
...
js/menus/ScriptView.js
View file @
63a60e33
...
...
@@ -3,87 +3,96 @@
*/
ScriptView
=
Backbone
.
View
.
extend
({
el
:
"
#scriptView
"
,
events
:
{
"
click #runScript
"
:
"
_runScript
"
,
"
click #saveScript
"
:
"
_saveScript
"
,
"
click #loadScript
"
:
"
_loadScript
"
},
initialize
:
function
(){
_
.
bindAll
(
this
,
"
render
"
,
"
_handleKeyStroke
"
);
//bind events
$
(
document
).
bind
(
'
keydown
'
,
{},
this
.
_handleKeyStroke
);
this
.
render
();
this
.
listenTo
(
globals
.
appState
,
"
change:scriptIsVisible
"
,
this
.
_setVisibility
);
},
_handleKeyStroke
:
function
(
e
){
if
(
e
.
keyCode
==
82
&&
this
.
model
.
get
(
"
currentTab
"
)
==
"
script
"
){
if
(
e
.
shiftKey
||
!
e
.
metaKey
)
return
;
define
([
'
jquery
'
,
'
underscore
'
,
'
backbone
'
,
'
appState
'
,
'
codeMirror
'
],
function
(
$
,
_
,
Backbone
,
appState
,
CodeMirror
){
var
ScriptView
=
Backbone
.
View
.
extend
({
el
:
"
#scriptView
"
,
events
:
{
"
click #runScript
"
:
"
_runScript
"
,
"
click #saveScript
"
:
"
_saveScript
"
,
"
click #loadScript
"
:
"
_loadScript
"
},
initialize
:
function
(){
_
.
bindAll
(
this
,
"
render
"
,
"
_handleKeyStroke
"
);
//bind events
// $(document).bind('keydown', {}, this._handleKeyStroke);
this
.
render
();
this
.
listenTo
(
this
.
model
,
"
change:scriptIsVisible
"
,
this
.
_setVisibility
);
},
// _handleKeyStroke: function(e){
// if (e.keyCode == 82 && this.model.get("currentTab") == "script"){
// if (e.shiftKey || !e.metaKey) return;
// e.preventDefault();
// e.stopPropagation();
// // appState.runScript(globals.codeMirror.getValue());
// }
// },
_runScript
:
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
// globals.appState.runScript(globals.codeMirror.getValue());
}
},
_runScript
:
function
(
e
){
e
.
preventDefault
();
// globals.appState.runScript(globals.codeMirror.getValue());
},
_saveScript
:
function
(
e
){
e
.
preventDefault
();
// globals.appState.syncScript(globals.codeMirror.getValue());
// globals.saveFile(globals.script, "linkageScript", ".js");
},
_loadScript
:
function
(
e
){
e
.
preventDefault
();
$
(
"
#fileInput
"
).
click
();
},
_setEditorHeight
:
function
(){
var
$editor
=
$
(
'
.CodeMirror
'
);
var
height
=
this
.
$el
.
height
()
-
$editor
.
position
().
top
;
height
=
Math
.
max
(
height
,
250
);
$editor
.
css
({
height
:
height
+
"
px
"
});
},
_setVisibility
:
function
(){
if
(
this
.
model
.
get
(
"
scriptIsVisible
"
))
this
.
_show
();
else
this
.
_hide
();
},
_hide
:
function
(){
var
width
=
this
.
$el
.
parent
().
width
();
this
.
$el
.
animate
({
left
:
"
-
"
+
width
+
"
px
"
});
},
_show
:
function
(){
this
.
$el
.
animate
({
left
:
"
0
"
});
},
render
:
function
(){
this
.
$el
.
html
(
this
.
template
({
script
:
globals
.
script
}));
globals
.
codeMirror
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
"
scriptEditor
"
),
{
lineNumbers
:
true
,
mode
:
"
javascript
"
});
this
.
_setEditorHeight
();
},
template
:
_
.
template
(
'
\
<div class="col-sm-4"><a href="#" id="loadScript" class=" btn btn-lg btn-block btn-default">Load Script</a></div>
\
<div class="col-sm-4"><a href="#" id="runScript" class=" btn btn-lg btn-block btn-default">Run Script   (CTRL/⌘ + R)</a></div>
\
<div class="col-sm-4"><a href="#" id="saveScript" class=" btn btn-lg btn-block btn-default">Save Script</a></div><br/><br/>
\
<textarea id="scriptEditor"><%= script %></textarea><br/>
\
'
)
// appState.runScript(globals.codeMirror.getValue());
},
// _saveScript: function(e){
// e.preventDefault();
// // appState.syncScript(globals.codeMirror.getValue());
// // globals.saveFile(globals.script, "linkageScript", ".js");
// },
//
// _loadScript: function(e){
// e.preventDefault();
// $("#fileInput").click();
// },
_setEditorHeight
:
function
(){
var
$editor
=
$
(
'
.CodeMirror
'
);
var
height
=
this
.
$el
.
height
()
-
$editor
.
position
().
top
;
height
=
Math
.
max
(
height
,
250
);
$editor
.
css
({
height
:
height
+
"
px
"
});
},
_setVisibility
:
function
(){
if
(
this
.
model
.
get
(
"
scriptIsVisible
"
))
this
.
_show
();
else
this
.
_hide
();
},
_hide
:
function
(){
var
width
=
this
.
$el
.
parent
().
width
();
this
.
$el
.
animate
({
left
:
"
-
"
+
width
+
"
px
"
});
},
_show
:
function
(){
this
.
$el
.
animate
({
left
:
"
0
"
});
},
render
:
function
(){
this
.
$el
.
html
(
this
.
template
({
script
:
"
test
"
}));
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
"
scriptEditor
"
),
{
lineNumbers
:
true
,
mode
:
"
javascript
"
});
this
.
_setEditorHeight
();
},
template
:
_
.
template
(
'
\
<div class="col-sm-4"><a href="#" id="loadScript" class=" btn btn-lg btn-block btn-default">Load Script</a></div>
\
<div class="col-sm-4"><a href="#" id="runScript" class=" btn btn-lg btn-block btn-default">Run Script   (CTRL/⌘ + R)</a></div>
\
<div class="col-sm-4"><a href="#" id="saveScript" class=" btn btn-lg btn-block btn-default">Save Script</a></div><br/><br/>
\
<textarea id="scriptEditor"><%= script %></textarea><br/>
\
'
)
});
return
new
ScriptView
({
model
:
appState
});
});
\ No newline at end of file
js/plists/CamPList.js
View file @
63a60e33
...
...
@@ -129,7 +129,6 @@ define(['three'], function(THREE){
rapidHeight
:
30
,
rapidHeightRelative
:
true
,
safeHeight
:
4.5
,
clearHeight
:
8
,
originPosition
:
new
THREE
.
Vector3
(
0
,
0
,
0
),
rapidSpeeds
:{
xy
:
250
,
z
:
250
},
feedRate
:{
xy
:
6
,
z
:
6
}
...
...
Write
Preview
Supports
Markdown
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