commit
a7de30bdda
17 changed files with 124 additions and 376 deletions
|
|
@ -85,7 +85,6 @@ namespace MatterHackers.MatterControl
|
||||||
public Action EnterShareCode;
|
public Action EnterShareCode;
|
||||||
|
|
||||||
private static ApplicationController globalInstance;
|
private static ApplicationController globalInstance;
|
||||||
public RootedObjectEventHandler AdvancedControlsPanelReloading = new RootedObjectEventHandler();
|
|
||||||
public RootedObjectEventHandler CloudSyncStatusChanged = new RootedObjectEventHandler();
|
public RootedObjectEventHandler CloudSyncStatusChanged = new RootedObjectEventHandler();
|
||||||
public RootedObjectEventHandler DoneReloadingAll = new RootedObjectEventHandler();
|
public RootedObjectEventHandler DoneReloadingAll = new RootedObjectEventHandler();
|
||||||
public RootedObjectEventHandler PluginsLoaded = new RootedObjectEventHandler();
|
public RootedObjectEventHandler PluginsLoaded = new RootedObjectEventHandler();
|
||||||
|
|
@ -471,11 +470,6 @@ namespace MatterHackers.MatterControl
|
||||||
}
|
}
|
||||||
}, ref unregisterEvents);
|
}, ref unregisterEvents);
|
||||||
|
|
||||||
ActiveSliceSettings.MaterialPresetChanged += (s, e) =>
|
|
||||||
{
|
|
||||||
ApplicationController.Instance.ReloadAdvancedControlsPanel();
|
|
||||||
};
|
|
||||||
|
|
||||||
ActiveSliceSettings.SettingChanged.RegisterEvent((s, e) =>
|
ActiveSliceSettings.SettingChanged.RegisterEvent((s, e) =>
|
||||||
{
|
{
|
||||||
if (e is StringEventArgs stringArg
|
if (e is StringEventArgs stringArg
|
||||||
|
|
@ -748,11 +742,6 @@ namespace MatterHackers.MatterControl
|
||||||
return string.IsNullOrEmpty(libraryItem.ID) ? null : ApplicationController.CacheablePath("ItemThumbnails", $"{libraryItem.ID}.png");
|
return string.IsNullOrEmpty(libraryItem.ID) ? null : ApplicationController.CacheablePath("ItemThumbnails", $"{libraryItem.ID}.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReloadAdvancedControlsPanel()
|
|
||||||
{
|
|
||||||
AdvancedControlsPanelReloading.CallEvents(this, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SwitchToPurchasedLibrary()
|
public void SwitchToPurchasedLibrary()
|
||||||
{
|
{
|
||||||
var purchasedContainer = Library.RootLibaryContainer.ChildContainers.Where(c => c.ID == "LibraryProviderPurchasedKey").FirstOrDefault();
|
var purchasedContainer = Library.RootLibaryContainer.ChildContainers.Where(c => c.ID == "LibraryProviderPurchasedKey").FirstOrDefault();
|
||||||
|
|
@ -865,14 +854,13 @@ namespace MatterHackers.MatterControl
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RunSetupIfRequired()
|
private static void RunSetupIfRequired()
|
||||||
{
|
{
|
||||||
ApplicationController.Instance.ReloadAdvancedControlsPanel();
|
if (!ProfileManager.Instance.ActiveProfiles.Any())
|
||||||
if (!ProfileManager.Instance.ActiveProfiles.Any())
|
{
|
||||||
{
|
// Start the setup wizard if no profiles exist
|
||||||
// Start the setup wizard if no profiles exist
|
UiThread.RunOnIdle(() => WizardWindow.Show(PrinterSetup.GetBestStartPage()));
|
||||||
UiThread.RunOnIdle(() => WizardWindow.Show(PrinterSetup.GetBestStartPage()));
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private EventHandler unregisterEvent;
|
private EventHandler unregisterEvent;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -203,8 +203,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
||||||
levelingData.SampledPositions.Clear();
|
levelingData.SampledPositions.Clear();
|
||||||
printer.Settings.SetValue(SettingsKey.baby_step_z_offset, "0");
|
printer.Settings.SetValue(SettingsKey.baby_step_z_offset, "0");
|
||||||
|
|
||||||
ApplicationController.Instance.ReloadAdvancedControlsPanel();
|
|
||||||
|
|
||||||
LevelWizardBase printLevelWizardWindow;
|
LevelWizardBase printLevelWizardWindow;
|
||||||
switch (levelingData.CurrentPrinterLevelingSystem)
|
switch (levelingData.CurrentPrinterLevelingSystem)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,8 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
||||||
|
|
||||||
public ListViewItemBase AddItem(ListViewItem item)
|
public ListViewItemBase AddItem(ListViewItem item)
|
||||||
{
|
{
|
||||||
|
reflowingContent = true;
|
||||||
|
|
||||||
var iconView = new IconViewItem(item, this.ThumbWidth, this.ThumbHeight);
|
var iconView = new IconViewItem(item, this.ThumbWidth, this.ThumbHeight);
|
||||||
iconView.Margin = new BorderDouble(leftRightMargin, 0);
|
iconView.Margin = new BorderDouble(leftRightMargin, 0);
|
||||||
|
|
||||||
|
|
@ -139,6 +141,8 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
||||||
|
|
||||||
AddColumnAndChild(iconView);
|
AddColumnAndChild(iconView);
|
||||||
|
|
||||||
|
reflowingContent = false;
|
||||||
|
|
||||||
return iconView;
|
return iconView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,12 +59,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, ref unregisterEvents);
|
}, ref unregisterEvents);
|
||||||
|
|
||||||
// TODO: Why do we clear GCode on AdvancedControlsPanelReloading - assume some slice settings should invalidate. If so, code should be more specific and bound to slice settings changed
|
|
||||||
ApplicationController.Instance.AdvancedControlsPanelReloading.RegisterEvent((s, e) =>
|
|
||||||
{
|
|
||||||
printer?.Bed.GCodeRenderer?.Clear3DGCode();
|
|
||||||
}, ref unregisterEvents);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void CreateAndAddChildren(PrinterConfig printer)
|
internal void CreateAndAddChildren(PrinterConfig printer)
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
view3DContainer.AnchorAll();
|
view3DContainer.AnchorAll();
|
||||||
|
|
||||||
view3DContainer.AddChild(view3DWidget);
|
view3DContainer.AddChild(view3DWidget);
|
||||||
view3DContainer.AddChild(PrintProgressWidget(printer));
|
|
||||||
|
|
||||||
leftToRight.AddChild(view3DContainer);
|
leftToRight.AddChild(view3DContainer);
|
||||||
|
|
||||||
|
|
@ -129,104 +128,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
this.AnchorAll();
|
this.AnchorAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private GuiWidget PrintProgressWidget(PrinterConfig printer)
|
|
||||||
{
|
|
||||||
var bodyRow = new GuiWidget(300, 450)
|
|
||||||
{
|
|
||||||
HAnchor = HAnchor.Center,
|
|
||||||
VAnchor = VAnchor.Center,
|
|
||||||
BackgroundColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryBackgroundColor, 128),
|
|
||||||
Selectable = false
|
|
||||||
};
|
|
||||||
|
|
||||||
// Progress section
|
|
||||||
var expandingContainer = new HorizontalSpacer()
|
|
||||||
{
|
|
||||||
VAnchor = VAnchor.Fit | VAnchor.Center
|
|
||||||
};
|
|
||||||
bodyRow.AddChild(expandingContainer);
|
|
||||||
|
|
||||||
var progressContainer = new FlowLayoutWidget(FlowDirection.TopToBottom)
|
|
||||||
{
|
|
||||||
Margin = new BorderDouble(50, 0),
|
|
||||||
VAnchor = VAnchor.Center | VAnchor.Fit,
|
|
||||||
HAnchor = HAnchor.Center | HAnchor.Fit,
|
|
||||||
};
|
|
||||||
expandingContainer.AddChild(progressContainer);
|
|
||||||
|
|
||||||
var progressDial = new ProgressDial()
|
|
||||||
{
|
|
||||||
HAnchor = HAnchor.Center,
|
|
||||||
Height = 200 * DeviceScale,
|
|
||||||
Width = 200 * DeviceScale
|
|
||||||
};
|
|
||||||
progressContainer.AddChild(progressDial);
|
|
||||||
|
|
||||||
var timeContainer = new FlowLayoutWidget()
|
|
||||||
{
|
|
||||||
HAnchor = HAnchor.Center | HAnchor.Fit,
|
|
||||||
Margin = 3
|
|
||||||
};
|
|
||||||
progressContainer.AddChild(timeContainer);
|
|
||||||
|
|
||||||
var timeImage = AggContext.StaticData.LoadImage(Path.Combine("Images", "Screensaver", "time.png"));
|
|
||||||
if (!ActiveTheme.Instance.IsDarkTheme)
|
|
||||||
{
|
|
||||||
timeImage.InvertLightness();
|
|
||||||
}
|
|
||||||
|
|
||||||
timeContainer.AddChild(new ImageWidget(timeImage));
|
|
||||||
|
|
||||||
var timeWidget = new TextWidget("", pointSize: 22, textColor: ActiveTheme.Instance.PrimaryTextColor)
|
|
||||||
{
|
|
||||||
AutoExpandBoundsToText = true,
|
|
||||||
Margin = new BorderDouble(10, 0, 0, 0),
|
|
||||||
VAnchor = VAnchor.Center,
|
|
||||||
};
|
|
||||||
|
|
||||||
timeContainer.AddChild(timeWidget);
|
|
||||||
|
|
||||||
Action updatePrintProgress = null;
|
|
||||||
updatePrintProgress = () =>
|
|
||||||
{
|
|
||||||
int secondsPrinted = printer.Connection.SecondsPrinted;
|
|
||||||
int hoursPrinted = (int)(secondsPrinted / (60 * 60));
|
|
||||||
int minutesPrinted = (secondsPrinted / 60 - hoursPrinted * 60);
|
|
||||||
secondsPrinted = secondsPrinted % 60;
|
|
||||||
|
|
||||||
// TODO: Consider if the consistency of a common time format would look and feel better than changing formats based on elapsed duration
|
|
||||||
timeWidget.Text = (hoursPrinted <= 0) ? $"{minutesPrinted}:{secondsPrinted:00}" : $"{hoursPrinted}:{minutesPrinted:00}:{secondsPrinted:00}";
|
|
||||||
|
|
||||||
progressDial.LayerCount = printer.Connection.CurrentlyPrintingLayer;
|
|
||||||
progressDial.LayerCompletedRatio = printer.Connection.RatioIntoCurrentLayer;
|
|
||||||
progressDial.CompletedRatio = printer.Connection.PercentComplete / 100;
|
|
||||||
|
|
||||||
if (!HasBeenClosed)
|
|
||||||
{
|
|
||||||
switch (printer.Connection.CommunicationState)
|
|
||||||
{
|
|
||||||
case CommunicationStates.PreparingToPrint:
|
|
||||||
case CommunicationStates.Printing:
|
|
||||||
case CommunicationStates.Paused:
|
|
||||||
bodyRow.Visible = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
bodyRow.Visible = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
UiThread.RunOnIdle(updatePrintProgress, 1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
UiThread.RunOnIdle(updatePrintProgress, 1);
|
|
||||||
|
|
||||||
bodyRow.Visible = false;
|
|
||||||
|
|
||||||
return bodyRow;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual GuiWidget GetViewControls3DOverflowMenu()
|
protected virtual GuiWidget GetViewControls3DOverflowMenu()
|
||||||
{
|
{
|
||||||
return view3DWidget.ShowOverflowMenu();
|
return view3DWidget.ShowOverflowMenu();
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,17 @@ either expressed or implied, of the FreeBSD Project.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using MatterHackers.Agg;
|
using MatterHackers.Agg;
|
||||||
|
using MatterHackers.Agg.ImageProcessing;
|
||||||
using MatterHackers.Agg.OpenGlGui;
|
using MatterHackers.Agg.OpenGlGui;
|
||||||
|
using MatterHackers.Agg.Platform;
|
||||||
using MatterHackers.Agg.UI;
|
using MatterHackers.Agg.UI;
|
||||||
using MatterHackers.GCodeVisualizer;
|
using MatterHackers.GCodeVisualizer;
|
||||||
using MatterHackers.Localizations;
|
using MatterHackers.Localizations;
|
||||||
using MatterHackers.MatterControl.CustomWidgets;
|
using MatterHackers.MatterControl.CustomWidgets;
|
||||||
|
using MatterHackers.MatterControl.PrinterCommunication;
|
||||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||||
using MatterHackers.MeshVisualizer;
|
using MatterHackers.MeshVisualizer;
|
||||||
using MatterHackers.VectorMath;
|
using MatterHackers.VectorMath;
|
||||||
|
|
@ -123,6 +127,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
};
|
};
|
||||||
view3DContainer.AddChild(layerRenderRatioSlider);
|
view3DContainer.AddChild(layerRenderRatioSlider);
|
||||||
|
|
||||||
|
view3DContainer.AddChild(PrintProgressWidget(printer));
|
||||||
|
|
||||||
AddSettingsTabBar(leftToRight, view3DWidget);
|
AddSettingsTabBar(leftToRight, view3DWidget);
|
||||||
|
|
||||||
sceneContext.LoadedGCodeChanged += BedPlate_LoadedGCodeChanged;
|
sceneContext.LoadedGCodeChanged += BedPlate_LoadedGCodeChanged;
|
||||||
|
|
@ -578,5 +584,103 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
HAnchor = HAnchor.Stretch
|
HAnchor = HAnchor.Stretch
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private GuiWidget PrintProgressWidget(PrinterConfig printer)
|
||||||
|
{
|
||||||
|
var bodyRow = new GuiWidget(300, 450)
|
||||||
|
{
|
||||||
|
HAnchor = HAnchor.Center,
|
||||||
|
VAnchor = VAnchor.Center,
|
||||||
|
BackgroundColor = new RGBA_Bytes(ActiveTheme.Instance.PrimaryBackgroundColor, 128),
|
||||||
|
Selectable = false
|
||||||
|
};
|
||||||
|
|
||||||
|
// Progress section
|
||||||
|
var expandingContainer = new HorizontalSpacer()
|
||||||
|
{
|
||||||
|
VAnchor = VAnchor.Fit | VAnchor.Center
|
||||||
|
};
|
||||||
|
bodyRow.AddChild(expandingContainer);
|
||||||
|
|
||||||
|
var progressContainer = new FlowLayoutWidget(FlowDirection.TopToBottom)
|
||||||
|
{
|
||||||
|
Margin = new BorderDouble(50, 0),
|
||||||
|
VAnchor = VAnchor.Center | VAnchor.Fit,
|
||||||
|
HAnchor = HAnchor.Center | HAnchor.Fit,
|
||||||
|
};
|
||||||
|
expandingContainer.AddChild(progressContainer);
|
||||||
|
|
||||||
|
var progressDial = new ProgressDial()
|
||||||
|
{
|
||||||
|
HAnchor = HAnchor.Center,
|
||||||
|
Height = 200 * DeviceScale,
|
||||||
|
Width = 200 * DeviceScale
|
||||||
|
};
|
||||||
|
progressContainer.AddChild(progressDial);
|
||||||
|
|
||||||
|
var timeContainer = new FlowLayoutWidget()
|
||||||
|
{
|
||||||
|
HAnchor = HAnchor.Center | HAnchor.Fit,
|
||||||
|
Margin = 3
|
||||||
|
};
|
||||||
|
progressContainer.AddChild(timeContainer);
|
||||||
|
|
||||||
|
var timeImage = AggContext.StaticData.LoadImage(Path.Combine("Images", "Screensaver", "time.png"));
|
||||||
|
if (!ActiveTheme.Instance.IsDarkTheme)
|
||||||
|
{
|
||||||
|
timeImage.InvertLightness();
|
||||||
|
}
|
||||||
|
|
||||||
|
timeContainer.AddChild(new ImageWidget(timeImage));
|
||||||
|
|
||||||
|
var timeWidget = new TextWidget("", pointSize: 22, textColor: ActiveTheme.Instance.PrimaryTextColor)
|
||||||
|
{
|
||||||
|
AutoExpandBoundsToText = true,
|
||||||
|
Margin = new BorderDouble(10, 0, 0, 0),
|
||||||
|
VAnchor = VAnchor.Center,
|
||||||
|
};
|
||||||
|
|
||||||
|
timeContainer.AddChild(timeWidget);
|
||||||
|
|
||||||
|
Action updatePrintProgress = null;
|
||||||
|
updatePrintProgress = () =>
|
||||||
|
{
|
||||||
|
int secondsPrinted = printer.Connection.SecondsPrinted;
|
||||||
|
int hoursPrinted = (int)(secondsPrinted / (60 * 60));
|
||||||
|
int minutesPrinted = (secondsPrinted / 60 - hoursPrinted * 60);
|
||||||
|
secondsPrinted = secondsPrinted % 60;
|
||||||
|
|
||||||
|
// TODO: Consider if the consistency of a common time format would look and feel better than changing formats based on elapsed duration
|
||||||
|
timeWidget.Text = (hoursPrinted <= 0) ? $"{minutesPrinted}:{secondsPrinted:00}" : $"{hoursPrinted}:{minutesPrinted:00}:{secondsPrinted:00}";
|
||||||
|
|
||||||
|
progressDial.LayerCount = printer.Connection.CurrentlyPrintingLayer;
|
||||||
|
progressDial.LayerCompletedRatio = printer.Connection.RatioIntoCurrentLayer;
|
||||||
|
progressDial.CompletedRatio = printer.Connection.PercentComplete / 100;
|
||||||
|
|
||||||
|
if (!HasBeenClosed)
|
||||||
|
{
|
||||||
|
switch (printer.Connection.CommunicationState)
|
||||||
|
{
|
||||||
|
case CommunicationStates.PreparingToPrint:
|
||||||
|
case CommunicationStates.Printing:
|
||||||
|
case CommunicationStates.Paused:
|
||||||
|
bodyRow.Visible = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
bodyRow.Visible = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
UiThread.RunOnIdle(updatePrintProgress, 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
UiThread.RunOnIdle(updatePrintProgress, 1);
|
||||||
|
|
||||||
|
bodyRow.Visible = false;
|
||||||
|
|
||||||
|
return bodyRow;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ namespace MatterHackers.MatterControl.PrinterControls
|
||||||
if (!string.IsNullOrEmpty(speedString))
|
if (!string.IsNullOrEmpty(speedString))
|
||||||
{
|
{
|
||||||
printer.Settings.SetValue(SettingsKey.manual_movement_speeds, speedString);
|
printer.Settings.SetValue(SettingsKey.manual_movement_speeds, speedString);
|
||||||
ApplicationController.Instance.ReloadAdvancedControlsPanel();
|
printer.Bed.GCodeRenderer?.Clear3DGCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,6 @@ namespace MatterHackers.MatterControl
|
||||||
};
|
};
|
||||||
|
|
||||||
ActiveSliceSettings.Instance.Merge(destinationLayer, settingsToImport, sourceFilter, false);
|
ActiveSliceSettings.Instance.Merge(destinationLayer, settingsToImport, sourceFilter, false);
|
||||||
UiThread.RunOnIdle(ApplicationController.Instance.ReloadAdvancedControlsPanel);
|
|
||||||
|
|
||||||
string successMessage = importPrinterSuccessMessage.FormatWith(Path.GetFileNameWithoutExtension(settingsFilePath));
|
string successMessage = importPrinterSuccessMessage.FormatWith(Path.GetFileNameWithoutExtension(settingsFilePath));
|
||||||
if (!isMergeIntoUserLayer)
|
if (!isMergeIntoUserLayer)
|
||||||
|
|
@ -556,8 +555,6 @@ namespace MatterHackers.MatterControl
|
||||||
if (containsValidSetting)
|
if (containsValidSetting)
|
||||||
{
|
{
|
||||||
activeSettings.Save();
|
activeSettings.Save();
|
||||||
|
|
||||||
UiThread.RunOnIdle(ApplicationController.Instance.ReloadAdvancedControlsPanel);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -156,8 +156,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
printer.Settings.SetMaterialPreset(extruderIndex, "");
|
printer.Settings.SetMaterialPreset(extruderIndex, "");
|
||||||
printer.Settings.MaterialLayers.Remove(layerToEdit);
|
printer.Settings.MaterialLayers.Remove(layerToEdit);
|
||||||
printer.Settings.Save();
|
printer.Settings.Save();
|
||||||
|
|
||||||
UiThread.RunOnIdle(() => ApplicationController.Instance.ReloadAdvancedControlsPanel());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -165,7 +163,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
ApplicationController.Instance.EditMaterialPresetsWindow.Closed += (s, e2) =>
|
ApplicationController.Instance.EditMaterialPresetsWindow.Closed += (s, e2) =>
|
||||||
{
|
{
|
||||||
ApplicationController.Instance.EditMaterialPresetsWindow = null;
|
ApplicationController.Instance.EditMaterialPresetsWindow = null;
|
||||||
ApplicationController.Instance.ReloadAdvancedControlsPanel();
|
|
||||||
};
|
};
|
||||||
ApplicationController.Instance.EditMaterialPresetsWindow.ShowAsSystemWindow();
|
ApplicationController.Instance.EditMaterialPresetsWindow.ShowAsSystemWindow();
|
||||||
}
|
}
|
||||||
|
|
@ -196,8 +193,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
printer.Settings.ActiveQualityKey = "";
|
printer.Settings.ActiveQualityKey = "";
|
||||||
printer.Settings.QualityLayers.Remove(layerToEdit);
|
printer.Settings.QualityLayers.Remove(layerToEdit);
|
||||||
printer.Settings.Save();
|
printer.Settings.Save();
|
||||||
|
|
||||||
UiThread.RunOnIdle(() => ApplicationController.Instance.ReloadAdvancedControlsPanel());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -205,7 +200,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
ApplicationController.Instance.EditQualityPresetsWindow.Closed += (s, e2) =>
|
ApplicationController.Instance.EditQualityPresetsWindow.Closed += (s, e2) =>
|
||||||
{
|
{
|
||||||
ApplicationController.Instance.EditQualityPresetsWindow = null;
|
ApplicationController.Instance.EditQualityPresetsWindow = null;
|
||||||
ApplicationController.Instance.ReloadAdvancedControlsPanel();
|
|
||||||
};
|
};
|
||||||
ApplicationController.Instance.EditQualityPresetsWindow.ShowAsSystemWindow();
|
ApplicationController.Instance.EditQualityPresetsWindow.ShowAsSystemWindow();
|
||||||
}
|
}
|
||||||
|
|
@ -365,7 +359,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
|
|
||||||
UiThread.RunOnIdle(() =>
|
UiThread.RunOnIdle(() =>
|
||||||
{
|
{
|
||||||
ApplicationController.Instance.ReloadAdvancedControlsPanel();
|
|
||||||
foreach (var keyName in PrinterSettings.KnownSettings)
|
foreach (var keyName in PrinterSettings.KnownSettings)
|
||||||
{
|
{
|
||||||
if (settingBeforeChange[keyName] != printer.Settings.GetValue(keyName))
|
if (settingBeforeChange[keyName] != printer.Settings.GetValue(keyName))
|
||||||
|
|
|
||||||
|
|
@ -260,12 +260,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Save();
|
this.Save();
|
||||||
|
|
||||||
// TODO: Define and fire event - model objects need to be dependency free. For the time being prevent application spin up in ClearPlate due to the call below - if MC isn't loaded, don't notify
|
|
||||||
if (!MatterControlApplication.IsLoading)
|
|
||||||
{
|
|
||||||
ApplicationController.Instance.ReloadAdvancedControlsPanel();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal PrinterSettingsLayer GetMaterialLayer(string layerID)
|
internal PrinterSettingsLayer GetMaterialLayer(string layerID)
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||||
|
|
||||||
if (onlyReloadSliceSettings)
|
if (onlyReloadSliceSettings)
|
||||||
{
|
{
|
||||||
ApplicationController.Instance.ReloadAdvancedControlsPanel();
|
printer?.Bed.GCodeRenderer?.Clear3DGCode();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit f7db2a8382004deb51bd2f5b23a462fed0d2c47e
|
Subproject commit 25a631505a43b1c40782777b017dd8e2a42220a0
|
||||||
|
|
@ -165,7 +165,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
||||||
|
|
||||||
testRunner.Delay(.5);
|
testRunner.Delay(.5);
|
||||||
testRunner.Type("Batman Renamed");
|
testRunner.Type("Batman Renamed");
|
||||||
testRunner.ClickByName("Rename Button");
|
testRunner.ClickByName("InputBoxPage Action Button");
|
||||||
Assert.IsTrue(testRunner.WaitForName("Row Item Batman Renamed", 2));
|
Assert.IsTrue(testRunner.WaitForName("Row Item Batman Renamed", 2));
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|
|
||||||
|
|
@ -86,13 +86,13 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
||||||
|
|
||||||
// Open and wait rename window
|
// Open and wait rename window
|
||||||
testRunner.LibraryRenameSelectedItem();
|
testRunner.LibraryRenameSelectedItem();
|
||||||
testRunner.WaitForName("Rename Button");
|
testRunner.WaitForName("InputBoxPage Action Button");
|
||||||
|
|
||||||
testRunner.Delay(1);
|
testRunner.Delay(1);
|
||||||
|
|
||||||
// Rename item
|
// Rename item
|
||||||
testRunner.Type("Rook Renamed");
|
testRunner.Type("Rook Renamed");
|
||||||
testRunner.ClickByName("Rename Button");
|
testRunner.ClickByName("InputBoxPage Action Button");
|
||||||
|
|
||||||
// Confirm
|
// Confirm
|
||||||
Assert.IsTrue(testRunner.WaitForName("Row Item Rook Renamed"));
|
Assert.IsTrue(testRunner.WaitForName("Row Item Rook Renamed"));
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
||||||
testRunner.AddItemToBedplate("", "Row Item Rook");
|
testRunner.AddItemToBedplate("", "Row Item Rook");
|
||||||
|
|
||||||
testRunner.SwitchToAdvancedSliceSettings();
|
testRunner.SwitchToAdvancedSliceSettings();
|
||||||
testRunner.ClickByName("Raft / Priming Tab");
|
testRunner.ClickByName("Raft / Skirt / Brim Tab");
|
||||||
testRunner.ClickByName("Create Raft Field");
|
testRunner.ClickByName("Create Raft Field");
|
||||||
|
|
||||||
testRunner.StartSlicing();
|
testRunner.StartSlicing();
|
||||||
|
|
@ -65,6 +65,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
||||||
// Force lose focus to drop Slice popup window to expose OverFlow menu
|
// Force lose focus to drop Slice popup window to expose OverFlow menu
|
||||||
testRunner.ClickByName("Library Up Button");
|
testRunner.ClickByName("Library Up Button");
|
||||||
|
|
||||||
|
testRunner.ClickByName("Pin Settings Button");
|
||||||
|
|
||||||
testRunner.ClickByName("View3D Overflow Menu");
|
testRunner.ClickByName("View3D Overflow Menu");
|
||||||
testRunner.ClickByName("Sync To Print Checkbox");
|
testRunner.ClickByName("Sync To Print Checkbox");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,6 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="MatterControl\BrailleGrade2Tests.cs" />
|
<Compile Include="MatterControl\BrailleGrade2Tests.cs" />
|
||||||
<Compile Include="MatterControl\InteractiveSceneTests.cs" />
|
<Compile Include="MatterControl\InteractiveSceneTests.cs" />
|
||||||
<Compile Include="MatterControl\PerformanceTests.cs" />
|
|
||||||
<Compile Include="MatterControl\ImportSettingsTests.cs" />
|
<Compile Include="MatterControl\ImportSettingsTests.cs" />
|
||||||
<Compile Include="MatterControl\SliceSettingsFieldTests.cs" />
|
<Compile Include="MatterControl\SliceSettingsFieldTests.cs" />
|
||||||
<Compile Include="MatterControl\SettingsParseTests.cs" />
|
<Compile Include="MatterControl\SettingsParseTests.cs" />
|
||||||
|
|
|
||||||
|
|
@ -1,226 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (c) 2014, Lars Brubaker
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice, this
|
|
||||||
list of conditions and the following disclaimer.
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer in the documentation
|
|
||||||
and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
||||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
The views and conclusions contained in the software and documentation are those
|
|
||||||
of the authors and should not be interpreted as representing official policies,
|
|
||||||
either expressed or implied, of the FreeBSD Project.
|
|
||||||
*/
|
|
||||||
|
|
||||||
using MatterHackers.Agg;
|
|
||||||
using MatterHackers.Agg.UI;
|
|
||||||
using MatterHackers.GuiAutomation;
|
|
||||||
using MatterHackers.MatterControl.Tests.Automation;
|
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace MatterHackers.MatterControl
|
|
||||||
{
|
|
||||||
public static class PerformanceTests
|
|
||||||
{
|
|
||||||
public static void ReportDrawTimeWhileSwitching(GuiWidget container, string firstWidgetName, string secondWidgetName, double switchTimeSeconds)
|
|
||||||
{
|
|
||||||
StatisticsTracker testTracker = new StatisticsTracker("SwitchBetweenTabs");
|
|
||||||
bool clickFirstItem = true;
|
|
||||||
bool done = false;
|
|
||||||
AutomationRunner clickPreview;
|
|
||||||
Stopwatch timeSinceLastClick = Stopwatch.StartNew();
|
|
||||||
Stopwatch totalDrawTime = Stopwatch.StartNew();
|
|
||||||
int drawCount = 0;
|
|
||||||
|
|
||||||
EventHandler formLoad = (s, e) =>
|
|
||||||
{
|
|
||||||
clickPreview = new AutomationRunner();
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
while (!done)
|
|
||||||
{
|
|
||||||
if (clickPreview != null && timeSinceLastClick.Elapsed.TotalSeconds > switchTimeSeconds)
|
|
||||||
{
|
|
||||||
if (clickFirstItem)
|
|
||||||
{
|
|
||||||
clickPreview.ClickByName(firstWidgetName);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
clickPreview.ClickByName(secondWidgetName);
|
|
||||||
}
|
|
||||||
clickFirstItem = !clickFirstItem;
|
|
||||||
timeSinceLastClick.Restart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
container.Load += formLoad;
|
|
||||||
|
|
||||||
container.BeforeDraw += (sender, e) =>
|
|
||||||
{
|
|
||||||
totalDrawTime.Restart();
|
|
||||||
};
|
|
||||||
|
|
||||||
EventHandler<DrawEventArgs> afterDraw = null;
|
|
||||||
afterDraw = (sender, e) =>
|
|
||||||
{
|
|
||||||
totalDrawTime.Stop();
|
|
||||||
if (drawCount++ > 30 && testTracker.Count < 100)
|
|
||||||
{
|
|
||||||
testTracker.AddValue(totalDrawTime.ElapsedMilliseconds);
|
|
||||||
if (testTracker.Count == 100)
|
|
||||||
{
|
|
||||||
Trace.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(testTracker));
|
|
||||||
container.Load -= formLoad;
|
|
||||||
container.BeforeDraw -= afterDraw;
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
container.AfterDraw += afterDraw;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ClickStuff(GuiWidget container, string[] clickThings, double secondsBetweenClicks = .1)
|
|
||||||
{
|
|
||||||
AutomationRunner clickPreview;
|
|
||||||
|
|
||||||
EventHandler<DrawEventArgs> beforeDraw = null;
|
|
||||||
beforeDraw = (sender, e) =>
|
|
||||||
{
|
|
||||||
clickPreview = new AutomationRunner();
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
foreach (string clickName in clickThings)
|
|
||||||
{
|
|
||||||
clickPreview.ClickByName(clickName);
|
|
||||||
Thread.Sleep((int)(secondsBetweenClicks * 1000));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
container.BeforeDraw -= beforeDraw;
|
|
||||||
};
|
|
||||||
|
|
||||||
container.BeforeDraw += beforeDraw;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void CreateButtonOpensPluginWindow(GuiWidget container, double secondsBetweenClicks = .1)
|
|
||||||
{
|
|
||||||
//To run test invoke method in the queue data widget
|
|
||||||
AutomationRunner testRunner;
|
|
||||||
EventHandler<DrawEventArgs> beforeDraw = null;
|
|
||||||
beforeDraw = (sender, e) =>
|
|
||||||
{
|
|
||||||
testRunner = new AutomationRunner();
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
testRunner.ClickByName("Queue Tab");
|
|
||||||
testRunner.ClickByName("Design Tool Button");
|
|
||||||
});
|
|
||||||
container.BeforeDraw -= beforeDraw;
|
|
||||||
};
|
|
||||||
container.BeforeDraw += beforeDraw;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void AddLocalLibraryItemToQueue(GuiWidget container, double secondsBetweenClicks = .1)
|
|
||||||
{
|
|
||||||
AutomationRunner testRunner;
|
|
||||||
EventHandler<DrawEventArgs> beforeDraw = null;
|
|
||||||
beforeDraw = (sender, e) =>
|
|
||||||
{
|
|
||||||
testRunner = new AutomationRunner();
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
testRunner.NavigateToFolder("Local Library Row Item Collection");
|
|
||||||
|
|
||||||
testRunner.ClickByName("Library Edit Button");
|
|
||||||
testRunner.ClickByName("Row Item Calibration - Box");
|
|
||||||
testRunner.Delay(2);
|
|
||||||
MatterControlUtilities.LibraryAddSelectionToQueue(testRunner);
|
|
||||||
testRunner.ClickByName("Queue Tab");
|
|
||||||
});
|
|
||||||
container.BeforeDraw -= beforeDraw;
|
|
||||||
};
|
|
||||||
container.BeforeDraw += beforeDraw;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void RenameLibraryItem(GuiWidget container, double secondsBetweenClicks = .1)
|
|
||||||
{
|
|
||||||
AutomationRunner testRunner;
|
|
||||||
EventHandler<DrawEventArgs> beforeDraw = null;
|
|
||||||
beforeDraw = (sender, e) =>
|
|
||||||
{
|
|
||||||
testRunner = new AutomationRunner();
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
testRunner.NavigateToFolder("Local Library Row Item Collection");
|
|
||||||
|
|
||||||
testRunner.ClickByName("Library Edit Button");
|
|
||||||
testRunner.ClickByName("Row Item Calibration - Box");
|
|
||||||
testRunner.Delay(.5);
|
|
||||||
|
|
||||||
testRunner.LibraryRenameSelectedItem();
|
|
||||||
|
|
||||||
testRunner.Delay(.5);
|
|
||||||
testRunner.Type("Renamed Calibration Cube");
|
|
||||||
testRunner.ClickByName("Rename Button");
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
container.BeforeDraw -= beforeDraw;
|
|
||||||
};
|
|
||||||
container.BeforeDraw += beforeDraw;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void CreateAndRenameLocalLibraryFolder(GuiWidget container, double secondsBetweenClicks = .1)
|
|
||||||
{
|
|
||||||
AutomationRunner testRunner;
|
|
||||||
EventHandler<DrawEventArgs> beforeDraw = null;
|
|
||||||
beforeDraw = (sender, e) =>
|
|
||||||
{
|
|
||||||
testRunner = new AutomationRunner();
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
testRunner.NavigateToFolder("Local Library Row Item Collection");
|
|
||||||
testRunner.ClickByName("Create Folder From Library Button");
|
|
||||||
testRunner.Delay(2);
|
|
||||||
testRunner.Type("New Folder");
|
|
||||||
testRunner.ClickByName("InputBoxPage Action Button");
|
|
||||||
testRunner.ClickByName("Library Edit Button");
|
|
||||||
testRunner.ClickByName("Row Item New Folder");
|
|
||||||
|
|
||||||
testRunner.LibraryRenameSelectedItem();
|
|
||||||
|
|
||||||
testRunner.Delay(.5);
|
|
||||||
testRunner.Type("Renamed Folder");
|
|
||||||
testRunner.ClickByName("Rename Button");
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
container.BeforeDraw -= beforeDraw;
|
|
||||||
};
|
|
||||||
container.BeforeDraw += beforeDraw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue