›

Plugin - Can I get the job start timing in Repetier-host plugin

edited April 28 in Repetier-Host
I am implementing a plugin for Repetier-host, and I would like to get the timing when a print job is started like the events to get job stop timing such as JobFinishedEvent or JobStoppedEvent. Is there a way to achieve this?

Currently, I create a timer event with Windows form and make the timer monitor "IsJobRunning" at a certain interval.
However, in this way, it is impossible to get information at the moment of actual initiation...

Thank you!

Comments

  • No there is no event at the moment.   I added
    event FunctionVoid JobStartedEvent;

    for next release, but that will probably end of june as server release is first due.

  • > I added event FunctionVoid JobStartedEvent;

    Awesome!!
    I am looking forward to the release.
  • edited April 30
    Oh, could you add an event at the moment Pause print is pressed too?
    Because (at)pause command doesn't seem to generate any log, it is helpful if I can get that.

    Thank you again.
  • Actually all this is not needed. I saw there is a function to register named events in IHost.Because I'm lasy here core events informer registers to

                host.RegisterNamedEvent("core:printjobStarted", EventCatcher);
                host.RegisterNamedEvent("core:printjobFinished", EventCatcher);
                host.RegisterNamedEvent("core:printjobKilled", EventCatcher);
                host.RegisterNamedEvent("core:printjobPaused", EventCatcher);
                host.RegisterNamedEvent("core:fatalError", EventCatcher);
                host.RegisterNamedEvent("core:slicingFinished", EventCatcher);
                host.RegisterNamedEvent("core:sdprintStarted", EventCatcher);
                host.RegisterNamedEvent("core:sdprintFinished", EventCatcher);
                host.RegisterNamedEvent("core:progress_sd", EventCatcher);
                host.RegisterNamedEvent("core:progress", EventCatcher);
                host.RegisterNamedEvent("core:filamentchangeRequired", EventCatcher);

    For continue there are 2 more events:
    core:printjobBeforeContinue
    core:printjobAfterContinue

    so guess everything you need is already there.
  • Thank you for your explanations!! The event registration perfectly works.

    --
    I wrote the following registration in an initialization method.

    host.RegisterNamedEvent("core:printjobStarted", JobStartedEvent);
    host.RegisterNamedEvent("core:printjobPaused", JobPausedEvent);
     
    Then, made these methods as event catchers.

    private void JobStartedEvent(string text, object val){
       host.LogMessage("JOB STARTED");
    }

    private void JobPausedEvent(string text, object val){
      host.LogMessage("JOB PAUSED");
    }
Sign In or Register to comment.