Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Print Progress Info not working

    Scheduled Pinned Locked Moved
    DueUI
    2
    14
    708
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gtj0undefined
      gtj0 @stuartofmt
      last edited by

      @stuartofmt Hmmm. They should be working. I'll take a look.

      1 Reply Last reply Reply Quote 0
      • stuartofmtundefined
        stuartofmt
        last edited by

        As a "quick and dirty" i.e. not sure you would want to do it this way ....

        I inserted this to dueui.js at line 1358

        resp = await super.getJSON("/rr_fileinfo?name=");
        if (resp.ok) {
             $.extend(true, this.model, resp.data);
        }
        

        And use this in my config file to display the current print job name

        "value": "Current/Last File:     ${(state.status == 'P') ? state.fileName.substring(10) : 'Not Printing'}",
        
        gtj0undefined 1 Reply Last reply Reply Quote 0
        • gtj0undefined
          gtj0 @stuartofmt
          last edited by

          @stuartofmt The currently printing file name should be in the object model already. So does state.job.file.fileName not work?

          1 Reply Last reply Reply Quote 0
          • stuartofmtundefined
            stuartofmt
            last edited by

            No - state.job.file.fileName gives an error (see below).

            Note that there is no job element returned by the rr_status?type=XXX series of calls (see attached for type=3)

            Possible changes in DWC ? I'm using V3.1.1

            Capture.PNG

            status3.json

            gtj0undefined 1 Reply Last reply Reply Quote 0
            • gtj0undefined
              gtj0 @stuartofmt
              last edited by

              @stuartofmt Run this CGI from your web browser instead of rr_status...
              http://<duet>/rr_model?flags=fnd10

              That should return the full model.

              1 Reply Last reply Reply Quote 0
              • stuartofmtundefined
                stuartofmt
                last edited by stuartofmt

                @gtj0 said in Print Progress Info not working:

                http://<duet>/rr_model?flags=fnd10

                There does not seem to be such a call anywhere in Dueui.js - is it elsewhere?
                EDIT: Just realized that this just returns the schema.

                From the browser (recent chrome) attached is what I get.

                In any case - there is no element for job.file, let alone job.file.fileName.
                There are only two elements with "file" in the name but neither of them is a string but neither is what we are looking for.

                flags.json

                gtj0undefined 1 Reply Last reply Reply Quote 0
                • gtj0undefined
                  gtj0 @stuartofmt
                  last edited by

                  @stuartofmt dueui.json should never have to do any retrieval itself. dueui.js polls the Duet at the interval you set in settings using the "rr_model" call and keeps the top-level "state" object up to date. That being said, it does look like the model is incomplete so let me look at 3.1.1 and see what the deal is.

                  stuartofmtundefined 1 Reply Last reply Reply Quote 0
                  • stuartofmtundefined
                    stuartofmt @gtj0
                    last edited by

                    @gtj0

                    Yes - my reference to Dueui.json was a typo - I meant Dueui.js.
                    A disclaimer - my knowledge of java and js is barely one step above zero and short even of being a novice ( I even get the spelling of file extensions wrong 🙂 )

                    The Dueui.js in the version I downloaded (I believe it is the latest) has this as the relevant code (If I am interpreting correctly)

                    	async connect_once(url) {
                    		let resp = {};
                    		if (this.connected) {
                    			resp.ok = true;
                    			return resp;
                    		}
                    		try {
                    			resp = await super.getJSON(`/rr_connect?password=${ encodeURI(this.settings.duet_password) }`);
                    			if (!resp.ok) {
                    				return resp;
                    			}
                    			resp = await super.getJSON("/rr_status?type=1");
                    			if (resp.ok) {
                    				$.extend(true, this.model, resp.data);
                    			}
                    			resp = await super.getJSON("/rr_status?type=3");
                    			if (resp.ok) {
                    				$.extend(true, this.model, resp.data);
                    			}
                    			return resp;
                    		} catch(error) {
                    			console.log(error);
                    			resp.error = error;
                    			resp.ok = false;
                    		}
                    		return resp;
                    	}
                    

                    I will double check but it seems like the call /rr_status?type=1 may be redundant as all the info looks to be included in /rr_status?type=3

                    I added this your Dueui.js as an additional call to get the filename

                    			resp = await super.getJSON("/rr_fileinfo?name=");
                    			if (resp.ok) {
                    				$.extend(true, this.model, resp.data);
                    			}
                    

                    Hope this helps - I realize this is not your day job 🙂

                    gtj0undefined stuartofmtundefined 2 Replies Last reply Reply Quote 0
                    • gtj0undefined
                      gtj0 @stuartofmt
                      last edited by

                      @stuartofmt OK, I'm an idiot. I'm looking at code I hadn't pushed up yet. The day job is killing me this week but I promise I'll have everything corrected and pushed up by Sunday.

                      stuartofmtundefined 1 Reply Last reply Reply Quote 0
                      • stuartofmtundefined
                        stuartofmt @gtj0
                        last edited by

                        @gtj0

                        Don't rush on my behalf. I have got most everything working. I just did not want to go too far down a path that may end up being incompatible with your base code.

                        Again - Thanks for a terrific enhancement to the Duet world!

                        P.S. I posted my efforts in the configuration thread. Unfortunately this was before I noticed that the print info was not coming through. I will have a V3 shortly but did not want it to have to rely on my mods to dueui.js.

                        P.P.S. I have a couple of other suggestions / observations that I will put in separate threads tomorrow,

                        1 Reply Last reply Reply Quote 0
                        • stuartofmtundefined
                          stuartofmt @stuartofmt
                          last edited by stuartofmt

                          I can confirm that type=3 is a superset of type=1 - so it does indeed look like type=1 may be redundant (in the context of Dueui)
                          I suspect that the object model has evolved over time and is now more structured / consistent.

                          1 Reply Last reply Reply Quote 0
                          • gtj0undefined
                            gtj0
                            last edited by

                            Still working on stuff. Wll be Monday before teh next release.

                            1 Reply Last reply Reply Quote 0
                            • gtj0undefined
                              gtj0
                              last edited by

                              Things should be working much better now. Give the new release a try.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              Unless otherwise noted, all forum content is licensed under CC-BY-SA