forked from PyroAVR/widget-super-touchplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTemp Code
More file actions
71 lines (57 loc) · 2.21 KB
/
Copy pathTemp Code
File metadata and controls
71 lines (57 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//Start searching! Y first
var first_y = 0
var second_y = 0
var first_x = 0
var second_x = 0
//Step 1 Probe + Y
var id = "tp" + this.gcodeCtr++;
gcode = "G38.2 Y20 F" + fr + "\n";
chilipeppr.publish("/com-chilipeppr-widget-serialport/jsonSend", {
Id: id,
D: gcode
});
//Now lets look for the coordinates returned from SPJS prb
if ('prb' in json && 'e' in json.prb && this.runningAxis == "cf") {
this.first_y = json.prb.y;
console.log("First Touch y: " + this.first_y);
}
//Step 2 Probe - Y
var id = "tp" + this.gcodeCtr++;
gcode = "G38.2 Y-20 F" + fr + "\n";
chilipeppr.publish("/com-chilipeppr-widget-serialport/jsonSend", {
Id: id,
D: gcode
});
//Now lets look for the coordinates returned from SPJS prb
if ('prb' in json && 'e' in json.prb && this.runningAxis == "cf") {
this.second_y = json.prb.y;
console.log("Second Touch y: " + this.second_y);
}
//Step 3 Probe + x
var id = "tp" + this.gcodeCtr++;
gcode = "G38.2 x+20 F" + fr + "\n";
chilipeppr.publish("/com-chilipeppr-widget-serialport/jsonSend", {
Id: id,
D: gcode
});
//Now lets look for the coordinates returned from SPJS prb
if ('prb' in json && 'e' in json.prb && this.runningAxis == "cf") {
this.first_x = json.prb.x;
console.log("First Touch x: " + this.first_x);
}
//Step 4 Probe - x
var id = "tp" + this.gcodeCtr++;
gcode = "G38.2 x-20 F" + fr + "\n";
chilipeppr.publish("/com-chilipeppr-widget-serialport/jsonSend", {
Id: id,
D: gcode
});
//Now lets look for the coordinates returned from SPJS prb
if ('prb' in json && 'e' in json.prb && this.runningAxis == "cf") {
this.second_x = json.prb.x;
console.log("Second Touch x: " + this.second_x);
}
// $('#com-chilipeppr-widget-super-touchplate .btn-Zplaterun').removeClass("btn-danger").text("Run Z");
// this.animInfiniteEnd();
// this.onAfterProbeDone(json.prb);
// this.isRunning = false;