Ejemplo n.º 1
0
        private void ObjSettings_OnSettingModified(ObjectSettings settings)
        {
            PrintMeshSO so = settings.SourceSO as PrintMeshSO;

            update_mesh_material(so);

            // set dirty flag on scene
            CCActions.SetCurrentSceneModified();
        }
Ejemplo n.º 2
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();
        }