upate vor ort

This commit is contained in:
Martin Fuchs
2026-09-02 17:34:31 +02:00
parent d97a0c1b7e
commit b802fd2a10
5 changed files with 51 additions and 12 deletions
+1 -1
View File
@@ -42,7 +42,7 @@
}
</style>
<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>
</head>
<body>
+1 -1
View File
@@ -1,6 +1,6 @@
let wp;
let area = 320;
let area = 100;
function setup() {
const canvas = createCanvas(windowWidth, windowHeight);
+1 -1
View File
@@ -42,7 +42,7 @@
}
</style>
<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>
</head>
<body>
+1 -1
View File
@@ -29,7 +29,7 @@ All options are optional.
| `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) |
| `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 |
| `previewFrameMs` | `16` | Preview animation frame time, ms |
| `timingMultiplier` | `1` | Scale **Test** preview waits (`2` = twice as slow) |
+48 -9
View File
@@ -18,7 +18,7 @@ class WallPlotter {
// Static constants
// ---------------------------------------------------------------------------
static VERSION = '2.3.5';
static VERSION = '2.3.13';
static MIN_FEED_MM_MIN = 1;
static MAX_FEED_MM_MIN = 10000;
/** 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.previewSizeMm] Offline square size (mm)
* @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.previewFrameMs=16] Preview animation frame time
* @param {number} [options.timingMultiplier=1] Scales Test preview waits
@@ -83,7 +83,7 @@ class WallPlotter {
// --- Jog / UI ---
this.stepSize = options.stepSize ?? 10;
this.jogIntervalMs = options.jogIntervalMs ?? 150;
this.maxLogLines = options.maxLogLines ?? 8;
this.maxLogLines = options.maxLogLines ?? 40;
this.previewMinDelayMs = options.previewMinDelayMs ?? 30;
this.previewFrameMs = options.previewFrameMs ?? 16;
@@ -147,6 +147,7 @@ class WallPlotter {
this.onLog = (line) => {
this.logLines.push(line);
if (this.logLines.length > this.maxLogLines) this.logLines.shift();
this._syncLogOverlay();
userOnLog(line);
};
@@ -267,6 +268,7 @@ class WallPlotter {
textFont('monospace', 14);
this._drawPlotArea();
this._drawHud();
this._syncLogOverlay();
if (this._keysEnabled && !this.isPlotting) this._handleContinuousJog();
}
@@ -1742,6 +1744,29 @@ class WallPlotter {
border-color: #444;
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);
}
@@ -1985,13 +2010,27 @@ class WallPlotter {
text(help[i], 16, height - 16 - i * 18);
}
}
textAlign(RIGHT, BOTTOM);
fill(140);
const n = this.logLines.length;
for (let i = 0; i < n; i++) {
text(this.logLines[i], width - 16, height - 16 - (n - 1 - i) * 16);
}
_ensureLogOverlay() {
this._injectPlotButtonStyles();
let el = document.getElementById('wallplotter-log');
if (el) return el;
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';
}
// ===========================================================================