Example #1
0
 public static void InvalidateSlicing()
 {
     SlicingProgressEvent?.Invoke(new SlicingProgressStatus(0, 1));
     if (Slicer != null)
     {
         Slicer.InvalidateSlicing();
     }
 }
Example #2
0
 void do_progress()
 {
     if (SlicingProgressEvent != null && active_compute != null)
     {
         if (active_compute.Finished && active_compute.Success == false)
         {
             SlicingProgressEvent?.Invoke(new SlicingProgressStatus(false));
         }
         else
         {
             int total = 1, progress = 0;
             active_compute.SafeProgressQuery(ref total, ref progress);
             SlicingProgressEvent?.Invoke(new SlicingProgressStatus(progress, total));
         }
     }
 }
Example #3
0
        public static void Initialize(FContext context)
        {
            ActiveContext = context;
            ActiveContext.Scene.SelectionChangedEvent += Scene_SelectionChangedEvent;
            ActiveContext.Scene.ChangedEvent          += Scene_ChangedEvent;

            PrinterDB = new SettingsDatabase();
            Settings  = new PrintSettings();

            PrinterDB.OnPrinterSelectionModified += PrinterDB_OnPrinterSelectionModified;
            PrinterDB.OnPresetSelectionModified  += PrinterDB_OnPresetSelectionModified;

            PrinterDB.Initialize();
            Settings.UpdateFromSettings(PrinterDB.ActivePreset.Settings);
            update_printer_bed();


            ObjSettings = new ObjectSettings();
            CCActions.UpdateObjectSettings();

            Objects = new PrintScene();

            Toolpather = new ToolpathGenerator();
            Toolpather.ToolpathsProgressEvent += (status) => {
                ToolpathProgressEvent?.Invoke(status);
            };

            Slicer = new GeometrySlicer();
            Slicer.SlicingProgressEvent += (status) => {
                SlicingProgressEvent?.Invoke(status);
            };
            Slicer.SlicingInvalidatedEvent += () => { InvalidateToolPaths(); };

            MeshAnalysis  = new MeshAnalysisManager();
            GCodeAnalysis = new GCodeAnalysisManager();
            GCodeAnalysis.EnableUpdates = false;

            FileMonitor = new ExternalFileMonitor();
        }