示例#1
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);
        }
示例#2
0
        public void Init(GUIHost host)
        {
            X                    = 0;
            Y                    = 0;
            RelativeWidth        = 1f;
            RelativeHeight       = 1f;
            calibration_settings = new ButtonWidget(0, null)
            {
                Text          = "Calibration",
                TextColor     = new Color4(0.71f, 0.71f, 0.71f, 1f),
                TextOverColor = new Color4(1f, 1f, 1f, 1f),
                TextDownColor = new Color4(1f, 1f, 1f, 1f),
                Size          = FontSize.Medium
            };
            calibration_settings.SetCallback(new ButtonCallback(MyButtonCallback));
            calibration_settings.Init(host, "guicontrols", 513f, 64f, 575f, sbyte.MaxValue, 513f, 128f, 575f, 191f, 513f, 192f, 575f, byte.MaxValue);
            calibration_settings.SetGrowableWidth(16, 16, 48);
            calibration_settings.DontMove = true;
            calibration_settings.SetPosition(10, 10);
            calibration_settings.SetSize(200, 32);
            calibration_settings.ClickType = ButtonType.Checkable;
            calibration_settings.GroupID   = 1234;
            advancedcalibration_button     = new ButtonWidget(1, null)
            {
                Text          = "Advanced Calibration",
                TextColor     = new Color4(0.71f, 0.71f, 0.71f, 1f),
                TextOverColor = new Color4(1f, 1f, 1f, 1f),
                TextDownColor = new Color4(1f, 1f, 1f, 1f),
                Size          = FontSize.Medium
            };
            advancedcalibration_button.SetCallback(new ButtonCallback(MyButtonCallback));
            advancedcalibration_button.Init(host, "guicontrols", 576f, 64f, 639f, sbyte.MaxValue, 576f, 128f, 639f, 191f, 576f, 192f, 639f, byte.MaxValue);
            advancedcalibration_button.SetGrowableWidth(16, 16, 48);
            advancedcalibration_button.DontMove  = true;
            advancedcalibration_button.ClickType = ButtonType.Checkable;
            advancedcalibration_button.GroupID   = 1234;
            advancedcalibration_button.SetPosition(210, 10);
            advancedcalibration_button.SetSize(200, 32);
            AddChildElement(calibration_settings);
            AddChildElement(advancedcalibration_button);
            var frame = new Frame(3)
            {
                X              = 0,
                Y              = 50,
                RelativeWidth  = 1f,
                RelativeHeight = 0.85f,
                Enabled        = true,
                IgnoreMouse    = false
            };

            advanced_calibration_tab = new AdvancedCalibrationTab(1001, main_controller, messagebox, spooler_connection);
            advanced_calibration_tab.Init(host);
            advanced_calibration_tab.Visible        = false;
            advanced_calibration_tab.Enabled        = false;
            advanced_calibration_tab.RelativeWidth  = 1f;
            advanced_calibration_tab.RelativeHeight = 1f;
            advanced_calibration_tab.BGColor        = new Color4(246, 246, 246, byte.MaxValue);
            advanced_calibration_tab.BorderColor    = new Color4(220, 220, 220, byte.MaxValue);
            frame.AddChildElement(advanced_calibration_tab);
            calibration_tab = new CatScreenTab(1002, main_controller, spooler_connection, messagebox);
            calibration_tab.Init(host);
            calibration_tab.Visible        = true;
            calibration_tab.Enabled        = true;
            calibration_tab.RelativeWidth  = 1f;
            calibration_tab.RelativeHeight = 1f;
            frame.AddChildElement(calibration_tab);
            calibration_tab.BGColor     = new Color4(246, 246, 246, byte.MaxValue);
            calibration_tab.BorderColor = new Color4(220, 220, 220, byte.MaxValue);
            AddChildElement(frame);
            calibration_settings.SetChecked(true);
            active_frame = calibration_tab;
        }
示例#3
0
        public void Init(GUIHost host)
        {
            resetview_button = new ButtonWidget(8002);
            resetview_button.Init(host, "guicontrols", sbyte.MaxValue, 257f, 275f, 340f, sbyte.MaxValue, 342f, 275f, 425f, sbyte.MaxValue, 427f, 275f, 510f, sbyte.MaxValue, 512f, 275f, 595f);
            resetview_button.Text          = "";
            resetview_button.Size          = FontSize.Medium;
            resetview_button.TextColor     = new Color4(0.0f, 0.0f, 0.0f, 1f);
            resetview_button.TextDownColor = new Color4(0.0f, 0.0f, 0.0f, 1f);
            resetview_button.TextOverColor = new Color4(0.0f, 0.0f, 0.0f, 1f);
            resetview_button.Width         = 149;
            resetview_button.Height        = 84;
            resetview_button.Y             = 6;
            resetview_button.SetCallback(new ButtonCallback(MyButtonCallback));
            resetview_button.DontMove       = true;
            resetview_button.ToolTipMessage = host.Locale.T("T_TOOLTIP_RESETVIEW");
            print_button = new ButtonWidget(8003);
            print_button.Init(host, "guicontrols", 1f, 597f, 102f, 694f, 104f, 597f, 205f, 694f, 207f, 597f, 308f, 694f, 310f, 597f, 411f, 694f);
            print_button.Text          = "";
            print_button.Size          = FontSize.Medium;
            print_button.TextColor     = new Color4(0.0f, 0.0f, 0.0f, 1f);
            print_button.TextDownColor = new Color4(0.0f, 0.0f, 0.0f, 1f);
            print_button.TextOverColor = new Color4(0.0f, 0.0f, 0.0f, 1f);
            print_button.Width         = 102;
            print_button.Height        = 98;
            print_button.Y             = 0;
            print_button.X             = resetview_button.Width;
            print_button.SetCallback(new ButtonCallback(MyButtonCallback));
            print_button.DontMove       = true;
            print_button.ToolTipMessage = host.Locale.T("T_TOOLTIP_PRINT");
            centermodel_button          = new ButtonWidget(8004);
            centermodel_button.Init(host, "guicontrols", 277f, 257f, 427f, 340f, 277f, 342f, 427f, 425f, 277f, 427f, 427f, 510f, 277f, 512f, 427f, 595f);
            centermodel_button.Text          = "";
            centermodel_button.Size          = FontSize.Medium;
            centermodel_button.TextColor     = new Color4(0.0f, 0.0f, 0.0f, 1f);
            centermodel_button.TextDownColor = new Color4(0.0f, 0.0f, 0.0f, 1f);
            centermodel_button.TextOverColor = new Color4(0.0f, 0.0f, 0.0f, 1f);
            centermodel_button.Width         = 151;
            centermodel_button.Height        = 84;
            centermodel_button.Y             = 6;
            centermodel_button.X             = print_button.X + print_button.Width;
            centermodel_button.SetCallback(new ButtonCallback(MyButtonCallback));
            centermodel_button.DontMove       = true;
            centermodel_button.ToolTipMessage = host.Locale.T("T_TOOLTIP_CENTERMODEL");
            var frame = new Frame
            {
                Width  = resetview_button.Width + print_button.Width + centermodel_button.Width,
                Height = print_button.Height
            };

            frame.AddChildElement(resetview_button);
            frame.AddChildElement(print_button);
            frame.AddChildElement(centermodel_button);
            frame.Y = 0;
            frame.CenterHorizontallyInParent = true;
            backtolibrary_button             = new ButtonWidget(8005);
            backtolibrary_button.Init(host, "guicontrols", 1f, 257f, 125f, 340f, 1f, 342f, 125f, 425f, 1f, 427f, 125f, 510f, 1f, 512f, 125f, 595f);
            backtolibrary_button.Text          = "";
            backtolibrary_button.Size          = FontSize.Medium;
            backtolibrary_button.TextColor     = new Color4(0.0f, 0.0f, 0.0f, 1f);
            backtolibrary_button.TextDownColor = new Color4(0.0f, 0.0f, 0.0f, 1f);
            backtolibrary_button.TextOverColor = new Color4(0.0f, 0.0f, 0.0f, 1f);
            backtolibrary_button.Width         = 125;
            backtolibrary_button.Height        = 84;
            backtolibrary_button.X             = -125;
            backtolibrary_button.Y             = 6;
            backtolibrary_button.SetCallback(new ButtonCallback(MyButtonCallback));
            backtolibrary_button.ToolTipMessage = host.Locale.T("T_TOOLTIP_BACKTOLIBRARY");
            Sprite.pixel_perfect = false;
            AddChildElement(frame);
            AddChildElement(backtolibrary_button);
            X              = 0;
            Y              = -121;
            Height         = frame.Height;
            RelativeWidth  = 1f;
            RelativeHeight = -1000f;
        }
