2015-04-08 15:20:10 -07:00
|
|
|
|
using MatterHackers.Agg;
|
2014-10-15 16:57:26 -07:00
|
|
|
|
using MatterHackers.Agg.UI;
|
|
|
|
|
|
using MatterHackers.Localizations;
|
|
|
|
|
|
using MatterHackers.MatterControl.CustomWidgets;
|
2015-04-08 15:20:10 -07:00
|
|
|
|
using MatterHackers.MatterControl.SlicerConfiguration;
|
|
|
|
|
|
using System.Collections.Generic;
|
2014-10-15 16:57:26 -07:00
|
|
|
|
|
|
|
|
|
|
namespace MatterHackers.MatterControl.PrinterControls
|
|
|
|
|
|
{
|
2015-04-08 15:20:10 -07:00
|
|
|
|
public class TemperatureControls : ControlWidgetBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public List<DisableableWidget> ExtruderWidgetContainers = new List<DisableableWidget>();
|
|
|
|
|
|
public DisableableWidget BedTemperatureControlWidget;
|
2014-10-15 16:57:26 -07:00
|
|
|
|
|
2016-11-30 13:31:19 -08:00
|
|
|
|
public TemperatureControls()
|
2015-04-08 15:20:10 -07:00
|
|
|
|
{
|
|
|
|
|
|
AltGroupBox temperatureGroupBox = new AltGroupBox(new TextWidget("Temperature".Localize(), pointSize: 18, textColor: ActiveTheme.Instance.SecondaryAccentColor));
|
|
|
|
|
|
temperatureGroupBox.Margin = new BorderDouble(0);
|
2014-10-15 16:57:26 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
FlowLayoutWidget mainContainer = new FlowLayoutWidget(Agg.UI.FlowDirection.TopToBottom);
|
|
|
|
|
|
mainContainer.HAnchor = HAnchor.ParentLeftRight;
|
|
|
|
|
|
mainContainer.Margin = new BorderDouble(left: 0);
|
2014-10-15 16:57:26 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
temperatureGroupBox.AddChild(mainContainer);
|
|
|
|
|
|
RGBA_Bytes separatorLineColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryTextColor, 100);
|
2014-10-15 16:57:26 -07:00
|
|
|
|
|
2016-12-07 16:26:35 -08:00
|
|
|
|
int numberOfHeatedExtruders = ActiveSliceSettings.Instance.Helpers.NumberOfHotEnds();
|
2015-04-08 15:20:10 -07:00
|
|
|
|
if (numberOfHeatedExtruders > 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (int i = 0; i < numberOfHeatedExtruders; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
DisableableWidget extruderTemperatureControlWidget = new DisableableWidget();
|
|
|
|
|
|
extruderTemperatureControlWidget.AddChild(new ExtruderTemperatureControlWidget(i));
|
|
|
|
|
|
mainContainer.AddChild(extruderTemperatureControlWidget);
|
2017-05-23 10:51:12 -07:00
|
|
|
|
mainContainer.AddChild(new HorizontalLine(50));
|
2015-04-08 15:20:10 -07:00
|
|
|
|
ExtruderWidgetContainers.Add(extruderTemperatureControlWidget);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
DisableableWidget extruderTemperatureControlWidget = new DisableableWidget();
|
|
|
|
|
|
extruderTemperatureControlWidget.AddChild(new ExtruderTemperatureControlWidget());
|
|
|
|
|
|
mainContainer.AddChild(extruderTemperatureControlWidget);
|
2017-05-23 10:51:12 -07:00
|
|
|
|
mainContainer.AddChild(new HorizontalLine(50));
|
2015-04-08 15:20:10 -07:00
|
|
|
|
ExtruderWidgetContainers.Add(extruderTemperatureControlWidget);
|
|
|
|
|
|
}
|
2014-10-15 16:57:26 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
BedTemperatureControlWidget = new DisableableWidget();
|
|
|
|
|
|
BedTemperatureControlWidget.AddChild(new BedTemperatureControlWidget());
|
2014-10-15 16:57:26 -07:00
|
|
|
|
|
2016-06-21 09:38:37 -07:00
|
|
|
|
if (ActiveSliceSettings.Instance.GetValue<bool>(SettingsKey.has_heated_bed))
|
2015-04-08 15:20:10 -07:00
|
|
|
|
{
|
|
|
|
|
|
mainContainer.AddChild(BedTemperatureControlWidget);
|
|
|
|
|
|
}
|
2014-10-15 16:57:26 -07:00
|
|
|
|
|
2015-04-08 15:20:10 -07:00
|
|
|
|
this.AddChild(temperatureGroupBox);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|