upate vor ort
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/p5@1.11.3/lib/p5.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/p5@1.11.3/lib/p5.min.js"></script>
|
||||||
<script src="../../lib/WallPlotter.js?v=2.3.5"></script>
|
<script src="../../lib/WallPlotter.js?v=2.3.13"></script>
|
||||||
<script src="sketch.js"></script>
|
<script src="sketch.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
let wp;
|
let wp;
|
||||||
|
|
||||||
let area = 320;
|
let area = 100;
|
||||||
|
|
||||||
function setup() {
|
function setup() {
|
||||||
const canvas = createCanvas(windowWidth, windowHeight);
|
const canvas = createCanvas(windowWidth, windowHeight);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/p5@1.11.3/lib/p5.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/p5@1.11.3/lib/p5.min.js"></script>
|
||||||
<script src="../../lib/WallPlotter.js?v=2.3.5"></script>
|
<script src="../../lib/WallPlotter.js?v=2.3.13"></script>
|
||||||
<script src="sketch.js"></script>
|
<script src="sketch.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ All options are optional.
|
|||||||
| `machineXMin` / `machineXMax` | `-830` / `830` | Overlay X extents, mm (idler spacing 1660) |
|
| `machineXMin` / `machineXMax` | `-830` / `830` | Overlay X extents, mm (idler spacing 1660) |
|
||||||
| `machineYMin` / `machineYMax` | `-1200` / `800` | Overlay Y; idlers at Y=800 (80 cm above work centre) |
|
| `machineYMin` / `machineYMax` | `-1200` / `800` | Overlay Y; idlers at Y=800 (80 cm above work centre) |
|
||||||
| `jogIntervalMs` | `150` | Repeat delay while holding arrows, ms |
|
| `jogIntervalMs` | `150` | Repeat delay while holding arrows, ms |
|
||||||
| `maxLogLines` | `8` | Serial lines shown on the HUD |
|
| `maxLogLines` | `40` | Serial lines in the selectable log (bottom-right) |
|
||||||
| `previewMinDelayMs` | `30` | Floor for preview segment wait, ms |
|
| `previewMinDelayMs` | `30` | Floor for preview segment wait, ms |
|
||||||
| `previewFrameMs` | `16` | Preview animation frame time, ms |
|
| `previewFrameMs` | `16` | Preview animation frame time, ms |
|
||||||
| `timingMultiplier` | `1` | Scale **Test** preview waits (`2` = twice as slow) |
|
| `timingMultiplier` | `1` | Scale **Test** preview waits (`2` = twice as slow) |
|
||||||
|
|||||||
+47
-8
@@ -18,7 +18,7 @@ class WallPlotter {
|
|||||||
// Static constants
|
// Static constants
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
static VERSION = '2.3.5';
|
static VERSION = '2.3.13';
|
||||||
static MIN_FEED_MM_MIN = 1;
|
static MIN_FEED_MM_MIN = 1;
|
||||||
static MAX_FEED_MM_MIN = 10000;
|
static MAX_FEED_MM_MIN = 10000;
|
||||||
/** Offline overlay size when not connected (mm) — 150×150 cm centred on origin */
|
/** Offline overlay size when not connected (mm) — 150×150 cm centred on origin */
|
||||||
@@ -55,7 +55,7 @@ class WallPlotter {
|
|||||||
* @param {number} [options.machineYMax]
|
* @param {number} [options.machineYMax]
|
||||||
* @param {number} [options.previewSizeMm] Offline square size (mm)
|
* @param {number} [options.previewSizeMm] Offline square size (mm)
|
||||||
* @param {number} [options.jogIntervalMs=150]
|
* @param {number} [options.jogIntervalMs=150]
|
||||||
* @param {number} [options.maxLogLines=8]
|
* @param {number} [options.maxLogLines=40]
|
||||||
* @param {number} [options.previewMinDelayMs=30] Floor for preview segment wait
|
* @param {number} [options.previewMinDelayMs=30] Floor for preview segment wait
|
||||||
* @param {number} [options.previewFrameMs=16] Preview animation frame time
|
* @param {number} [options.previewFrameMs=16] Preview animation frame time
|
||||||
* @param {number} [options.timingMultiplier=1] Scales Test preview waits
|
* @param {number} [options.timingMultiplier=1] Scales Test preview waits
|
||||||
@@ -83,7 +83,7 @@ class WallPlotter {
|
|||||||
// --- Jog / UI ---
|
// --- Jog / UI ---
|
||||||
this.stepSize = options.stepSize ?? 10;
|
this.stepSize = options.stepSize ?? 10;
|
||||||
this.jogIntervalMs = options.jogIntervalMs ?? 150;
|
this.jogIntervalMs = options.jogIntervalMs ?? 150;
|
||||||
this.maxLogLines = options.maxLogLines ?? 8;
|
this.maxLogLines = options.maxLogLines ?? 40;
|
||||||
this.previewMinDelayMs = options.previewMinDelayMs ?? 30;
|
this.previewMinDelayMs = options.previewMinDelayMs ?? 30;
|
||||||
this.previewFrameMs = options.previewFrameMs ?? 16;
|
this.previewFrameMs = options.previewFrameMs ?? 16;
|
||||||
|
|
||||||
@@ -147,6 +147,7 @@ class WallPlotter {
|
|||||||
this.onLog = (line) => {
|
this.onLog = (line) => {
|
||||||
this.logLines.push(line);
|
this.logLines.push(line);
|
||||||
if (this.logLines.length > this.maxLogLines) this.logLines.shift();
|
if (this.logLines.length > this.maxLogLines) this.logLines.shift();
|
||||||
|
this._syncLogOverlay();
|
||||||
userOnLog(line);
|
userOnLog(line);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -267,6 +268,7 @@ class WallPlotter {
|
|||||||
textFont('monospace', 14);
|
textFont('monospace', 14);
|
||||||
this._drawPlotArea();
|
this._drawPlotArea();
|
||||||
this._drawHud();
|
this._drawHud();
|
||||||
|
this._syncLogOverlay();
|
||||||
if (this._keysEnabled && !this.isPlotting) this._handleContinuousJog();
|
if (this._keysEnabled && !this.isPlotting) this._handleContinuousJog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1742,6 +1744,29 @@ class WallPlotter {
|
|||||||
border-color: #444;
|
border-color: #444;
|
||||||
color: #888;
|
color: #888;
|
||||||
}
|
}
|
||||||
|
#wallplotter-log {
|
||||||
|
position: absolute;
|
||||||
|
right: 0.75rem;
|
||||||
|
bottom: 0.75rem;
|
||||||
|
z-index: 20;
|
||||||
|
max-width: min(52rem, calc(100vw - 1.5rem));
|
||||||
|
max-height: 42vh;
|
||||||
|
overflow: auto;
|
||||||
|
user-select: text;
|
||||||
|
-webkit-user-select: text;
|
||||||
|
pointer-events: auto;
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.4;
|
||||||
|
color: #c8c8d0;
|
||||||
|
background: rgba(18, 18, 22, 0.88);
|
||||||
|
border: 1px solid #3a3a42;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 0.45rem 0.6rem;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-word;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
document.head.appendChild(style);
|
document.head.appendChild(style);
|
||||||
}
|
}
|
||||||
@@ -1985,13 +2010,27 @@ class WallPlotter {
|
|||||||
text(help[i], 16, height - 16 - i * 18);
|
text(help[i], 16, height - 16 - i * 18);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
textAlign(RIGHT, BOTTOM);
|
_ensureLogOverlay() {
|
||||||
fill(140);
|
this._injectPlotButtonStyles();
|
||||||
const n = this.logLines.length;
|
let el = document.getElementById('wallplotter-log');
|
||||||
for (let i = 0; i < n; i++) {
|
if (el) return el;
|
||||||
text(this.logLines[i], width - 16, height - 16 - (n - 1 - i) * 16);
|
el = document.createElement('pre');
|
||||||
|
el.id = 'wallplotter-log';
|
||||||
|
el.setAttribute('aria-label', 'Serial log');
|
||||||
|
document.body.appendChild(el);
|
||||||
|
return el;
|
||||||
|
}
|
||||||
|
|
||||||
|
_syncLogOverlay() {
|
||||||
|
const el = this._ensureLogOverlay();
|
||||||
|
const text = this.logLines.join('\n');
|
||||||
|
if (el.textContent !== text) {
|
||||||
|
el.textContent = text;
|
||||||
|
el.scrollTop = el.scrollHeight;
|
||||||
}
|
}
|
||||||
|
el.style.display = this.logLines.length ? 'block' : 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user