示例#4
0
        public override void Init()
        {
            RelativeX      = 0.0f;
            RelativeY      = 0.0f;
            RelativeWidth  = 1f;
            RelativeHeight = 1f;
            var textWidget1 = new TextWidget(1)
            {
                Color         = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text          = "Re-insert Print Bed",
                RelativeWidth = 1f,
                Size          = FontSize.Medium,
                Alignment     = QFontAlignment.Centre
            };

            textWidget1.SetPosition(0, 25);
            AddChildElement(textWidget1);
            var frame = new Frame(2);

            frame.SetPosition(0, 50);
            frame.RelativeWidth  = 1f;
            frame.RelativeHeight = 0.75f;
            frame.BGColor        = new Color4(246, 246, 246, byte.MaxValue);
            frame.BorderColor    = new Color4(220, 220, 220, byte.MaxValue);
            AddChildElement(frame);
            Sprite.pixel_perfect = true;
            var imageWidget1 = new ImageWidget(0);

            imageWidget1.Init(Host, "extendedcontrols", 240f, 512f, 359f, 612f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget1.SetSize(120, 102);
            imageWidget1.SetPosition(10, 5);
            frame.AddChildElement(imageWidget1);
            var textWidget2 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "1. Wrap extra filament back on the spool and place the filament spool into the compartment. Make sure the label filament can unravel counter-clockwise."
            };

            textWidget2.SetSize(380, 100);
            textWidget2.Size       = FontSize.Medium;
            textWidget2.Alignment  = QFontAlignment.Left;
            textWidget2.VAlignment = TextVerticalAlignment.Top;
            textWidget2.SetPosition(140, 5);
            frame.AddChildElement(textWidget2);
            var imageWidget2 = new ImageWidget(0);

            imageWidget2.Init(Host, "extendedcontrols", 120f, 613f, 239f, 713f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget2.SetSize(120, 102);
            imageWidget2.SetPosition(10, 110);
            frame.AddChildElement(imageWidget2);
            var textWidget3 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "2. Re-insert the print bed"
            };

            textWidget3.SetSize(380, 100);
            textWidget3.Size       = FontSize.Medium;
            textWidget3.Alignment  = QFontAlignment.Left;
            textWidget3.VAlignment = TextVerticalAlignment.Top;
            textWidget3.SetPosition(140, 110);
            frame.AddChildElement(textWidget3);
            var imageWidget3 = new ImageWidget(0);

            imageWidget3.Init(Host, "extendedcontrols", 120f, 512f, 239f, 612f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget3.SetSize(120, 102);
            imageWidget3.SetPosition(10, 215);
            frame.AddChildElement(imageWidget3);
            var textWidget4 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "3. Make sure the print bed is secure and pull it forward to lock it."
            };

            textWidget4.SetSize(380, 100);
            textWidget4.Size       = FontSize.Medium;
            textWidget4.Alignment  = QFontAlignment.Left;
            textWidget4.VAlignment = TextVerticalAlignment.Top;
            textWidget4.SetPosition(140, 215);
            frame.AddChildElement(textWidget4);
            Sprite.pixel_perfect = false;
            var buttonWidget = new ButtonWidget(8);

            buttonWidget.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget.Size = FontSize.Medium;
            buttonWidget.Text = "Next";
            buttonWidget.SetGrowableWidth(4, 4, 32);
            buttonWidget.SetGrowableHeight(4, 4, 32);
            buttonWidget.SetSize(100, 32);
            buttonWidget.SetPosition(400, -50);
            buttonWidget.RelativeX = 0.8f;
            buttonWidget.RelativeY = -1000f;
            buttonWidget.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget);
        }
