Skip to content
Snippets Groups Projects
Commit f9afc46d authored by Camron Blackburn's avatar Camron Blackburn
Browse files

convert chagnes from ilathe fork

parent 9aedb8b7
Branches apfelstruder
No related tags found
No related merge requests found
Showing
with 3901 additions and 0 deletions
...@@ -3,3 +3,5 @@ save/contexts/* ...@@ -3,3 +3,5 @@ save/contexts/*
save/old-systems save/old-systems
save/systems save/systems
scratch/ scratch/
.DS_Store
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" baseProfile="tiny" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" width="552.9px" height="127.3px" viewBox="0 0 552.9 127.3" xml:space="preserve">
<g>
<path d="M161.8,75.5h-7.7l-1.7,6.7h-6.2l8.8-30.9h6.2l8.8,30.9h-6.3L161.8,75.5z M155.3,70.7h5.3l-2.6-9.8h-0.1L155.3,70.7z"/>
<path d="M187,71v11.2h-6V51.3h10.3c3.1,0,5.5,0.9,7.4,2.7c1.8,1.8,2.7,4.2,2.7,7.1c0,3-0.9,5.3-2.7,7.1c-1.8,1.8-4.3,2.7-7.4,2.7
H187z M187,66.3h4.3c1.3,0,2.4-0.5,3.1-1.4c0.7-1,1.1-2.2,1.1-3.7c0-1.5-0.4-2.8-1.1-3.7c-0.7-1-1.7-1.5-3.1-1.5H187V66.3z"/>
<path d="M229.7,69.2h-9.8v12.9h-6V51.3h17.6v4.7h-11.7v8.6h9.8V69.2z"/>
<path d="M259.1,68.5h-9.4v9h11.3v4.7h-17.3V51.3h17.2v4.7h-11.3v7.9h9.4V68.5z"/>
<path d="M279.4,77.5h11.5v4.7h-17.5V51.3h6V77.5z"/>
<path d="M316.8,74.1c0-1.2-0.3-2.2-0.9-2.9c-0.6-0.7-1.8-1.4-3.4-2.1c-3.2-1.1-5.5-2.4-7.1-3.8c-1.6-1.4-2.4-3.4-2.4-5.9
c0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.7,1.3,4.8c0.9,1.1,2.1,1.7,3.6,1.7c1.5,0,2.7-0.6,3.6-1.7c0.9-1.1,1.3-2.7,1.3-4.8V51.3H419.8z"/>
<path d="M433,82.1V51.3h9.5c3.2,0,5.9,1.2,8,3.6c2.1,2.4,3.2,5.5,3.2,9.3v5.1c0,3.8-1.1,6.9-3.2,9.3s-4.8,3.6-8,3.6H433z M439,55.9
v21.5h3.5c1.5,0,2.8-0.8,3.7-2.3s1.4-3.5,1.4-5.9v-5.2c0-2.4-0.5-4.3-1.4-5.9c-0.9-1.5-2.2-2.3-3.7-2.3H439z"/>
<path d="M482,68.5h-9.4v9h11.3v4.7h-17.3V51.3h17.2v4.7h-11.3v7.9h9.4V68.5z"/>
<path d="M502.3,69.8v12.4h-6V51.3h9.2c3.1,0,5.5,0.8,7.2,2.4c1.8,1.6,2.6,3.8,2.6,6.7c0,1.6-0.4,3-1.1,4.2
c-0.7,1.2-1.8,2.1-3.2,2.8c1.6,0.5,2.8,1.4,3.5,2.7c0.7,1.2,1.1,2.8,1.1,4.7v2.2c0,0.9,0.1,1.8,0.3,2.7c0.2,0.9,0.6,1.6,1.1,2.1
v0.4h-6.2c-0.5-0.5-0.8-1.2-0.9-2.2c-0.1-1-0.2-2-0.2-3.1v-2.2c0-1.6-0.3-2.8-1-3.6c-0.7-0.9-1.6-1.3-2.8-1.3H502.3z M502.3,65.1
h3.2c1.3,0,2.3-0.4,2.9-1.2c0.7-0.8,1-1.9,1-3.3c0-1.4-0.3-2.6-1-3.4c-0.7-0.8-1.6-1.3-2.9-1.3h-3.3V65.1z"/>
</g>
<g transform="translate(0,-952.36216)">
<g transform="matrix(0.98888889,0,0,0.98888889,50.000001,1002.3622)">
<path d="M25.2,57.7c-8.4,0-15-3.5-15-7.9s6.6-7.9,15-7.9s15,3.5,15,7.9S33.6,57.7,25.2,57.7z M25.2,43.5c-7.3,0-13.4,2.9-13.4,6.3
c0,3.4,6.2,6.3,13.4,6.3s13.4-2.9,13.4-6.3C38.6,46.4,32.5,43.5,25.2,43.5z"/>
<path d="M25.2,57.7c-15.5,0-27.6-6.2-27.6-14.2S9.7,29.4,25.2,29.4c15.5,0,27.6,6.2,27.6,14.2S40.6,57.7,25.2,57.7z M25.2,31
c-14.3,0-26,5.6-26,12.6s11.6,12.6,26,12.6c14.3,0,26-5.6,26-12.6S39.5,31,25.2,31z"/>
<path d="M25.2,52.8c-20.3,0-36.9-8.4-36.9-18.8S4.8,15.1,25.2,15.1C45.5,15.1,62,23.6,62,34S45.5,52.8,25.2,52.8z M25.2,16.7
c-19.4,0-35.3,7.7-35.3,17.2S5.7,51.2,25.2,51.2c19.4,0,35.3-7.7,35.3-17.2S44.6,16.7,25.2,16.7z"/>
<path d="M25.2,43.5c-23,0-41.8-9.6-41.8-21.3S2.1,0.9,25.2,0.9S67,10.5,67,22.2S48.2,43.5,25.2,43.5z M25.2,2.5
C3,2.5-15,11.3-15,22.2S3,41.9,25.2,41.9s40.2-8.8,40.2-19.7S47.3,2.5,25.2,2.5z"/>
<path d="M25.2,31c-23,0-41.8-9.6-41.8-21.3S2.1-11.6,25.2-11.6S67-2.1,67,9.7S48.2,31,25.2,31z M25.2-10C3-10-15-1.2-15,9.7
S3,29.4,25.2,29.4s40.2-8.8,40.2-19.7S47.3-10,25.2-10z"/>
<path d="M25.2,16.7c-20.3,0-36.9-8.4-36.9-18.8S4.8-20.9,25.2-20.9C45.5-20.9,62-12.5,62-2.1S45.5,16.7,25.2,16.7z M25.2-19.3
c-19.4,0-35.3,7.7-35.3,17.2S5.7,15.1,25.2,15.1c19.4,0,35.3-7.7,35.3-17.2S44.6-19.3,25.2-19.3z"/>
<path d="M25.2,2.5C9.7,2.5-2.4-3.7-2.4-11.7S9.7-25.9,25.2-25.9c15.5,0,27.6,6.2,27.6,14.2S40.6,2.5,25.2,2.5z M25.2-24.3
c-14.3,0-26,5.6-26,12.6s11.6,12.6,26,12.6c14.3,0,26-5.6,26-12.6S39.5-24.3,25.2-24.3z"/>
<path d="M25.2-10c-8.4,0-15-3.5-15-7.9c0-4.4,6.6-7.9,15-7.9s15,3.5,15,7.9C40.2-13.5,33.6-10,25.2-10z M25.2-24.3
c-7.3,0-13.4,2.9-13.4,6.3c0,3.4,6.2,6.3,13.4,6.3s13.4-2.9,13.4-6.3C38.6-21.4,32.5-24.3,25.2-24.3z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
apple/assets/apple_texture.jpg

319 KiB

apple/assets/bg.png

51.9 KiB

apple/assets/cba_final.png

33.3 KiB

apple/assets/cursor.png

283 B

apple/assets/favicon.ico

15 KiB

apple/assets/gen_h.png

34.2 KiB

apple/assets/gen_o.png

28.7 KiB

apple/assets/happy-apple.jpg

10.4 KiB

body {
margin: 0;
background-color: #eeeeee;
font-family: Monospace;
font-size: 13px;
line-height: 24px;
overscroll-behavior: none;
}
a {
color: #ff0;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
button {
cursor: pointer;
text-transform: uppercase;
}
#info {
position: absolute;
top: 0px;
width: 100%;
padding: 10px;
box-sizing: border-box;
text-align: center;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
z-index: 1; /* TODO Solve this in HTML */
}
a, button, input, select {
pointer-events: auto;
}
.dg.ac {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
z-index: 2 !important; /* TODO Solve this in HTML */
}
#myCanvas{
position: absolute;
top: 0;
left:0;
z-index:999;
}
#apfel_logo {
width: 320px;
position: absolute;
left: 10px;
top: 10px;
}
#cba_logo {
width: 300px;
position: absolute;
right: 10px;
bottom: 10px;
}
#generate_tool {
position: absolute;
left: 110px;
top: 180px;
z-index:9999;
}
#generate_tool:hover {
content: url('gen_h.png');
cursor: pointer;
}
#start_stop {
position: absolute;
left: 110px;
top: 360px;
z-index:9999;
}
#start_stop:hover {
cursor: pointer;
}
apple/assets/start_h.png

