quick command to log something

hi, how can i log for example the current temp? what is the code i need to write for a new quick command?

Comments

  • Are you talking about  Repetier-Server , because this is the host thread?

    The question is where do you want to log it to and which firmware are you using. For Repetier-Firmware and Marlin and RepRapFirmware it is logged if you enable logging. Anything you send or receive from firmware gets logged with enabled logger. 

    In our gui you also see temperature graphs for last 5 minutes and you can query them also externally. 
  • @Repetier
    Sorry for choosing the wrong category, yes it is about Repetier-Server.
    how do you return a value from a command for requests that come from websocket/api? I need to display the data into the frontend.
    best regards
  • Assuming from other posts that you compile your own variant and understand typescript, the send function in binding module all return a promise that contains the api response on resolve. Store it in a component variable and add the html code. Example from PrinterAction.ts
    importFiles(slug: string, folder: RSBrowseFolder, files: ServerFolderState[], asJob: boolean) {
    const arr = [];
    for (const i of files) {
    arr.push({name: i.name, url: "folder://" + folder.selectedFolder + i.path, job: asJob});
    }
    if (arr.length === 0) {
    return;
    }
    const printer: PrinterState = this.printers.printers[slug];
    this.connectionHandler.send("importURL", {files: arr, folder: printer.activeGroupId}).then((data) => {
    if (data.ok) {
    this.visualAid.bindProgressMsgToId(data.msgId, "Uploading Files");
    this.visualAid.updateProgress({msgId: data.msgId, finished: false, progress: 0, ok: true});
    }
    }, () => {
    });
    }

    You see call to importURL and later in then it gets the result of api call and from there you can do what you want.
Sign In or Register to comment.