Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
95005286
Commit
95005286
authored
Apr 08, 2013
by
fsantini
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'experimental' of
https://github.com/kliment/Printrun
into experimental
parents
89680405
630d1178
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
125 additions
and
43 deletions
+125
-43
webinterface.py
printrun/webinterface.py
+38
-35
pronterface.py
pronterface.py
+8
-8
style.css
web/css/style.css
+0
-0
asyncCommand.js
web/js/asyncCommand.js
+79
-0
No files found.
printrun/webinterface.py
View file @
95005286
This diff is collapsed.
Click to expand it.
pronterface.py
View file @
95005286
...
@@ -313,16 +313,16 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -313,16 +313,16 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if
f
>
0
:
if
f
>
0
:
wx
.
CallAfter
(
self
.
btemp
.
SetValue
,
str
(
f
))
wx
.
CallAfter
(
self
.
btemp
.
SetValue
,
str
(
f
))
self
.
set
(
"last_bed_temperature"
,
str
(
f
))
self
.
set
(
"last_bed_temperature"
,
str
(
f
))
wx
.
CallAfter
(
self
.
setboff
.
SetBackgroundColour
,
""
)
wx
.
CallAfter
(
self
.
setboff
.
SetBackgroundColour
,
None
)
wx
.
CallAfter
(
self
.
setboff
.
SetForegroundColour
,
""
)
wx
.
CallAfter
(
self
.
setboff
.
SetForegroundColour
,
None
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetBackgroundColour
,
"#FFAA66"
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetBackgroundColour
,
"#FFAA66"
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetForegroundColour
,
"#660000"
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetForegroundColour
,
"#660000"
)
wx
.
CallAfter
(
self
.
btemp
.
SetBackgroundColour
,
"#FFDABB"
)
wx
.
CallAfter
(
self
.
btemp
.
SetBackgroundColour
,
"#FFDABB"
)
else
:
else
:
wx
.
CallAfter
(
self
.
setboff
.
SetBackgroundColour
,
"#0044CC"
)
wx
.
CallAfter
(
self
.
setboff
.
SetBackgroundColour
,
"#0044CC"
)
wx
.
CallAfter
(
self
.
setboff
.
SetForegroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
setboff
.
SetForegroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetBackgroundColour
,
""
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetBackgroundColour
,
None
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetForegroundColour
,
""
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetForegroundColour
,
None
)
wx
.
CallAfter
(
self
.
btemp
.
SetBackgroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
btemp
.
SetBackgroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
btemp
.
Refresh
)
wx
.
CallAfter
(
self
.
btemp
.
Refresh
)
...
@@ -332,16 +332,16 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -332,16 +332,16 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if
f
>
0
:
if
f
>
0
:
wx
.
CallAfter
(
self
.
htemp
.
SetValue
,
str
(
f
))
wx
.
CallAfter
(
self
.
htemp
.
SetValue
,
str
(
f
))
self
.
set
(
"last_temperature"
,
str
(
f
))
self
.
set
(
"last_temperature"
,
str
(
f
))
wx
.
CallAfter
(
self
.
settoff
.
SetBackgroundColour
,
""
)
wx
.
CallAfter
(
self
.
settoff
.
SetBackgroundColour
,
None
)
wx
.
CallAfter
(
self
.
settoff
.
SetForegroundColour
,
""
)
wx
.
CallAfter
(
self
.
settoff
.
SetForegroundColour
,
None
)
wx
.
CallAfter
(
self
.
settbtn
.
SetBackgroundColour
,
"#FFAA66"
)
wx
.
CallAfter
(
self
.
settbtn
.
SetBackgroundColour
,
"#FFAA66"
)
wx
.
CallAfter
(
self
.
settbtn
.
SetForegroundColour
,
"#660000"
)
wx
.
CallAfter
(
self
.
settbtn
.
SetForegroundColour
,
"#660000"
)
wx
.
CallAfter
(
self
.
htemp
.
SetBackgroundColour
,
"#FFDABB"
)
wx
.
CallAfter
(
self
.
htemp
.
SetBackgroundColour
,
"#FFDABB"
)
else
:
else
:
wx
.
CallAfter
(
self
.
settoff
.
SetBackgroundColour
,
"#0044CC"
)
wx
.
CallAfter
(
self
.
settoff
.
SetBackgroundColour
,
"#0044CC"
)
wx
.
CallAfter
(
self
.
settoff
.
SetForegroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
settoff
.
SetForegroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
settbtn
.
SetBackgroundColour
,
""
)
wx
.
CallAfter
(
self
.
settbtn
.
SetBackgroundColour
,
None
)
wx
.
CallAfter
(
self
.
settbtn
.
SetForegroundColour
,
""
)
wx
.
CallAfter
(
self
.
settbtn
.
SetForegroundColour
,
None
)
wx
.
CallAfter
(
self
.
htemp
.
SetBackgroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
htemp
.
SetBackgroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
htemp
.
Refresh
)
wx
.
CallAfter
(
self
.
htemp
.
Refresh
)
...
...
css/style.css
→
web/
css/style.css
View file @
95005286
File moved
web/js/asyncCommand.js
0 → 100644
View file @
95005286
function
pronterfaceWebInterface_setup
(){
pronterfaceWebInterface_attachAsync
();
}
function
pronterfaceWebInterface_attachAsync
(){
var
list
=
[];
if
(
document
.
getElementsByClassName
){
list
=
document
.
getElementsByClassName
(
'command'
);
}
else
if
(
document
.
getElementsByTagName
){
list
=
document
.
getElementsByTagName
(
'a'
);
list
.
concat
(
document
.
getElementsByTagName
(
'area'
)
);
//TODO filter list via checking the className attributes
}
else
{
console
&&
console
.
error
&&
console
.
error
(
'unable to gather list of elements'
);
return
false
;
}
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
){
list
[
i
].
addEventListener
&&
list
[
i
].
addEventListener
(
'click'
,
function
(
e
){
return
pronterfaceWebInterface_asyncCommand
(
null
,
e
);},
true
);
list
[
i
].
attachEvent
&&
list
[
i
].
attachEvent
(
'onclick'
,
function
(
e
){
return
pronterfaceWebInterface_asyncCommand
(
null
,
e
);}
);
}
return
true
;
}
function
pronterfaceWebInterface_asyncCommand
(
urlOrElement
,
event
){
if
(
!
urlOrElement
&&
event
.
target
)
urlOrElement
=
event
.
target
;
var
url
=
null
;
if
(
typeof
urlOrElement
==
'string'
){
url
=
urlOrElement
;
}
else
{
url
=
urlOrElement
&&
urlOrElement
.
href
;
}
if
(
typeof
url
!=
'string'
){
console
&&
console
.
error
&&
console
.
error
(
'url not a string'
,
urlOrElement
,
url
);
return
true
;
}
var
httpRequest
;
if
(
window
.
XMLHttpRequest
)
{
// Mozilla, Safari, ...
httpRequest
=
new
XMLHttpRequest
();
}
else
if
(
window
.
ActiveXObject
)
{
// IE 8 and older
httpRequest
=
new
ActiveXObject
(
"Microsoft.XMLHTTP"
);
}
if
(
!
httpRequest
){
alert
(
'no AJAX available?'
);
// follow link
return
true
;
}
//onreadystatechange
//onerror
httpRequest
.
open
(
'GET'
,
url
,
true
);
httpRequest
.
send
(
null
);
// don't follow link
if
(
event
){
event
.
stopImmediatePropagation
&&
event
.
stopImmediatePropagation
();
event
.
defaultPrevented
=
true
;
event
.
preventDefault
&&
event
.
preventDefault
();
}
return
false
;
}
if
(
document
.
addEventListener
)
{
document
.
addEventListener
(
"DOMContentLoaded"
,
pronterfaceWebInterface_setup
,
false
);
}
else
if
(
document
.
attachEvent
)
{
document
.
attachEvent
(
"onreadystatechange"
,
pronterfaceWebInterface_setup
);
}
else
{
document
.
onload
=
pronterfaceWebInterface_setup
;
}
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