示例#5
0
        public override void Init()
        {
            RelativeX      = 0.0f;
            RelativeY      = 0.0f;
            RelativeWidth  = 1f;
            RelativeHeight = 1f;
            var textWidget1 = new TextWidget(1)
            {
                Color         = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text          = "Open Print Bed to Remove Filament",
                RelativeWidth = 1f,
                Size          = FontSize.Medium,
                Alignment     = QFontAlignment.Centre
            };

            textWidget1.SetPosition(0, 25);
            AddChildElement(textWidget1);
            var frame = new Frame(2);

            frame.SetPosition(0, 50);
            frame.RelativeWidth  = 1f;
            frame.RelativeHeight = 0.75f;
            frame.BGColor        = new Color4(246, 246, 246, byte.MaxValue);
            frame.BorderColor    = new Color4(220, 220, 220, byte.MaxValue);
            AddChildElement(frame);
            Sprite.pixel_perfect = true;
            var imageWidget1 = new ImageWidget(0);

            imageWidget1.Init(Host, "extendedcontrols", 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget1.SetSize(120, 102);
            imageWidget1.SetPosition(10, 5);
            frame.AddChildElement(imageWidget1);
            var textWidget2 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "1. Push the print bed backwards to unlock it."
            };

            textWidget2.SetSize(380, 100);
            textWidget2.Size       = FontSize.Medium;
            textWidget2.Alignment  = QFontAlignment.Left;
            textWidget2.VAlignment = TextVerticalAlignment.Top;
            textWidget2.SetPosition(140, 5);
            frame.AddChildElement(textWidget2);
            var imageWidget2 = new ImageWidget(0);

            imageWidget2.Init(Host, "extendedcontrols", 0.0f, 613f, 119f, 713f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget2.SetSize(120, 102);
            imageWidget2.SetPosition(10, 110);
            frame.AddChildElement(imageWidget2);
            var textWidget3 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "2. Lift the print bed up to reveal the compartment underneath."
            };

            textWidget3.SetSize(380, 100);
            textWidget3.Size       = FontSize.Medium;
            textWidget3.Alignment  = QFontAlignment.Left;
            textWidget3.VAlignment = TextVerticalAlignment.Top;
            textWidget3.SetPosition(140, 110);
            frame.AddChildElement(textWidget3);
            var imageWidget3 = new ImageWidget(0);

            imageWidget3.Init(Host, "extendedcontrols", 120f, 714f, 239f, 814f, 0.0f, 512f, 119f, 612f, 0.0f, 512f, 119f, 612f);
            imageWidget3.SetSize(120, 102);
            imageWidget3.SetPosition(10, 215);
            frame.AddChildElement(imageWidget3);
            var textWidget4 = new TextWidget(1)
            {
                Color = new Color4(0.35f, 0.35f, 0.35f, 1f),
                Text  = "3. Remove the filament spool from the compartment, but do not pull the filament from the filament tube yet."
            };

            textWidget4.SetSize(380, 100);
            textWidget4.Size       = FontSize.Medium;
            textWidget4.Alignment  = QFontAlignment.Left;
            textWidget4.VAlignment = TextVerticalAlignment.Top;
            textWidget4.SetPosition(140, 215);
            frame.AddChildElement(textWidget4);
            Sprite.pixel_perfect = false;
            var buttonWidget = new ButtonWidget(8);

            buttonWidget.Init(Host, "guicontrols", 896f, 192f, 959f, byte.MaxValue, 896f, 256f, 959f, 319f, 896f, 320f, 959f, 383f, 960f, 128f, 1023f, 191f);
            buttonWidget.Size = FontSize.Medium;
            buttonWidget.Text = "Next";
            buttonWidget.SetGrowableWidth(4, 4, 32);
            buttonWidget.SetGrowableHeight(4, 4, 32);
            buttonWidget.SetSize(100, 32);
            buttonWidget.SetPosition(400, -50);
            buttonWidget.RelativeX = 0.8f;
            buttonWidget.RelativeY = -1000f;
            buttonWidget.SetCallback(new ButtonCallback(((Manage3DInkChildWindow)this).MyButtonCallback));
            AddChildElement(buttonWidget);
        }