Default Log
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
const store = require('../store/fileStore');
|
||||
const units = require('../gcode/units');
|
||||
const cfg = require('../config');
|
||||
const { ApiError } = require('../errors');
|
||||
|
||||
class ActiveState {
|
||||
@@ -114,9 +115,10 @@ class ActiveState {
|
||||
|
||||
// ---- Teaching / Editieren (persistiert) ----
|
||||
|
||||
/** Hängt die aktuelle Pose als G-Code-Zeile an (FPoint). pose: a/b/c/e in RADIAN. */
|
||||
/** Hängt die aktuelle Pose als G-Code-Zeile an (FPoint). pose: a/b/c/e in RADIAN.
|
||||
* Kein aktives Programm → Default-Programm auto-laden (backward-compat. mit log.gcode). */
|
||||
async appendPoint(pose, feedrate) {
|
||||
this._requireActive();
|
||||
if (!this.programId) await this.load(cfg.defaultProgramId);
|
||||
if (!pose) throw new ApiError(400, 'FILE_ERROR', 'pose required');
|
||||
const line = units.formatPointLine(pose, feedrate);
|
||||
this.lines.push(line);
|
||||
|
||||
@@ -14,4 +14,7 @@ module.exports = {
|
||||
// Optionaler Bearer-Token für schreibende Endpoints.
|
||||
// Fehlt er, sind Schreibzugriffe offen (Dev-Modus).
|
||||
apiKey: process.env.FILE_API_KEY || null,
|
||||
// Default-Programm, das bei FPoint automatisch geladen wird wenn keines aktiv ist.
|
||||
// Entspricht dem alten Verhalten (GCodeFiles/log.gcode immer implizit aktiv).
|
||||
defaultProgramId: process.env.DEFAULT_PROGRAM_ID || 'log',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user