private void PutInFanControls(FlowLayoutWidget controlsTopToBottomLayout) { GroupBox fanControlsGroupBox = new GroupBox(new LocalizedString("Fan Controls").Translated); fanControlsGroupBox.Margin = new BorderDouble(0); fanControlsGroupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; fanControlsGroupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor; fanControlsGroupBox.HAnchor |= Agg.UI.HAnchor.ParentLeftRight; fanControlsGroupBox.VAnchor = Agg.UI.VAnchor.FitToChildren; { FlowLayoutWidget fanControlsLayout = new FlowLayoutWidget(FlowDirection.TopToBottom); fanControlsLayout.HAnchor = Agg.UI.HAnchor.ParentLeftRight; fanControlsLayout.VAnchor = Agg.UI.VAnchor.FitToChildren; fanControlsLayout.Padding = new BorderDouble(3, 5, 3, 0); { fanControlsLayout.AddChild(CreateFanControls()); } fanControlsGroupBox.AddChild(fanControlsLayout); } fanControlsContainer = new DisablablableWidget(); fanControlsContainer.AddChild(fanControlsGroupBox); if (PrinterCommunication.Instance.ActivePrinter == null || PrinterCommunication.Instance.ActivePrinter.GetFeatures().HasFan()) { controlsTopToBottomLayout.AddChild(fanControlsContainer); } }
private void AddMovementControls(FlowLayoutWidget controlsTopToBottomLayout) { Button editButton; GroupBox movementControlsGroupBox = new GroupBox(textImageButtonFactory.GenerateGroupBoxLableWithEdit(new LocalizedString("Movement Controls").Translated, out editButton)); editButton.Click += (sender, e) => { if (editSettingsWindow == null) { editSettingsWindow = new EditManualMovementSpeedsWindow("Movement Speeds", GetMovementSpeedsString(), SetMovementSpeeds); editSettingsWindow.Closed += (popupWindowSender, popupWindowSenderE) => { editSettingsWindow = null; }; } else { editSettingsWindow.BringToFront(); } }; movementControlsGroupBox.Margin = new BorderDouble(0); movementControlsGroupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; movementControlsGroupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor; movementControlsGroupBox.HAnchor |= Agg.UI.HAnchor.ParentLeftRight; movementControlsGroupBox.VAnchor = Agg.UI.VAnchor.FitToChildren; { FlowLayoutWidget manualControlsLayout = new FlowLayoutWidget(FlowDirection.TopToBottom); manualControlsLayout.HAnchor = Agg.UI.HAnchor.ParentLeftRight; manualControlsLayout.VAnchor = Agg.UI.VAnchor.FitToChildren; manualControlsLayout.Padding = new BorderDouble(3, 5, 3, 0); { manualControlsLayout.AddChild(GetHomeButtonBar()); manualControlsLayout.AddChild(CreateSeparatorLine()); manualControlsLayout.AddChild(new JogControls(new XYZColors())); manualControlsLayout.AddChild(CreateSeparatorLine()); //manualControlsLayout.AddChild(GetManualMoveBar()); } movementControlsGroupBox.AddChild(manualControlsLayout); } movementControlsContainer = new DisablablableWidget(); movementControlsContainer.AddChild(movementControlsGroupBox); controlsTopToBottomLayout.AddChild(movementControlsContainer); }
public ManualPrinterControls() { SetDisplayAttributes(); HAnchor = Agg.UI.HAnchor.Max_FitToChildren_ParentWidth; VAnchor = Agg.UI.VAnchor.FitToChildren; FlowLayoutWidget controlsTopToBottomLayout = new FlowLayoutWidget(FlowDirection.TopToBottom); controlsTopToBottomLayout.HAnchor = Agg.UI.HAnchor.Max_FitToChildren_ParentWidth; controlsTopToBottomLayout.VAnchor = Agg.UI.VAnchor.FitToChildren; controlsTopToBottomLayout.Padding = new BorderDouble(3, 0); terminalCommunicationsContainer = new DisablablableWidget(); terminalCommunicationsContainer.AddChild(CreateTerminalControlsContainer()); controlsTopToBottomLayout.AddChild(terminalCommunicationsContainer); AddTemperatureControls(controlsTopToBottomLayout); AddMovementControls(controlsTopToBottomLayout); printLevelContainer = new DisablablableWidget(); printLevelContainer.AddChild(CreatePrintLevelingControlsContainer()); controlsTopToBottomLayout.AddChild(printLevelContainer); sdCardManagerContainer = new DisablablableWidget(); sdCardManagerContainer.AddChild(CreateSdCardManagerContainer()); if (false)// || PrinterCommunication.Instance.ActivePrinter == null || PrinterCommunication.Instance.ActivePrinter.GetFeatures().HasSdCard()) { controlsTopToBottomLayout.AddChild(sdCardManagerContainer); } macroControls = new DisablablableWidget(); macroControls.AddChild(new MacroControls()); controlsTopToBottomLayout.AddChild(macroControls); PutInFanControls(controlsTopToBottomLayout); AddAdjustmentControls(controlsTopToBottomLayout); this.AddChild(controlsTopToBottomLayout); AddHandlers(); SetVisibleControls(); }
private void AddTemperatureControls(FlowLayoutWidget controlsTopToBottomLayout) { FlowLayoutWidget temperatureControlContainer = new FlowLayoutWidget(); temperatureControlContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight; extruderTemperatureControlWidget = new DisablablableWidget(); extruderTemperatureControlWidget.AddChild(new ExtruderTemperatureControlWidget()); temperatureControlContainer.AddChild(extruderTemperatureControlWidget); bedTemperatureControlWidget = new DisablablableWidget(); bedTemperatureControlWidget.AddChild(new BedTemperatureControlWidget()); if (PrinterCommunication.Instance.ActivePrinter == null || PrinterCommunication.Instance.ActivePrinter.GetFeatures().HasHeatedBed()) { temperatureControlContainer.AddChild(bedTemperatureControlWidget); } controlsTopToBottomLayout.AddChild(temperatureControlContainer); }
private void AddAdjustmentControls(FlowLayoutWidget controlsTopToBottomLayout) { GroupBox adjustmentControlsGroupBox = new GroupBox(new LocalizedString("Tuning Adjustment (while printing)").Translated); adjustmentControlsGroupBox.Margin = new BorderDouble(0); adjustmentControlsGroupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; adjustmentControlsGroupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor; adjustmentControlsGroupBox.HAnchor = Agg.UI.HAnchor.ParentLeftRight; adjustmentControlsGroupBox.Height = 93; { FlowLayoutWidget tuningRatiosLayout = new FlowLayoutWidget(FlowDirection.TopToBottom); tuningRatiosLayout.Margin = new BorderDouble(0, 0, 0, 6); tuningRatiosLayout.AnchorAll(); tuningRatiosLayout.Padding = new BorderDouble(3, 5, 3, 0); TextWidget feedRateDescription; { FlowLayoutWidget feedRateLeftToRight; { feedRateValue = new NumberEdit(1, allowDecimals: true, minValue: minFeedRateRatio, maxValue: maxFeedRateRatio, pixelWidth: 40); feedRateLeftToRight = new FlowLayoutWidget(); feedRateDescription = new TextWidget(new LocalizedString("Speed Multiplier").Translated); feedRateDescription.TextColor = RGBA_Bytes.White; feedRateLeftToRight.AddChild(feedRateDescription); feedRateRatioSlider = new Slider(new Vector2(), 300, minFeedRateRatio, maxFeedRateRatio); feedRateRatioSlider.Margin = new BorderDouble(5, 0); feedRateRatioSlider.Value = PrinterCommunication.Instance.FeedRateRatio; feedRateRatioSlider.View.BackgroundColor = new RGBA_Bytes(); feedRateRatioSlider.ValueChanged += (sender, e) => { PrinterCommunication.Instance.FeedRateRatio = feedRateRatioSlider.Value; }; PrinterCommunication.Instance.FeedRateRatioChanged.RegisterEvent(FeedRateRatioChanged_Event, ref unregisterEvents); feedRateValue.EditComplete += (sender, e) => { feedRateRatioSlider.Value = feedRateValue.Value; }; feedRateLeftToRight.AddChild(feedRateRatioSlider); tuningRatiosLayout.AddChild(feedRateLeftToRight); feedRateLeftToRight.AddChild(feedRateValue); feedRateValue.Margin = new BorderDouble(0, 0, 5, 0); textImageButtonFactory.FixedHeight = (int)feedRateValue.Height + 1; feedRateLeftToRight.AddChild(textImageButtonFactory.Generate(new LocalizedString("Set").Translated)); } TextWidget extrusionDescription; { extrusionValue = new NumberEdit(1, allowDecimals: true, minValue: minExtrutionRatio, maxValue: maxExtrusionRatio, pixelWidth: 40); FlowLayoutWidget leftToRight = new FlowLayoutWidget(); extrusionDescription = new TextWidget(new LocalizedString("Extrusion Multiplier").Translated); extrusionDescription.TextColor = RGBA_Bytes.White; leftToRight.AddChild(extrusionDescription); extrusionRatioSlider = new Slider(new Vector2(), 300, minExtrutionRatio, maxExtrusionRatio); extrusionRatioSlider.Margin = new BorderDouble(5, 0); extrusionRatioSlider.Value = PrinterCommunication.Instance.ExtrusionRatio; extrusionRatioSlider.View.BackgroundColor = new RGBA_Bytes(); extrusionRatioSlider.ValueChanged += (sender, e) => { PrinterCommunication.Instance.ExtrusionRatio = extrusionRatioSlider.Value; }; PrinterCommunication.Instance.ExtrusionRatioChanged.RegisterEvent(ExtrusionRatioChanged_Event, ref unregisterEvents); extrusionValue.EditComplete += (sender, e) => { extrusionRatioSlider.Value = extrusionValue.Value; }; leftToRight.AddChild(extrusionRatioSlider); tuningRatiosLayout.AddChild(leftToRight); leftToRight.AddChild(extrusionValue); extrusionValue.Margin = new BorderDouble(0, 0, 5, 0); textImageButtonFactory.FixedHeight = (int)extrusionValue.Height + 1; leftToRight.AddChild(textImageButtonFactory.Generate(new LocalizedString("Set").Translated)); } feedRateDescription.Width = extrusionDescription.Width; feedRateDescription.MinimumSize = new Vector2(extrusionDescription.Width, feedRateDescription.MinimumSize.y); feedRateLeftToRight.HAnchor = HAnchor.FitToChildren; feedRateLeftToRight.VAnchor = VAnchor.FitToChildren; } adjustmentControlsGroupBox.AddChild(tuningRatiosLayout); } tuningAdjustmentControlsContainer = new DisablablableWidget(); tuningAdjustmentControlsContainer.AddChild(adjustmentControlsGroupBox); controlsTopToBottomLayout.AddChild(tuningAdjustmentControlsContainer); }