Exemplo n.º 1
0
 private void Printer_PrintFinished(object sender, PrintFinishedEventArgs e)
 {
     if (isPrinting)
     {
         PrintFinished?.Invoke(this, e);
         isPrinting = false;
         isHomed    = false;
     }
     if (isFilamentChanging && filamentChangeBegin)
     {
         FilamentChangeBegin?.Invoke(this, e);
         filamentChangeBegin = false;
         videoIsPlaying      = true;
         isHomed             = false;
     }
     if (isFilamentChanging && filamentChangeEnd)
     {
         FilamentChangeEnd?.Invoke(this, e);
         filamentChangeEnd = false;
         isHomed           = false;
     }
     if (isMovedManually)
     {
         isMovedManually = false;
         MoveCompleted?.Invoke(this, null);
     }
 }
    private void setPrintFinishedText(object source, System.EventArgs args)
    {
        PrintFinishedEventArgs e=(PrintFinishedEventArgs)args;
        System.TimeSpan timePrinted = System.TimeSpan.FromSeconds(e.Time);
        string time1;
        if (timePrinted.Hours > 0)
        {
            time1 = string.Format("{0:D2}h:{1:D2}m:{2:D2}s",
                                    timePrinted.Hours,
                                    timePrinted.Minutes,
                                    timePrinted.Seconds);
        }
        else
        {
            time1 = string.Format("{0:D2}m:{1:D2}s",
                                    timePrinted.Minutes,
                                    timePrinted.Seconds);
        }

        UnityMainThreadDispatcher.Instance().Enqueue(() =>
        {
            toolTip.ToolTipText = "Druck abgeschlossen.\nDauer: " + time1;
        });
    }