13.4 KiB

apple/assets/start_o.png

16.9 KiB

apple/assets/stop_h.png

16.5 KiB

apple/assets/stop_o.png

12.9 KiB

import UIAppleJack from './ui-applejack.js'
let uiAppleJack = new UIAppleJack();
uiAppleJack.startWsConnection((message) => {
console.log("Received message:");
console.log(message);
}).then(() => {
uiAppleJack.sendMessageToCuttlefish("hello!");
});
<html>
<head>
<link rel="shortcut icon" href="assets/favicon.ico">
<title>Apple UI</title>
<script type="module" src="index-bootstrap.js"></script>
<script src="../libs/jquery.min.js"></script>
<script src="../libs/d3.js"></script>
<!-- these three disable caching -->
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
</head>
<body>
</body>
</html>
<h1>Apple UI <span id="status"/></h1>
<p>Peel your apples here!</p>
<ul>
<li><a href="toolpath.html">Toolpath UI</a></li>
<li><a href="socket-test.html">Socket Test</a></li>
</ul>
<h1>To Run Lathe</h1>
<ol>
<li>run cuttlefish (node cf)</li>
<li>plug in to USB (won't be necessary for rasberry pi - all the green light should go on for each stepper</li>
<li>turn on 24V power supple</li>
<li><a href="../">open the Local Cuttlefish</a> in another window and restore applejack-XA-YD-ZC system - once fully loaded all the motors should be locked</li>
<li>if you want to debug any errors that might crop up, hit CTRL (/apple) + Shift + J to open the Chrome console</li>
<li>run whatever you want from the UI</li>
</ol>
<b>~ note ~ to run more than one toolpath, you should restart the system so that it can zero again.</b>
<b>~ note ~ Cuttlefish likes to be run in a foreground tab (since it relies on requestAnimationFrame. Backgrounding Cuttlefish will result in it grinding to a halt</b>
<h1>Shutting Down</h1>
<ol>
<li>turn off 24V power supply</li>
<li>unplug USB</li>
<li>close cuttlefish (edited)</li>
</ol>
<img width="100" height="100" src="assets/happy-apple.jpg"/>
<!--Apple from <a href="https://www.freepik.com/free-vector/red-apple-with-happy-face_1909498.htm#page=1&query=apple&position=12#position=12&page=1&query=apple">brgfx at freepik</a>-->
This diff is collapsed.
# apple-jack Socket Protocol
## Top-level Packet Types
### Client Identification:
{
type: 'message',
clientType: 'cuttlefish' or 'ui',
}
### Messages:
{
type: 'message',
to: 'cuttlefish' or 'ui',
message: [MESSAGE - see below]
}
## [MESSAGE] contents:
### UI to Cuttlefish
### step message:
{
messageType: 'step',
x: 3.212,
y: 5.2212,
rotation: 12.5
}
#### distance sensor control message:
{
messageType: 'distanceEnabled',
enabled: true/false
}
#### stop message:
{
messageType: 'stop',
}
### Cuttlefish to UI
#### distance sensor control message:
{
messageType: 'currentDistance',
distance: 0.234234 (or default int?)
x/y/z
}
#### steps completed
{
messageType: 'stepsCompleted',
steps: 123
}
import UIAppleJack from './ui-applejack.js'
let uiAppleJack = new UIAppleJack();
uiAppleJack.startWsConnection((message) => {
console.log("Received message:");
console.log(message);
$("#messages").append(`
<b>${message.messageType}</b><br/>
<b>Distance ${message.distance}</b><br/>
<b>Steps ${message.steps}</b><br/>
`)
}).then(() => {
$("#step-cuttlefish").click(() => {
console.log("hello")
uiAppleJack.sendMessageToCuttlefish({
messageType: 'step',
x: $("#input-x").val(),
y: $("#input-y").val(),
rotation: $("#input-z").val()
})
})
$("#step-inc-cuttlefish").click(() => {
console.log("hello")
$("#input-x").attr('value', 1 + +$("#input-x").val())
$("#input-y").attr('value', 1 + +$("#input-y").val())
$("#input-z").attr('value', 1 + +$("#input-z").val())
uiAppleJack.sendMessageToCuttlefish({
messageType: 'step',
x: $("#input-x").val(),
y: $("#input-y").val(),
rotation: $("#input-z").val()
})
})
$("#step-inc-10-cuttlefish").click(() => {
console.log("hello")
for (let i = 0; i < 1000; i++) {
$("#input-x").attr('value', 1 + +$("#input-x").val())
$("#input-y").attr('value', 1 + +$("#input-y").val())
$("#input-z").attr('value', 1 + +$("#input-z").val())
uiAppleJack.sendMessageToCuttlefish({
messageType: 'step',
x: $("#input-x").val(),
y: $("#input-y").val(),
rotation: $("#input-z").val()
})
}
})
$("#stop").click(() => {
console.log("stopping!")
uiAppleJack.sendMessageToCuttlefish({
messageType: 'stop',
})
})
$("#distance-on").click(() => {
uiAppleJack.sendMessageToCuttlefish({
messageType: 'distanceEnabled',
enabled: true,
})
})
$("#distance-off").click(() => {
uiAppleJack.sendMessageToCuttlefish({
messageType: 'distanceEnabled',
enabled: false,
})
})
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment