Exemplo n.º 1
0
 public ToolBar(int ID, PrinterView printerview, LibraryView libraryview, ModelAdjustmentsDialog adjustmentsDialog, SlicerConnectionBase slicer_connection)
 {
     this.adjustmentsDialog = adjustmentsDialog;
     this.printerview       = printerview;
     this.libraryview       = libraryview;
     this.slicer_connection = slicer_connection;
 }
Exemplo n.º 2
0
 protected void AddModel(PrinterView printerView)
 {
     printerView.ModelLoadingInterface.LoadModelIntoPrinter(new PrintDetails.ObjectDetails(filename, new PrintDetails.Transform(transform.translation, transform.scaling, transform.rotation))
     {
         UID         = ObjectID,
         zipFileName = zipfilename
     });
 }
Exemplo n.º 3
0
 public SlicingFrame(int ID, GUIHost host, PrinterView printerview, PopupMessageBox message_box, SettingsManager settings_manager, PrintDialogMainWindow printDialogWindow)
     : base(ID, printDialogWindow)
 {
     this.message_box      = message_box;
     this.printerview      = printerview;
     this.settings_manager = settings_manager;
     Init(host);
 }
Exemplo n.º 4
0
 public ModelLoadingManager()
 {
     libraryview      = null;
     printerview      = null;
     messagebox       = null;
     informationbox   = null;
     modelLoadedQueue = new ConcurrentQueue <ModelLoadingManager.ModelLoadDetails>();
 }
Exemplo n.º 5
0
        protected void RemoveModel(PrinterView printerView)
        {
            if (!printerView.SelectModelbyID(ObjectID))
            {
                return;
            }

            printerView.RemoveSelectedModel();
        }
Exemplo n.º 6
0
 public PreparingToStartFrame(int ID, GUIHost host, PrinterView printer_view, PopupMessageBox message_box, RecentPrintsTab recentPrints, PrintDialogMainWindow printDialogWindow)
     : base(ID, printDialogWindow)
 {
     this.message_box  = message_box;
     printerview       = printer_view;
     this.recentPrints = recentPrints;
     printer_list      = new List <PrinterInfo>();
     countdown_timer   = new Stopwatch();
     Init(host);
 }
Exemplo n.º 7
0
        public override void Redo(PrinterView printerView)
        {
            ModelTransformPair modelById = printerView.GetModelByID(ObjectID);

            if (modelById == null)
            {
                return;
            }

            modelById.transformNode.TransformData = newTransform;
            printerView.PushUpdatedInfomation(modelById);
        }
Exemplo n.º 8
0
 public void Init(SettingsManager settings, LibraryView libraryview, PrinterView printerview, PopupMessageBox messagebox, MessagePopUp informationbox)
 {
     this.libraryview    = libraryview;
     this.printerview    = printerview;
     this.settings       = settings;
     this.messagebox     = messagebox;
     this.informationbox = informationbox;
     update_timer        = new System.Windows.Forms.Timer
     {
         Interval = 200
     };
     update_timer.Tick += new EventHandler(on_UpdateTimerTick);
     update_timer.Start();
 }
Exemplo n.º 9
0
 public PrinterStatusDialogOrganizer(SpoolerConnection spooler_connection, ModelLoadingManager modelLoadingManager, SettingsManager settingsManager, Form1 mainform, GUIHost gui_host, PrinterView printerView, PopupMessageBox messagebox)
 {
     this.spooler_connection  = spooler_connection;
     this.modelLoadingManager = modelLoadingManager;
     this.settingsManager     = settingsManager;
     this.mainform            = mainform;
     this.messagebox          = messagebox;
     this.printerView         = printerView;
     this.gui_host            = gui_host;
     this.spooler_connection.OnGotNewPrinter       += new SpoolerClient.OnGotNewPrinterDel(OnGotNewPrinter);
     this.spooler_connection.OnPrinterDisconnected += new SpoolerClient.OnPrinterDisconnectedDel(OnPrinterDisconnected);
     connected_printers = new List <PrinterStatusDialog>();
     InitGUIElement(gui_host, printerView.GetEditFrame());
 }
Exemplo n.º 10
0
 public void GenerateSlicerSettings(PrinterObject printer, PrinterView printerview)
 {
     settings = new M3D.Slicer.General.PrintSettings();
     settings.SetPrintDefaults();
     if (printer != null)
     {
         FilamentSpool currentFilament = printer.GetCurrentFilament();
         settings.filament_info = currentFilament;
         if (currentFilament.filament_type == FilamentSpool.TypeEnum.HIPS)
         {
             settings.filament_info.filament_type = FilamentSpool.TypeEnum.ABS;
         }
     }
     settings.transformation = printerview.GetObjectSlicerTransformation();
 }
Exemplo n.º 11
0
        public GetDefaultPrinterView GetInfo(string code)
        {
            using (var ctx = new ConXContext())
            {
                //whmobileprnt_default prnt_def = ctx.mobileprnt_def
                //    .Where(z=>z.MC_CODE == code).SingleOrDefault();

                string sql = "select series_no from whmobileprnt_default where mc_code = :p_mc_code";

                string prnt_def = ctx.Database.SqlQuery <string>(sql, new OracleParameter("p_mc_code", code)).SingleOrDefault();

                if (prnt_def == null)
                {
                    return(new GetDefaultPrinterView
                    {
                        serial_no = "",
                        grp_type = "",
                        prnt_point_name = "",
                        //default_no = "",
                        filepath_data = "",
                        filepath_btw = "",
                        filepath_txt = ""
                    });
                }

                else
                {
                    // whmobileprnt_ctl model = ctx.mobileprnt_ctl
                    //.Where(z => z.SERIES_NO == prnt_def.SERIES_NO).SingleOrDefault();
                    string sqlp = "select series_no serial_no , grp_type , prnt_point_name , filepath_data , filepath_btw , filepath_txt  from whmobileprnt_ctl where series_no = :p_series_no";

                    PrinterView model = ctx.Database.SqlQuery <PrinterView>(sqlp, new OracleParameter("p_series_no", prnt_def)).SingleOrDefault();


                    return(new GetDefaultPrinterView
                    {
                        serial_no = model.serial_no,
                        grp_type = model.grp_type,
                        prnt_point_name = model.prnt_point_name,
                        filepath_data = model.filepath_data,
                        filepath_btw = model.filepath_btw,
                        filepath_txt = model.filepath_txt
                    });
                }
            }
        }
Exemplo n.º 12
0
 public PrintDialogMainWindow(int ID, GUIHost host, PrinterView printerview, SpoolerConnection spooler_connection, PopupMessageBox message_box, ModelLoadingManager modelloadingmanager, SlicerConnectionBase slicer_connection, RecentPrintsTab recentPrints, SettingsManager controller)
     : base(ID)
 {
     this.host = host;
     this.spooler_connection = spooler_connection;
     this.slicer_connection  = slicer_connection;
     spooler_connection.OnSelectedPrinterChanged += new SpoolerConnection.SelectedPrinterChangedCallback(OnSelectedPrinterChanged);
     SetSize(750, 500);
     CenterHorizontallyInParent = true;
     CenterVerticallyInParent   = true;
     frames.Add(new PrintDialogFrame(1000, host, printerview, spooler_connection, message_box, modelloadingmanager, controller, this));
     frames.Add(new SlicingFrame(1001, host, printerview, message_box, controller, this));
     frames.Add(new PreparingToStartFrame(1002, host, printerview, message_box, recentPrints, this));
     frames.Add(new PreSlicingFrame(1003, host, this));
     frames.Add(new AdvancedPrintSettingsFrame(1004, host, message_box, controller, this));
     frames.Add(new PrintingToFileFrame(1005, host, message_box, this));
     foreach (IPrintDialogFrame frame in frames)
     {
         frame.Visible = false;
         AddChildElement(frame);
     }
 }
Exemplo n.º 13
0
 public PrinterViewHistory(PrinterView printerView)
 {
     this.printerView = printerView;
 }
Exemplo n.º 14
0
 public ModelListToolbox(int ID, PrinterView printerview)
     : base(ID)
 {
     this.printerview = printerview;
 }
Exemplo n.º 15
0
 public EditViewControlBar(int ID, PrinterView printerview)
     : this(ID, printerview, null)
 {
 }
Exemplo n.º 16
0
 public EditViewControlBar(int ID, PrinterView printerview, Element2D parent)
     : base(ID, parent)
 {
     this.printerview = printerview;
 }
Exemplo n.º 17
0
 public ModelAdjustmentsDialog(int ID, PrinterView printerview, Element2D parent)
     : base(ID, parent)
 {
     this.printerview = printerview;
     editmode         = ModelAdjustmentsDialog.EditMode.Undefined;
 }
Exemplo n.º 18
0
 public ModelAdjustmentsDialog(int ID, PrinterView printerview)
     : this(ID, printerview, null)
 {
 }
Exemplo n.º 19
0
        public PrintDialogFrame(int ID, GUIHost host, PrinterView printerview, SpoolerConnection spooler_connection, PopupMessageBox message_box, ModelLoadingManager modelloadingmanager, SettingsManager settings, PrintDialogMainWindow printDialogWindow)
            : base(ID, printDialogWindow)
        {
            this.modelloadingmanager = modelloadingmanager;
            this.message_box         = message_box;
            this.spooler_connection  = spooler_connection;
            this.printerview         = printerview;
            settingsManager          = settings;
            this.host = host;
            CenterHorizontallyInParent = true;
            CenterVerticallyInParent   = true;
            SetSize(750, 550);
            var printdialog = Resources.printdialog;
            var xmlFrame    = new XMLFrame(ID)
            {
                RelativeWidth  = 1f,
                RelativeHeight = 1f
            };

            AddChildElement(xmlFrame);
            xmlFrame.Init(host, printdialog, new ButtonCallback(MyButtonCallback));
            mPrintQualityButtons = new Dictionary <PrintQuality, ButtonWidget>
            {
                { PrintQuality.Expert, (ButtonWidget)FindChildElement(111) },
                { PrintQuality.VeryHighQuality, (ButtonWidget)FindChildElement(116) },
                { PrintQuality.HighQuality, (ButtonWidget)FindChildElement(112) },
                { PrintQuality.MediumQuality, (ButtonWidget)FindChildElement(113) },
                { PrintQuality.FastPrint, (ButtonWidget)FindChildElement(114) },
                { PrintQuality.VeryFastPrint, (ButtonWidget)FindChildElement(115) },
                { PrintQuality.Custom, (ButtonWidget)FindChildElement(118) }
            };
            mFillDensityButtons = new Dictionary <FillQuality, ButtonWidget>
            {
                { FillQuality.ExtraHigh, (ButtonWidget)FindChildElement(220) },
                { FillQuality.High, (ButtonWidget)FindChildElement(221) },
                { FillQuality.Medium, (ButtonWidget)FindChildElement(222) },
                { FillQuality.Low, (ButtonWidget)FindChildElement(223) },
                { FillQuality.HollowThickWalls, (ButtonWidget)FindChildElement(224) },
                { FillQuality.HollowThinWalls, (ButtonWidget)FindChildElement(225) },
                { FillQuality.Solid, (ButtonWidget)FindChildElement(227) },
                { FillQuality.Custom, (ButtonWidget)FindChildElement(228) }
            };
            print_button            = (ButtonWidget)FindChildElement(401);
            quality_scroll_list     = (HorizontalLayoutScrollList)FindChildElement(110);
            density_scroll_list     = (HorizontalLayoutScrollList)FindChildElement(219);
            printQualityPrev_button = (ButtonWidget)FindChildElement(109);
            printQualityPrev_button.SetCallback(new ButtonCallback(MyButtonCallback));
            printQualityNext_button = (ButtonWidget)FindChildElement(117);
            printQualityNext_button.SetCallback(new ButtonCallback(MyButtonCallback));
            fillDensityPrev_button = (ButtonWidget)FindChildElement(218);
            fillDensityPrev_button.SetCallback(new ButtonCallback(MyButtonCallback));
            fillDensityNext_button = (ButtonWidget)FindChildElement(226);
            fillDensityNext_button.SetCallback(new ButtonCallback(MyButtonCallback));
            support_checkbutton       = (ButtonWidget)FindChildElement(301);
            support_everywhere        = (ButtonWidget)FindChildElement(303);
            support_printbedonly      = (ButtonWidget)FindChildElement(313);
            UseWaveBonding            = (ButtonWidget)FindChildElement(305);
            raft_checkbutton          = (ButtonWidget)FindChildElement(307);
            verifybed_checkbutton     = (ButtonWidget)FindChildElement(309);
            verifybed_text            = (TextWidget)FindChildElement(310);
            printQuality_editbox      = (EditBoxWidget)FindChildElement(108);
            fillDensity_editbox       = (EditBoxWidget)FindChildElement(217);
            enableskirt_checkbutton   = (ButtonWidget)FindChildElement(311);
            heatedBedButton_checkbox  = (ButtonWidget)FindChildElement(315);
            heatedBedButton_text      = (TextWidget)FindChildElement(316);
            untetheredButton_checkbox = (ButtonWidget)FindChildElement(317);
            sdOnlyButton_checkbox     = (ButtonWidget)FindChildElement(319);
            sdOnlyButton_text         = (TextWidget)FindChildElement(320);
            sdCheckboxesFrame         = (XMLFrame)FindChildElement(321);
            mPrintQualityButtons[PrintQuality.Custom].Visible = false;
            mFillDensityButtons[FillQuality.Custom].Visible   = false;
            LoadSettings();
        }
Exemplo n.º 20
0
 public override void Undo(PrinterView printerView)
 {
     RemoveModel(printerView);
 }
Exemplo n.º 21
0
        private void glControl1_Load(object sender, EventArgs e)
        {
            OpenGLConnection = new OpenGLConnection();
            try
            {
                splashForm.Hide();
                splashForm.Show();
                splashForm.TopMost = true;
                OpenGLConnection.OnLoad(glControl1, Form1.debugLogger);
                InitGUI();
                var slicer_connection = (SlicerConnectionBase) new M3D.Slicer.Cura15_04.SlicerConnectionCura(Paths.WorkingFolder, Paths.ResourceFolder);
                model_loading_manager = new ModelLoadingManager();
                spooler_connection    = new SpoolerConnection(messagebox, informationbox, settingsManager);
                SoftwareUpdater       = new Updater(this, messagebox, spooler_connection, settingsManager);
                controlbar            = new ControlBar(this, m_gui_host, settingsManager, messagebox, informationbox, spooler_connection, model_loading_manager, SoftwareUpdater);
                var frame = new Frame(24680);
                frame.SetPosition(0, 0);
                frame.RelativeWidth  = 1f;
                frame.RelativeHeight = 1f;
                frame.BGColor        = new Color4(0.913725f, 0.905882f, 0.9098f, 1f);
                m_gui_host.AddElement(frame);
                libraryview = new LibraryView(10001, frame, glControl1, m_gui_host, informationbox, model_loading_manager);
                m_gui_host.SetFocus(1001);
                m_gui_host.Refresh();
                Form1.debugLogger.Add("glControl1_Load()", "LibraryView created.", DebugLogger.LogType.Secondary);
                printerView = new PrinterView(this, m_gui_host, OpenGLConnection, spooler_connection, slicer_connection, model_loading_manager, messagebox, informationbox, settingsManager, libraryview);
                printerView.SetViewPointPos(0.0f, 100f, 400f);
                Form1.debugLogger.Add("glControl1_Load()", "GLPrinterView created.", DebugLogger.LogType.Secondary);
                frame.AddChildElement(printerView);
                frame.AddChildElement(libraryview);
                Form1.debugLogger.Add("glControl1_Load()", "Views added to background view.", DebugLogger.LogType.Secondary);
                model_loading_manager.Init(settingsManager, libraryview, printerView, messagebox, informationbox);
                Form1.debugLogger.Add("glControl1_Load()", "Model Loading Manager Initialized.", DebugLogger.LogType.Secondary);
                printer_status_dialog_organizer = new PrinterStatusDialogOrganizer(spooler_connection, model_loading_manager, settingsManager, this, m_gui_host, printerView, messagebox);
                Form1.debugLogger.Add("glControl1_Load()", "PrinterStatusDialogOrganizer Initialized.", DebugLogger.LogType.Secondary);
                spooler_connection.SpoolerStartUp(Form1.debugLogger);
                Form1.debugLogger.Add("glControl1_Load()", "spooler_connection.SpoolerStartUp() completed.", DebugLogger.LogType.Secondary);
                controlbar.UpdateSettings();
                Form1.debugLogger.Add("glControl1_Load()", "controlbar.UpdateSettings() completed.", DebugLogger.LogType.Secondary);
                if (settingsManager.CurrentAppearanceSettings.StartFullScreen)
                {
                    WindowState = FormWindowState.Maximized;
                }
                else
                {
                    WindowState = FormWindowState.Normal;
                }

                splashForm.Close();
                Form1.debugLogger.Add("glControl1_Load()", "splash form closed.", DebugLogger.LogType.Secondary);
                glControl1.MakeCurrent();
                glControl1.VSync = false;
                Form1.debugLogger.Add("glControl1_Load()", "glcontrol sync", DebugLogger.LogType.Secondary);
                if (SplashFormFirstRun.WasRunForTheFirstTime)
                {
                    var welcomeDialog = new WelcomeDialog(1209, messagebox);
                    welcomeDialog.Init(m_gui_host);
                    m_gui_host.GlobalChildDialog += welcomeDialog;
                }
                else
                {
                    messagebox.AllowMessages = true;
                }

                Form1.debugLogger.Add("glControl1_Load()", "Welcome Initialized", DebugLogger.LogType.Secondary);
                CheckFileAssociations();
                Form1.debugLogger.Add("glControl1_Load()", "File Associations Checked", DebugLogger.LogType.Secondary);
                var num = spooler_connection.PrintSpoolerClient.IsPrinting ? 0 : (!Program.runfirst_start ? 1 : 0);
                SoftwareUpdater.CheckForUpdate(false);
                Form1.debugLogger.Add("glControl1_Load()", "Checked for updates", DebugLogger.LogType.Secondary);
            }
            catch (Exception ex)
            {
                ExceptionForm.ShowExceptionForm(ex);
            }
            if (args.Length != 0)
            {
                model_loading_manager.LoadModelIntoPrinter(args[0]);
            }

            FileAssociationSingleInstance.OnNewInstance += new NewInstanceEvent(OnNewInstanceEvent);
        }
Exemplo n.º 22
0
 public override void Redo(PrinterView printerView)
 {
     printerView.SelectModelbyID(ObjectID);
 }
Exemplo n.º 23
0
 public override void Undo(PrinterView printerView)
 {
     printerView.SelectModelbyID(previousObject);
 }
Exemplo n.º 24
0
 public override void Redo(PrinterView printerView)
 {
     AddModel(printerView);
 }
Exemplo n.º 25
0
 public abstract void Redo(PrinterView printerView);