Merge branch 'development' of https://github.com/MatterHackers/MatterControl into development
Conflicts: StaticData/Translations/Master.txt
This commit is contained in:
commit
0aa7429761
24 changed files with 589 additions and 126 deletions
|
|
@ -46,13 +46,13 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
protected override void AddChildElements()
|
||||
{
|
||||
actionBarButtonFactory.invertImageLocation = false;
|
||||
string connectString = "CONNECT".Localize();
|
||||
string connectString = "Connect".Localize().ToUpper();
|
||||
connectPrinterButton = actionBarButtonFactory.Generate(connectString, "icon_power_32x32.png");
|
||||
connectPrinterButton.Margin = new BorderDouble(0, 0, 3);
|
||||
connectPrinterButton.VAnchor = VAnchor.ParentCenter;
|
||||
connectPrinterButton.Cursor = Cursors.Hand;
|
||||
|
||||
string disconnectString = "DISCONNECT".Localize();
|
||||
string disconnectString = "Disconnect".Localize().ToUpper();
|
||||
disconnectPrinterButton = actionBarButtonFactory.Generate(disconnectString, "icon_power_32x32.png");
|
||||
disconnectPrinterButton.Margin = new BorderDouble(0, 0, 3);
|
||||
disconnectPrinterButton.VAnchor = VAnchor.ParentCenter;
|
||||
|
|
@ -88,7 +88,7 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
|
||||
FlowLayoutWidget leftToRight = new FlowLayoutWidget();
|
||||
leftToRight.Margin = new BorderDouble(5, 0);
|
||||
string optionsString = LocalizedString.Get("OPTIONS");
|
||||
string optionsString = "Options".Localize().ToUpper();
|
||||
TextWidget optionsText = new TextWidget(optionsString, textColor: ActiveTheme.Instance.PrimaryTextColor);
|
||||
optionsText.VAnchor = Agg.UI.VAnchor.ParentCenter;
|
||||
optionsText.Margin = new BorderDouble(0, 0, 3, 0);
|
||||
|
|
@ -139,7 +139,7 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
{
|
||||
if (ActivePrinterProfile.Instance.ActivePrinter == null)
|
||||
{
|
||||
OpenConnectionWindow();
|
||||
OpenConnectionWindow(ConnectToActivePrinter);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -159,12 +159,15 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
OpenConnectionWindow();
|
||||
}
|
||||
|
||||
void OpenConnectionWindow()
|
||||
public delegate void ConnectOnSelectFunction();
|
||||
ConnectOnSelectFunction functionToCallOnSelect;
|
||||
void OpenConnectionWindow(ConnectOnSelectFunction functionToCallOnSelect = null)
|
||||
{
|
||||
if (this.connectionWindowIsOpen == false)
|
||||
{
|
||||
connectionWindow = new ConnectionWindow();
|
||||
this.connectionWindowIsOpen = true;
|
||||
this.functionToCallOnSelect = functionToCallOnSelect;
|
||||
connectionWindow.Closed += new EventHandler(ConnectionWindow_Closed);
|
||||
}
|
||||
else
|
||||
|
|
@ -188,7 +191,12 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
|
||||
void onActivePrinterChanged(object sender, EventArgs e)
|
||||
{
|
||||
connectPrinterButton.Enabled = true;
|
||||
connectPrinterButton.Enabled = true;
|
||||
if (functionToCallOnSelect != null)
|
||||
{
|
||||
functionToCallOnSelect();
|
||||
functionToCallOnSelect = null;
|
||||
}
|
||||
}
|
||||
|
||||
void onDisconnectButtonClick(object sender, MouseEventArgs e)
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ using MatterHackers.MatterControl.PrintQueue;
|
|||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.MatterControl.PrintLibrary;
|
||||
using MatterHackers.MatterControl.DataStorage;
|
||||
using MatterHackers.MatterControl.CustomWidgets;
|
||||
using MatterHackers.Localizations;
|
||||
using MatterHackers.MatterControl.PartPreviewWindow;
|
||||
|
||||
|
|
@ -95,8 +96,8 @@ namespace MatterHackers.MatterControl
|
|||
//ColumnTwo.Padding = new BorderDouble(4, 0);
|
||||
//ColumnThree.Padding = new BorderDouble(4);
|
||||
|
||||
LeftBorderLine = CreateBorderLine();
|
||||
RightBorderLine = CreateBorderLine();
|
||||
LeftBorderLine = new PanelSeparator();
|
||||
RightBorderLine = new PanelSeparator();
|
||||
|
||||
LoadColumnTwo();
|
||||
|
||||
|
|
@ -117,16 +118,6 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
}
|
||||
|
||||
private static ClickWidget CreateBorderLine()
|
||||
{
|
||||
ClickWidget topLine = new ClickWidget(3, 1);
|
||||
topLine.BackgroundColor = new RGBA_Bytes(200,200,200);
|
||||
topLine.VAnchor = VAnchor.ParentBottomTop;
|
||||
topLine.Margin = new BorderDouble(8, 0);
|
||||
topLine.Cursor = Cursors.Hand;
|
||||
return topLine;
|
||||
}
|
||||
|
||||
void onBoundsChanges(Object sender, EventArgs e)
|
||||
{
|
||||
SetVisibleStatus();
|
||||
|
|
|
|||
|
|
@ -117,15 +117,11 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
|
||||
Button restartButton;
|
||||
Dictionary<string, string> languageDict;
|
||||
|
||||
private void AddLanguageControls(FlowLayoutWidget controlsTopToBottomLayout)
|
||||
{
|
||||
CreateLanguageDict();
|
||||
|
||||
DisableableWidget container = new DisableableWidget();
|
||||
|
||||
|
||||
GroupBox languageControlsGroupBox = new GroupBox(LocalizedString.Get("Language Settings"));
|
||||
languageControlsGroupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
languageControlsGroupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
|
|
@ -137,22 +133,7 @@ namespace MatterHackers.MatterControl
|
|||
FlowLayoutWidget controlsContainer = new FlowLayoutWidget();
|
||||
controlsContainer.HAnchor = HAnchor.ParentLeftRight;
|
||||
|
||||
string languageCode = UserSettings.Instance.get("Language");
|
||||
string languageVerbose = "Default";
|
||||
|
||||
foreach(KeyValuePair<string, string> entry in languageDict)
|
||||
{
|
||||
if (languageCode == entry.Value)
|
||||
{
|
||||
languageVerbose = entry.Key;
|
||||
}
|
||||
}
|
||||
|
||||
LanguageSelector languageSelector = new LanguageSelector(languageVerbose);
|
||||
foreach (KeyValuePair<string, string> entry in languageDict)
|
||||
{
|
||||
languageSelector.AddItem(entry.Key,entry.Value);
|
||||
}
|
||||
LanguageSelector languageSelector = new LanguageSelector();
|
||||
|
||||
languageSelector.Margin = new BorderDouble(0);
|
||||
languageSelector.SelectionChanged += new EventHandler(LanguageDropList_SelectionChanged);
|
||||
|
|
@ -182,22 +163,17 @@ namespace MatterHackers.MatterControl
|
|||
UiThread.RunOnIdle((state) =>
|
||||
{
|
||||
//horrible hack - to be replaced
|
||||
MatterControlApplication app = (MatterControlApplication)this.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent;
|
||||
GuiWidget parent = this;
|
||||
while (parent as MatterControlApplication == null)
|
||||
{
|
||||
parent = parent.Parent;
|
||||
}
|
||||
MatterControlApplication app = parent as MatterControlApplication;
|
||||
app.RestartOnClose = true;
|
||||
app.Close();
|
||||
});
|
||||
}
|
||||
|
||||
private void CreateLanguageDict()
|
||||
{
|
||||
languageDict = new Dictionary<string, string>();
|
||||
languageDict["Default"] = "EN";
|
||||
languageDict["English"] = "EN";
|
||||
languageDict["Español"] = "ES";
|
||||
languageDict["Français"] = "FR";
|
||||
languageDict["Deutsch"] = "DE";
|
||||
}
|
||||
|
||||
private void LanguageDropList_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
string languageCode = ((DropDownList)sender).SelectedLabel;
|
||||
|
|
@ -231,7 +207,7 @@ namespace MatterHackers.MatterControl
|
|||
ImageWidget eePromIcon = new ImageWidget(eePromImage);
|
||||
eePromIcon.Margin = new BorderDouble (right: 6);
|
||||
|
||||
Button openEePromWindow = textImageButtonFactory.Generate(LocalizedString.Get("CONFIGURE"));
|
||||
Button openEePromWindow = textImageButtonFactory.Generate("Configure".Localize().ToUpper());
|
||||
openEePromWindow.Click += (sender, e) =>
|
||||
{
|
||||
#if false // This is to force the creation of the repetier window for testing when we don't have repetier firmware.
|
||||
|
|
@ -335,7 +311,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
this.textImageButtonFactory.FixedHeight = TallButtonHeight;
|
||||
|
||||
Button runPrintLevelingButton = textImageButtonFactory.Generate(LocalizedString.Get("CONFIGURE"));
|
||||
Button runPrintLevelingButton = textImageButtonFactory.Generate("Configure".Localize().ToUpper());
|
||||
runPrintLevelingButton.Margin = new BorderDouble(left:6);
|
||||
runPrintLevelingButton.VAnchor = VAnchor.ParentCenter;
|
||||
runPrintLevelingButton.Click += new ButtonBase.ButtonEventHandler(runPrintLeveling_Click);
|
||||
|
|
@ -350,12 +326,12 @@ namespace MatterHackers.MatterControl
|
|||
ImageWidget levelingIcon = new ImageWidget(levelingImage);
|
||||
levelingIcon.Margin = new BorderDouble (right: 6);
|
||||
|
||||
enablePrintLevelingButton = textImageButtonFactory.Generate(LocalizedString.Get("ENABLE"));
|
||||
enablePrintLevelingButton = textImageButtonFactory.Generate("Enable".Localize().ToUpper());
|
||||
enablePrintLevelingButton.Margin = new BorderDouble(left:6);
|
||||
enablePrintLevelingButton.VAnchor = VAnchor.ParentCenter;
|
||||
enablePrintLevelingButton.Click += new ButtonBase.ButtonEventHandler(enablePrintLeveling_Click);
|
||||
|
||||
disablePrintLevelingButton = textImageButtonFactory.Generate(LocalizedString.Get("DISABLE"));
|
||||
disablePrintLevelingButton = textImageButtonFactory.Generate("Disable".Localize().ToUpper());
|
||||
disablePrintLevelingButton.Margin = new BorderDouble(left:6);
|
||||
disablePrintLevelingButton.VAnchor = VAnchor.ParentCenter;
|
||||
disablePrintLevelingButton.Click += new ButtonBase.ButtonEventHandler(disablePrintLeveling_Click);
|
||||
|
|
|
|||
|
|
@ -10,17 +10,15 @@ using MatterHackers.VectorMath;
|
|||
using MatterHackers.MatterControl.DataStorage;
|
||||
using MatterHackers.Localizations;
|
||||
|
||||
|
||||
namespace MatterHackers.MatterControl
|
||||
{
|
||||
public class LanguageSelector : StyledDropDownList
|
||||
{
|
||||
{
|
||||
Dictionary<string, string> languageDict;
|
||||
|
||||
public LanguageSelector(string selection)
|
||||
: base(selection)
|
||||
public LanguageSelector()
|
||||
: base("Default")
|
||||
{
|
||||
|
||||
|
||||
//string pathToModels = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "PrinterSettings", manufacturer);
|
||||
//if (Directory.Exists(pathToModels))
|
||||
//{
|
||||
|
|
@ -32,7 +30,34 @@ namespace MatterHackers.MatterControl
|
|||
//}
|
||||
|
||||
this.MinimumSize = new Vector2(this.LocalBounds.Width, this.LocalBounds.Height);
|
||||
|
||||
CreateLanguageDict();
|
||||
|
||||
string languageCode = UserSettings.Instance.get("Language");
|
||||
|
||||
foreach (KeyValuePair<string, string> entry in languageDict)
|
||||
{
|
||||
AddItem(entry.Key, entry.Value);
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<string, string> entry in languageDict)
|
||||
{
|
||||
if (languageCode == entry.Value)
|
||||
{
|
||||
SelectedLabel = entry.Key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateLanguageDict()
|
||||
{
|
||||
languageDict = new Dictionary<string, string>();
|
||||
languageDict["Default"] = "EN";
|
||||
languageDict["English"] = "EN";
|
||||
languageDict["Español"] = "ES";
|
||||
languageDict["Français"] = "FR";
|
||||
languageDict["Deutsch"] = "DE";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
54
CustomWidgets/PanelSeparator.cs
Normal file
54
CustomWidgets/PanelSeparator.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Transform;
|
||||
using MatterHackers.Agg.Image;
|
||||
using MatterHackers.Agg.VertexSource;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.Agg.Font;
|
||||
using MatterHackers.VectorMath;
|
||||
|
||||
namespace MatterHackers.MatterControl.CustomWidgets
|
||||
{
|
||||
class PanelSeparator : ClickWidget
|
||||
{
|
||||
RGBA_Bytes defaultBackgroundColor;
|
||||
RGBA_Bytes hoverBackgroundColor;
|
||||
|
||||
public bool Hidden { get; set; }
|
||||
|
||||
public PanelSeparator()
|
||||
: base(4, 1)
|
||||
{
|
||||
AddHandlers();
|
||||
|
||||
defaultBackgroundColor = new RGBA_Bytes(200, 200, 200);
|
||||
hoverBackgroundColor = new RGBA_Bytes(100, 100, 100);
|
||||
|
||||
this.Hidden = false;
|
||||
this.BackgroundColor = defaultBackgroundColor;
|
||||
this.VAnchor = VAnchor.ParentBottomTop;
|
||||
this.Margin = new BorderDouble(8, 0);
|
||||
this.Cursor = Cursors.Hand;
|
||||
}
|
||||
|
||||
void AddHandlers()
|
||||
{
|
||||
this.MouseEnterBounds += new EventHandler(PanelSeparator_MouseEnterBounds);
|
||||
this.MouseLeaveBounds += new EventHandler(PanelSeparator_MouseLeaveBounds);
|
||||
}
|
||||
|
||||
void PanelSeparator_MouseLeaveBounds(object sender, EventArgs e)
|
||||
{
|
||||
this.BackgroundColor = defaultBackgroundColor;
|
||||
}
|
||||
|
||||
void PanelSeparator_MouseEnterBounds(object sender, EventArgs e)
|
||||
{
|
||||
this.BackgroundColor = hoverBackgroundColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -164,6 +164,7 @@ namespace MatterHackers.MatterControl.DataStorage
|
|||
{
|
||||
public string Name { get; set; }
|
||||
public string Tag { get; set; } //ex. 'material' or 'quality'
|
||||
public int PrinterId { get; set; }
|
||||
}
|
||||
|
||||
public class SliceSetting : Entity
|
||||
|
|
|
|||
38
Launcher/Launcher.cs
Normal file
38
Launcher/Launcher.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace MatterHackers.MatterControl.Launcher
|
||||
{
|
||||
public class LauncherApp
|
||||
{
|
||||
public LauncherApp()
|
||||
{
|
||||
}
|
||||
|
||||
[STAThread]
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
if (args.Length == 2 && File.Exists(args[0]))
|
||||
{
|
||||
ProcessStartInfo runAppLauncherStartInfo = new ProcessStartInfo();
|
||||
runAppLauncherStartInfo.FileName = args[0];
|
||||
|
||||
int timeToWait = 0;
|
||||
int.TryParse(args[1], out timeToWait);
|
||||
|
||||
Stopwatch waitTime = new Stopwatch();
|
||||
waitTime.Start();
|
||||
while (waitTime.ElapsedMilliseconds < timeToWait)
|
||||
{
|
||||
}
|
||||
|
||||
Process.Start(runAppLauncherStartInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
50
Launcher/Launcher.csproj
Normal file
50
Launcher/Launcher.csproj
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputType>Exe</OutputType>
|
||||
<ProjectGuid>{3DF4CB3D-9A03-4256-9A81-70523AAD828B}</ProjectGuid>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MatterHackers.MatterControl.Launcher</RootNamespace>
|
||||
<AssemblyName>Launcher</AssemblyName>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<ReleaseVersion>0.8.2</ReleaseVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Launcher.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
|
|
@ -75,6 +75,7 @@
|
|||
<Compile Include="ApplicationView\QueueTabs.cs" />
|
||||
<Compile Include="ConfigurationPage\LanguageSelector.cs" />
|
||||
<Compile Include="CustomWidgets\FlowSpacers.cs" />
|
||||
<Compile Include="CustomWidgets\PanelSeparator.cs" />
|
||||
<Compile Include="DataStorage\Models.cs" />
|
||||
<Compile Include="LocalizedString.cs" />
|
||||
<Compile Include="PartPreviewWindow\BaseClasses\PartPreview3DWidget.cs" />
|
||||
|
|
@ -316,6 +317,10 @@
|
|||
<Project>{AE37DE1F-22F7-49EE-8732-FC6BC8DC58D9}</Project>
|
||||
<Name>Tesselate</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Launcher\Launcher.csproj">
|
||||
<Project>{3DF4CB3D-9A03-4256-9A81-70523AAD828B}</Project>
|
||||
<Name>Launcher</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="PrinterDriverInstaller\InfInstaller.csproj">
|
||||
<Project>{990A9AD3-B6A4-407B-9DFC-9C722AF7C9B9}</Project>
|
||||
<Name>InfInstaller</Name>
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OutlineCreator", "..\Matter
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MatterSlice", "..\MatterSlice\MatterSlice.csproj", "{C46CA728-DD2F-4DD1-971A-AAA89D9DFF95}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Launcher", "Launcher\Launcher.csproj", "{3DF4CB3D-9A03-4256-9A81-70523AAD828B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -224,6 +226,12 @@ Global
|
|||
{C46CA728-DD2F-4DD1-971A-AAA89D9DFF95}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C46CA728-DD2F-4DD1-971A-AAA89D9DFF95}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C46CA728-DD2F-4DD1-971A-AAA89D9DFF95}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{3DF4CB3D-9A03-4256-9A81-70523AAD828B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3DF4CB3D-9A03-4256-9A81-70523AAD828B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3DF4CB3D-9A03-4256-9A81-70523AAD828B}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{3DF4CB3D-9A03-4256-9A81-70523AAD828B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3DF4CB3D-9A03-4256-9A81-70523AAD828B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3DF4CB3D-9A03-4256-9A81-70523AAD828B}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
|||
|
|
@ -274,6 +274,13 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
if (firstDraw)
|
||||
{
|
||||
string desktopPosition = ApplicationSettings.Instance.get("DesktopPosition");
|
||||
if (desktopPosition != null && desktopPosition != "")
|
||||
{
|
||||
string[] sizes = desktopPosition.Split(',');
|
||||
DesktopPosition = new Point2D(int.Parse(sizes[0]), int.Parse(sizes[1]));
|
||||
}
|
||||
|
||||
firstDraw = false;
|
||||
foreach (string arg in commandLineArgs)
|
||||
{
|
||||
|
|
@ -317,11 +324,25 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
// save the last size of the window so we can restore it next time.
|
||||
ApplicationSettings.Instance.set("WindowSize", string.Format("{0},{1}", Width, Height));
|
||||
ApplicationSettings.Instance.set("DesktopPosition", string.Format("{0},{1}", DesktopPosition.x, DesktopPosition.y));
|
||||
PrinterCommunication.Instance.Disable();
|
||||
//Close connection to the local datastore
|
||||
Datastore.Instance.Exit();
|
||||
PrinterCommunication.Instance.HaltConnectionThread();
|
||||
SlicingQueue.Instance.ShutDownSlicingThread();
|
||||
if (RestartOnClose)
|
||||
{
|
||||
string appPathAndFile = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
||||
string pathToAppFolder = Path.GetDirectoryName(appPathAndFile);
|
||||
|
||||
ProcessStartInfo runAppLauncherStartInfo = new ProcessStartInfo();
|
||||
runAppLauncherStartInfo.Arguments = "\"{0}\" \"{1}\"".FormatWith(appPathAndFile, 1000);
|
||||
runAppLauncherStartInfo.FileName = Path.Combine(pathToAppFolder, "Launcher.exe");
|
||||
runAppLauncherStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
runAppLauncherStartInfo.CreateNoWindow = true;
|
||||
|
||||
Process.Start(runAppLauncherStartInfo);
|
||||
}
|
||||
base.OnClosed(e);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,9 +130,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
gcodeDispalyWidget = new GuiWidget(HAnchor.ParentLeftRight, Agg.UI.VAnchor.ParentBottomTop);
|
||||
|
||||
string startingMessage = LocalizedString.Get("No GCode Available...");
|
||||
string startingMessage = "";
|
||||
if (printItem != null)
|
||||
{
|
||||
startingMessage = LocalizedString.Get("No GCode Available...");
|
||||
startingMessage = LocalizedString.Get("Loading GCode...");
|
||||
if (Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE")
|
||||
{
|
||||
|
|
@ -205,7 +206,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
BorderDouble buttonMargin = new BorderDouble(top: 3);
|
||||
|
||||
string label = LocalizedString.Get("MODEL");
|
||||
string label = "MODEL".Localize().ToUpper();
|
||||
expandModelOptions = expandMenuOptionFactory.GenerateCheckBoxButton(label, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
|
||||
expandModelOptions.Margin = new BorderDouble(bottom: 2);
|
||||
buttonRightPanel.AddChild(expandModelOptions);
|
||||
|
|
@ -216,7 +217,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
//modelOptionsContainer.Visible = false;
|
||||
buttonRightPanel.AddChild(modelOptionsContainer);
|
||||
|
||||
expandLayerOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("LAYER"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
|
||||
expandLayerOptions = expandMenuOptionFactory.GenerateCheckBoxButton("Layer".Localize().ToUpper(), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
|
||||
expandLayerOptions.Margin = new BorderDouble(bottom: 2);
|
||||
//buttonRightPanel.AddChild(expandLayerOptions);
|
||||
|
||||
|
|
@ -225,7 +226,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
layerOptionsContainer.Visible = false;
|
||||
buttonRightPanel.AddChild(layerOptionsContainer);
|
||||
|
||||
expandDisplayOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("DISPLAY"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
|
||||
expandDisplayOptions = expandMenuOptionFactory.GenerateCheckBoxButton("Display".Localize().ToUpper(), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
|
||||
expandDisplayOptions.Margin = new BorderDouble(bottom: 2);
|
||||
buttonRightPanel.AddChild(expandDisplayOptions);
|
||||
expandDisplayOptions.Checked = true;
|
||||
|
|
@ -263,10 +264,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
modelInfoContainer.HAnchor = HAnchor.ParentLeftRight;
|
||||
modelInfoContainer.Padding = new BorderDouble(5);
|
||||
|
||||
string printTimeLbl = LocalizedString.Get ("PRINT TIME");
|
||||
string printTimeLblFull = string.Format ("{0}:", printTimeLbl);
|
||||
string printTimeLabel = "Print Time".Localize().ToUpper();
|
||||
string printTimeLabelFull = string.Format ("{0}:", printTimeLabel);
|
||||
// put in the print time
|
||||
modelInfoContainer.AddChild(new TextWidget(printTimeLblFull, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize:10));
|
||||
modelInfoContainer.AddChild(new TextWidget(printTimeLabelFull, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize:10));
|
||||
{
|
||||
string timeRemainingText = "---";
|
||||
|
||||
|
|
@ -294,7 +295,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
//modelInfoContainer.AddChild(new TextWidget("Size:", textColor: ActiveTheme.Instance.PrimaryTextColor));
|
||||
|
||||
string filamentLengthLbl = LocalizedString.Get ("FILAMENT LENGTH");
|
||||
string filamentLengthLbl = "Filament Length".Localize().ToUpper();
|
||||
string filamentLengthLblFull = string.Format ("{0}:", filamentLengthLbl);
|
||||
// show the filament used
|
||||
modelInfoContainer.AddChild(new TextWidget(filamentLengthLblFull, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 9));
|
||||
|
|
@ -307,9 +308,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
modelInfoContainer.AddChild(estimatedPrintTime);
|
||||
}
|
||||
|
||||
string filamentVolumeLbl = LocalizedString.Get ("FILAMENT VOLUME");
|
||||
string filamentVolumeLblFull = string.Format("{0}:", filamentVolumeLbl);
|
||||
modelInfoContainer.AddChild(new TextWidget(filamentVolumeLblFull, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 9));
|
||||
string filamentVolumeLabel = "Filament Volume".Localize().ToUpper();
|
||||
string filamentVolumeLabelFull = string.Format("{0}:", filamentVolumeLabel);
|
||||
modelInfoContainer.AddChild(new TextWidget(filamentVolumeLabelFull, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 9));
|
||||
{
|
||||
double filamentMm3 = gcodeViewWidget.LoadedGCode.GetFilamentCubicMm(ActiveSliceSettings.Instance.FilamentDiameter);
|
||||
|
||||
|
|
@ -319,9 +320,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
modelInfoContainer.AddChild(estimatedPrintTime);
|
||||
}
|
||||
|
||||
string weightLbl = LocalizedString.Get("EST. WEIGHT");
|
||||
string weightLblFull = string.Format("{0}:", weightLbl);
|
||||
modelInfoContainer.AddChild(new TextWidget(weightLblFull, pointSize: 9, textColor: ActiveTheme.Instance.PrimaryTextColor));
|
||||
string weightLabel = "Est. Weight".Localize().ToUpper();
|
||||
string weightLabelFull = string.Format("{0}:", weightLabel);
|
||||
modelInfoContainer.AddChild(new TextWidget(weightLabelFull, pointSize: 9, textColor: ActiveTheme.Instance.PrimaryTextColor));
|
||||
{
|
||||
var density = 1.0;
|
||||
string filamentType = "PLA";
|
||||
|
|
|
|||
|
|
@ -119,18 +119,20 @@ namespace MatterHackers.MatterControl.PrintHistory
|
|||
buttonContainer.Margin = new BorderDouble(0);
|
||||
buttonContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
|
||||
{
|
||||
TextWidget statusIndicator = new TextWidget("Status: Completed", pointSize:8);
|
||||
TextWidget statusIndicator = new TextWidget("Status: Completed".Localize(), pointSize:8);
|
||||
statusIndicator.Margin = new BorderDouble(right: 3);
|
||||
//buttonContainer.AddChild(statusIndicator);
|
||||
|
||||
TextWidget timeLabel = new TextWidget("PRINT TIME: ", pointSize:8);
|
||||
string printTimeLabel = "Print Time".Localize().ToUpper();
|
||||
string printTimeLabelFull = string.Format("{0}: ", printTimeLabel);
|
||||
TextWidget timeLabel = new TextWidget(printTimeLabelFull, pointSize: 8);
|
||||
timeLabel.TextColor = timeTextColor;
|
||||
|
||||
TextWidget timeIndicator;
|
||||
int minutes = printTask.PrintTimeMinutes;
|
||||
if (minutes < 0)
|
||||
{
|
||||
timeIndicator = new TextWidget("Unknown");
|
||||
timeIndicator = new TextWidget("Unknown".Localize());
|
||||
}
|
||||
else if (minutes > 60)
|
||||
{
|
||||
|
|
@ -147,7 +149,7 @@ namespace MatterHackers.MatterControl.PrintHistory
|
|||
buttonContainer.AddChild(timeLabel);
|
||||
buttonContainer.AddChild(timeIndicator);
|
||||
|
||||
printAgainLink = linkButtonFactory.Generate(LocalizedString.Get("Print Again"));
|
||||
printAgainLink = linkButtonFactory.Generate("Print Again".Localize());
|
||||
printAgainLink.Margin = new BorderDouble(left: 0, right: 10);
|
||||
printAgainLink.VAnchor = VAnchor.ParentCenter;
|
||||
|
||||
|
|
@ -176,7 +178,8 @@ namespace MatterHackers.MatterControl.PrintHistory
|
|||
startTimeContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
|
||||
startTimeContainer.Padding = new BorderDouble(0, 3);
|
||||
|
||||
TextWidget startLabel = new TextWidget("START:", pointSize: 8);
|
||||
string startLabelFull = "{0}:".FormatWith("Start".Localize().ToUpper());
|
||||
TextWidget startLabel = new TextWidget(startLabelFull, pointSize: 8);
|
||||
startLabel.TextColor = timeTextColor;
|
||||
|
||||
string startTimeString = printTask.PrintStart.ToString("MMM d yyyy h:mm ") + printTask.PrintStart.ToString("tt").ToLower();
|
||||
|
|
@ -192,7 +195,8 @@ namespace MatterHackers.MatterControl.PrintHistory
|
|||
endTimeContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
|
||||
endTimeContainer.Padding = new BorderDouble(0, 3);
|
||||
|
||||
TextWidget endLabel = new TextWidget("END:", pointSize: 8);
|
||||
string endLabelFull = "{0}:".FormatWith("End".Localize().ToUpper());
|
||||
TextWidget endLabel = new TextWidget(endLabelFull, pointSize: 8);
|
||||
endLabel.TextColor = timeTextColor;
|
||||
|
||||
string endTimeString;
|
||||
|
|
@ -202,7 +206,7 @@ namespace MatterHackers.MatterControl.PrintHistory
|
|||
}
|
||||
else
|
||||
{
|
||||
endTimeString = "Unknown";
|
||||
endTimeString = "Unknown".Localize();
|
||||
}
|
||||
|
||||
TextWidget endDate = new TextWidget(endTimeString, pointSize: 12);
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ namespace MatterHackers.MatterControl
|
|||
ImageWidget eePromIcon = new ImageWidget(eePromImage);
|
||||
eePromIcon.Margin = new BorderDouble (right: 6);
|
||||
|
||||
Button openEePromWindow = textImageButtonFactory.Generate(LocalizedString.Get("CONFIGURE"));
|
||||
Button openEePromWindow = textImageButtonFactory.Generate("Configure".Localize().ToUpper());
|
||||
openEePromWindow.Click += (sender, e) =>
|
||||
{
|
||||
#if false // This is to force the creation of the repetier window for testing when we don't have repetier firmware.
|
||||
|
|
@ -547,7 +547,7 @@ namespace MatterHackers.MatterControl
|
|||
ImageWidget terminalIcon = new ImageWidget(terminalImage);
|
||||
terminalIcon.Margin = new BorderDouble (right: 6);
|
||||
|
||||
Button showTerminal = textImageButtonFactory.Generate(LocalizedString.Get("SHOW TERMINAL"));
|
||||
Button showTerminal = textImageButtonFactory.Generate("Show Terminal".Localize().ToUpper());
|
||||
showTerminal.Margin = new BorderDouble(0);
|
||||
showTerminal.Click += (sender, e) =>
|
||||
{
|
||||
|
|
@ -565,14 +565,14 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
private GuiWidget CreateSdCardManagerContainer()
|
||||
{
|
||||
GroupBox terminalControlsContainer;
|
||||
terminalControlsContainer = new GroupBox("SD Card Printing");
|
||||
GroupBox sdCardControlsContainer;
|
||||
sdCardControlsContainer = new GroupBox("SD Card Printing");
|
||||
|
||||
terminalControlsContainer.Margin = new BorderDouble(top: 10);
|
||||
terminalControlsContainer.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
terminalControlsContainer.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
terminalControlsContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
|
||||
terminalControlsContainer.Height = 68;
|
||||
sdCardControlsContainer.Margin = new BorderDouble(top: 10);
|
||||
sdCardControlsContainer.TextColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
sdCardControlsContainer.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
|
||||
sdCardControlsContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
|
||||
sdCardControlsContainer.Height = 68;
|
||||
|
||||
{
|
||||
FlowLayoutWidget buttonBar = new FlowLayoutWidget();
|
||||
|
|
@ -583,7 +583,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
this.textImageButtonFactory.FixedHeight = TallButtonHeight;
|
||||
|
||||
Button showSDPrintingPannel = textImageButtonFactory.Generate("SD CARD MANAGER");
|
||||
Button showSDPrintingPannel = textImageButtonFactory.Generate("SD Card Manager".ToUpper());
|
||||
showSDPrintingPannel.Margin = new BorderDouble(left: 10);
|
||||
showSDPrintingPannel.Click += (sender, e) =>
|
||||
{
|
||||
|
|
@ -591,10 +591,10 @@ namespace MatterHackers.MatterControl
|
|||
};
|
||||
buttonBar.AddChild(showSDPrintingPannel);
|
||||
|
||||
terminalControlsContainer.AddChild(buttonBar);
|
||||
sdCardControlsContainer.AddChild(buttonBar);
|
||||
}
|
||||
|
||||
return terminalControlsContainer;
|
||||
return sdCardControlsContainer;
|
||||
}
|
||||
|
||||
private void SetDisplayAttributes()
|
||||
|
|
@ -623,7 +623,7 @@ namespace MatterHackers.MatterControl
|
|||
movementControlsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
|
||||
fanControlsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
|
||||
tuningAdjustmentControlsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
|
||||
terminalCommunicationsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
|
||||
terminalCommunicationsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
|
||||
sdCardManagerContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
|
||||
macroControls.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
|
||||
}
|
||||
|
|
@ -738,7 +738,7 @@ namespace MatterHackers.MatterControl
|
|||
GuiWidget spacer = new GuiWidget();
|
||||
spacer.HAnchor = HAnchor.ParentLeftRight;
|
||||
|
||||
disableMotors = textImageButtonFactory.Generate(LocalizedString.Get("UNLOCK"));
|
||||
disableMotors = textImageButtonFactory.Generate("Unlock".Localize().ToUpper());
|
||||
disableMotors.Margin = new BorderDouble(0);
|
||||
disableMotors.Click += new ButtonBase.ButtonEventHandler(disableMotors_Click);
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
public class ActiveSliceSettings
|
||||
{
|
||||
static ActiveSliceSettings globalInstance = null;
|
||||
static string configFileExtension = "ini";
|
||||
static string configFileExtension = "slice";
|
||||
private List<SettingsLayer> activeSettingsLayers;
|
||||
public RootedObjectEventHandler CommitStatusChanged = new RootedObjectEventHandler();
|
||||
public RootedObjectEventHandler SettingsChanged = new RootedObjectEventHandler();
|
||||
|
|
@ -480,7 +480,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
public bool LoadSettingsFromIni()
|
||||
{
|
||||
OpenFileDialogParams openParams = new OpenFileDialogParams("Load Slice Configuration|*." + configFileExtension);
|
||||
OpenFileDialogParams openParams = new OpenFileDialogParams("Load Slice Configuration|*.slice;*.ini");
|
||||
openParams.ActionButtonLabel = "Load Configuration";
|
||||
openParams.Title = "MatterControl: Select A File";
|
||||
|
||||
|
|
|
|||
|
|
@ -128,8 +128,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
IEnumerable<DataStorage.SliceSettingsCollection> results = Enumerable.Empty<DataStorage.SliceSettingsCollection>();
|
||||
|
||||
//Retrieve a list of collections matching from the Datastore
|
||||
string query = string.Format("SELECT * FROM SliceSettingsCollection WHERE Tag = '{0}';", filterTag);
|
||||
results = (IEnumerable<DataStorage.SliceSettingsCollection>)DataStorage.Datastore.Instance.dbSQLite.Query<DataStorage.SliceSettingsCollection>(query);
|
||||
if (ActivePrinterProfile.Instance.ActivePrinter != null)
|
||||
{
|
||||
string query = string.Format("SELECT * FROM SliceSettingsCollection WHERE Tag = '{0}' AND PrinterId = {1} ORDER BY Name;", filterTag, ActivePrinterProfile.Instance.ActivePrinter.Id);
|
||||
results = (IEnumerable<DataStorage.SliceSettingsCollection>)DataStorage.Datastore.Instance.dbSQLite.Query<DataStorage.SliceSettingsCollection>(query);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
|
|
@ -193,16 +196,30 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
menuItem.Selected += new EventHandler(onItemSelect);
|
||||
}
|
||||
|
||||
MenuItem addNewPreset = dropDownList.AddItem("<< Add New >>", "new");
|
||||
MenuItem addNewPreset = dropDownList.AddItem("<< Add >>", "new");
|
||||
addNewPreset.Selected += new EventHandler(onNewItemSelect);
|
||||
|
||||
if (filterTag == "material")
|
||||
{
|
||||
dropDownList.SelectedValue = ActivePrinterProfile.Instance.GetMaterialSetting(1).ToString();
|
||||
try
|
||||
{
|
||||
dropDownList.SelectedValue = ActivePrinterProfile.Instance.GetMaterialSetting(1).ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
//Unable to set selected value
|
||||
}
|
||||
}
|
||||
else if (filterTag == "quality")
|
||||
{
|
||||
dropDownList.SelectedValue = ActivePrinterProfile.Instance.ActiveQualitySettingsID.ToString();
|
||||
try
|
||||
{
|
||||
dropDownList.SelectedValue = ActivePrinterProfile.Instance.ActiveQualitySettingsID.ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
//Unable to set selected value
|
||||
}
|
||||
}
|
||||
|
||||
return dropDownList;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
SlicePresetsWindow windowController;
|
||||
TextWidget presetNameError;
|
||||
MHTextEditWidget presetNameInput;
|
||||
|
||||
Button savePresetButton;
|
||||
Button duplicatePresetButton;
|
||||
Button importPresetButton;
|
||||
Button exportPresetButton;
|
||||
|
||||
int tabIndexForItem = 0;
|
||||
|
||||
public SlicePresetDetailWidget(SlicePresetsWindow windowController)
|
||||
|
|
@ -79,7 +84,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
void AddHandlers()
|
||||
{
|
||||
savePresetButton.Click += savePresets_Click;
|
||||
savePresetButton.Click += new ButtonBase.ButtonEventHandler(savePresets_Click);
|
||||
duplicatePresetButton.Click += new ButtonBase.ButtonEventHandler(duplicatePresets_Click);
|
||||
importPresetButton.Click += new ButtonBase.ButtonEventHandler(importPresets_Click);
|
||||
exportPresetButton.Click += new ButtonBase.ButtonEventHandler(exportPresets_Click);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -199,6 +207,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
container.Margin = new BorderDouble(top: 3);
|
||||
|
||||
savePresetButton = buttonFactory.Generate(LocalizedString.Get("Save"));
|
||||
duplicatePresetButton = buttonFactory.Generate(LocalizedString.Get("Duplicate"));
|
||||
importPresetButton = buttonFactory.Generate(LocalizedString.Get("Import"));
|
||||
exportPresetButton = buttonFactory.Generate(LocalizedString.Get("Export"));
|
||||
|
||||
Button cancelButton = buttonFactory.Generate(LocalizedString.Get("Cancel"));
|
||||
cancelButton.Click += (sender, e) =>
|
||||
{
|
||||
|
|
@ -209,9 +221,15 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
};
|
||||
|
||||
container.AddChild(savePresetButton);
|
||||
//Only show duplicate/import/export buttons if setting has been saved.
|
||||
if (windowController.ActivePresetLayer.settingsCollectionData.Id != 0)
|
||||
{
|
||||
container.AddChild(duplicatePresetButton);
|
||||
container.AddChild(importPresetButton);
|
||||
container.AddChild(exportPresetButton);
|
||||
}
|
||||
container.AddChild(new HorizontalSpacer());
|
||||
container.AddChild(cancelButton);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
@ -344,15 +362,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
settingDropDownList.SelectedValue = selectedSettingValue;
|
||||
}
|
||||
|
||||
Button addButton = buttonFactory.Generate("Add");
|
||||
addButton.Click += new ButtonBase.ButtonEventHandler(OnAddSettingClick);
|
||||
addButton.Margin = new BorderDouble(right: 3);
|
||||
|
||||
addSettingsContainer.RemoveAllChildren();
|
||||
addSettingsContainer.AddChild(categoryDropDownList);
|
||||
addSettingsContainer.AddChild(groupDropDownList);
|
||||
addSettingsContainer.AddChild(settingDropDownList);
|
||||
addSettingsContainer.AddChild(addButton);
|
||||
//addSettingsContainer.AddChild(addButton);
|
||||
}
|
||||
|
||||
void OnItemSelected(object sender, EventArgs e)
|
||||
|
|
@ -390,10 +404,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
MenuItem item = (MenuItem)sender;
|
||||
string[] valueArray = item.Value.Split(':');
|
||||
string configName = valueArray[2];
|
||||
addRowSettingData = SliceSettingsOrganizer.Instance.GetSettingsData(configName);
|
||||
addRowSettingData = SliceSettingsOrganizer.Instance.GetSettingsData(configName);
|
||||
AddSettingToPreset();
|
||||
}
|
||||
|
||||
void OnAddSettingClick(object sender, EventArgs e)
|
||||
void AddSettingToPreset()
|
||||
{
|
||||
UiThread.RunOnIdle((state) =>
|
||||
{
|
||||
|
|
@ -801,8 +816,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
Dictionary<string, DataStorage.SliceSetting> settingsDictionary = new Dictionary<string, DataStorage.SliceSetting>();
|
||||
DataStorage.SliceSettingsCollection collection = new DataStorage.SliceSettingsCollection();
|
||||
|
||||
collection.Name = string.Format("{0} ({1})", windowController.filterLabel, noExistingPresets.ToString());
|
||||
collection.Tag = windowController.filterTag;
|
||||
if (ActivePrinterProfile.Instance.ActivePrinter != null)
|
||||
{
|
||||
collection.Name = string.Format("{0} ({1})", windowController.filterLabel, noExistingPresets.ToString());
|
||||
collection.Tag = windowController.filterTag;
|
||||
collection.PrinterId = ActivePrinterProfile.Instance.ActivePrinter.Id;
|
||||
}
|
||||
|
||||
windowController.ActivePresetLayer = new SettingsLayer(collection, settingsDictionary);
|
||||
}
|
||||
|
|
@ -829,6 +848,112 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
void duplicatePresets_Click(object sender, MouseEventArgs mouseEvent)
|
||||
{
|
||||
UiThread.RunOnIdle((state) =>
|
||||
{
|
||||
DataStorage.SliceSettingsCollection duplicateCollection = new SliceSettingsCollection();
|
||||
duplicateCollection.Name = string.Format("{0} (copy)".FormatWith(windowController.ActivePresetLayer.settingsCollectionData.Name));
|
||||
duplicateCollection.Tag = windowController.ActivePresetLayer.settingsCollectionData.Tag;
|
||||
duplicateCollection.PrinterId = windowController.ActivePresetLayer.settingsCollectionData.PrinterId;
|
||||
|
||||
|
||||
Dictionary<string, DataStorage.SliceSetting> settingsDictionary = new Dictionary<string, DataStorage.SliceSetting>();
|
||||
IEnumerable<DataStorage.SliceSetting> settingsList = this.windowController.GetCollectionSettings(windowController.ActivePresetLayer.settingsCollectionData.Id);
|
||||
foreach (DataStorage.SliceSetting s in settingsList)
|
||||
{
|
||||
settingsDictionary[s.Name] = s;
|
||||
}
|
||||
SettingsLayer duplicateLayer = new SettingsLayer(duplicateCollection, settingsDictionary);
|
||||
windowController.ActivePresetLayer = duplicateLayer;
|
||||
windowController.ChangeToSlicePresetDetail();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
string configFileExtension = "slice";
|
||||
void importPresets_Click(object sender, MouseEventArgs mouseEvent)
|
||||
{
|
||||
OpenFileDialogParams openParams = new OpenFileDialogParams("Load Slice Preset|*.slice;*.ini");
|
||||
openParams.ActionButtonLabel = "Load Slice Preset";
|
||||
openParams.Title = "MatterControl: Select A File";
|
||||
|
||||
FileDialog.OpenFileDialog(ref openParams);
|
||||
if (openParams.FileNames != null)
|
||||
{
|
||||
Dictionary<string, DataStorage.SliceSetting> settingsDictionary = new Dictionary<string, DataStorage.SliceSetting>();
|
||||
try
|
||||
{
|
||||
if (File.Exists(openParams.FileName))
|
||||
{
|
||||
string[] lines = System.IO.File.ReadAllLines(openParams.FileName);
|
||||
foreach (string line in lines)
|
||||
{
|
||||
//Ignore commented lines
|
||||
if (!line.StartsWith("#"))
|
||||
{
|
||||
string[] settingLine = line.Split('=');
|
||||
string keyName = settingLine[0].Trim();
|
||||
string settingDefaultValue = settingLine[1].Trim();
|
||||
|
||||
DataStorage.SliceSetting sliceSetting = new DataStorage.SliceSetting();
|
||||
sliceSetting.Name = keyName;
|
||||
sliceSetting.Value = settingDefaultValue;
|
||||
sliceSetting.SettingsCollectionId = windowController.ActivePresetLayer.settingsCollectionData.Id;
|
||||
|
||||
settingsDictionary.Add(keyName, sliceSetting);
|
||||
}
|
||||
}
|
||||
windowController.ActivePresetLayer.settingsDictionary = settingsDictionary;
|
||||
LoadSettingsRows();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// Error loading configuration
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void exportPresets_Click(object sender, MouseEventArgs mouseEvent)
|
||||
{
|
||||
SaveAs();
|
||||
}
|
||||
|
||||
public void SaveAs()
|
||||
{
|
||||
string documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
|
||||
SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Slice Preset|*." + configFileExtension, documentsPath);
|
||||
|
||||
System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams);
|
||||
if (streamToSaveTo != null)
|
||||
{
|
||||
streamToSaveTo.Close();
|
||||
GenerateConfigFile(saveParams.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
public void GenerateConfigFile(string fileName)
|
||||
{
|
||||
List<string> configFileAsList = new List<string>();
|
||||
|
||||
foreach (KeyValuePair<String, DataStorage.SliceSetting> setting in windowController.ActivePresetLayer.settingsDictionary)
|
||||
{
|
||||
string settingString = string.Format("{0} = {1}", setting.Value.Name, setting.Value.Value);
|
||||
configFileAsList.Add(settingString);
|
||||
}
|
||||
string configFileAsString = string.Join("\n", configFileAsList.ToArray());
|
||||
|
||||
FileStream fs = new FileStream(fileName, FileMode.Create);
|
||||
StreamWriter sw = new System.IO.StreamWriter(fs);
|
||||
sw.Write(configFileAsString);
|
||||
sw.Close();
|
||||
}
|
||||
|
||||
void saveActivePresets()
|
||||
{
|
||||
windowController.ActivePresetLayer.settingsCollectionData.Name = presetNameInput.Text;
|
||||
|
|
@ -839,7 +964,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
public class SettingsDropDownList : DropDownList
|
||||
{
|
||||
|
||||
static RGBA_Bytes whiteSemiTransparent = new RGBA_Bytes(255, 255, 255, 100);
|
||||
static RGBA_Bytes whiteTransparent = new RGBA_Bytes(255, 255, 255, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -148,10 +148,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
IEnumerable<DataStorage.SliceSettingsCollection> GetCollections()
|
||||
{
|
||||
IEnumerable<DataStorage.SliceSettingsCollection> results = Enumerable.Empty<DataStorage.SliceSettingsCollection>();
|
||||
|
||||
//Retrieve a list of collections matching from the Datastore
|
||||
string query = string.Format("SELECT * FROM SliceSettingsCollection WHERE Tag = '{0}';", windowController.filterTag);
|
||||
results = (IEnumerable<DataStorage.SliceSettingsCollection>)DataStorage.Datastore.Instance.dbSQLite.Query<DataStorage.SliceSettingsCollection>(query);
|
||||
if (ActivePrinterProfile.Instance.ActivePrinter != null)
|
||||
{
|
||||
//Retrieve a list of collections matching from the Datastore
|
||||
string query = string.Format("SELECT * FROM SliceSettingsCollection WHERE Tag = '{0}' AND PrinterId = {1} ORDER BY Name;", windowController.filterTag, ActivePrinterProfile.Instance.ActivePrinter.Id);
|
||||
results = (IEnumerable<DataStorage.SliceSettingsCollection>)DataStorage.Datastore.Instance.dbSQLite.Query<DataStorage.SliceSettingsCollection>(query);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
this.MinimumSize = new Vector2(640, 480);
|
||||
}
|
||||
|
||||
|
||||
public void ChangeToSlicePresetList()
|
||||
{
|
||||
this.ActivePresetLayer = null;
|
||||
|
|
@ -130,7 +129,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
return result;
|
||||
}
|
||||
|
||||
IEnumerable<DataStorage.SliceSetting> GetCollectionSettings(int collectionId)
|
||||
public IEnumerable<DataStorage.SliceSetting> GetCollectionSettings(int collectionId)
|
||||
{
|
||||
//Retrieve a list of slice settings from the Datastore
|
||||
string query = string.Format("SELECT * FROM SliceSetting WHERE SettingsCollectionID = {0};", collectionId);
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
buttonFactory.FixedHeight = 20;
|
||||
buttonFactory.fontSize = 10;
|
||||
buttonFactory.normalFillColor = RGBA_Bytes.White;
|
||||
buttonFactory.normalTextColor = RGBA_Bytes.DarkGray;
|
||||
|
||||
showHelpBox = new CheckBox(0, 0, LocalizedString.Get("Show Help"), textSize: 10);
|
||||
showHelpBox.Checked = UserSettings.Instance.get(SliceSettingsShowHelpEntry) == "true";
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ infill_speed = 50
|
|||
layer_gcode =
|
||||
layer_height = 0.21
|
||||
max_fan_speed = 100
|
||||
min_fan_speed = 35
|
||||
min_fan_speed = 100
|
||||
min_print_speed = 2
|
||||
min_skirt_length = 0
|
||||
notes =
|
||||
|
|
|
|||
|
|
@ -1932,9 +1932,24 @@ Translated:You cannot move any lower. This position on your bed is too low for t
|
|||
English:Edit Preset
|
||||
Translated:Edit Preset
|
||||
|
||||
English:Downloading updates...
|
||||
Translated:Downloading updates...
|
||||
English:Slice-Engine
|
||||
Translated:Slice-Engine
|
||||
|
||||
English:Oops! Unable to install update.
|
||||
Translated:Oops! Unable to install update.
|
||||
English:Status: Completed
|
||||
Translated:Status: Completed
|
||||
|
||||
English:Unlock
|
||||
Translated:Unlock
|
||||
|
||||
English:Show Terminal
|
||||
Translated:Show Terminal
|
||||
|
||||
English:Configure
|
||||
Translated:Configure
|
||||
|
||||
English:Disable
|
||||
Translated:Disable
|
||||
|
||||
English:Est. Weight
|
||||
Translated:Est. Weight
|
||||
|
||||
|
|
|
|||
|
|
@ -1816,3 +1816,123 @@ Translated:MatterContol
|
|||
English:Saving to Parts Sheet
|
||||
Translated:Saving to Parts Sheet
|
||||
|
||||
English:The default temperature to set the bed to. Can sometimes be overriden on the first layer. Set to 0 to eliminate bed temperature commands.
|
||||
Translated:The default temperature to set the bed to. Can sometimes be overriden on the first layer. Set to 0 to eliminate bed temperature commands.
|
||||
|
||||
English:The default temperature to set the extruder to. Can sometimes be overriden on the first layer.
|
||||
Translated:The default temperature to set the extruder to. Can sometimes be overriden on the first layer.
|
||||
|
||||
English:Macro Editor
|
||||
Translated:Macro Editor
|
||||
|
||||
English:Macro Presets
|
||||
Translated:Macro Presets
|
||||
|
||||
English:Edit Macro
|
||||
Translated:Edit Macro
|
||||
|
||||
English:Macro Name
|
||||
Translated:Macro Name
|
||||
|
||||
English:Give your macro a name
|
||||
Translated:Give your macro a name
|
||||
|
||||
English:Macro Commands
|
||||
Translated:Macro Commands
|
||||
|
||||
English:This should be in 'Gcode'
|
||||
Translated:This should be in 'Gcode'
|
||||
|
||||
English:3D Printer Setup
|
||||
Translated:3D Printer Setup
|
||||
|
||||
English:Give your printer a name.
|
||||
Translated:Give your printer a name.
|
||||
|
||||
English:Select Make
|
||||
Translated:Select Make
|
||||
|
||||
English:Select the printer manufacturer
|
||||
Translated:Select the printer manufacturer
|
||||
|
||||
English:Select the printer model
|
||||
Translated:Select the printer model
|
||||
|
||||
English:Save & Continue
|
||||
Translated:Save & Continue
|
||||
|
||||
English:MatterControl will now attempt to auto-detect printer.
|
||||
Translated:MatterControl will now attempt to auto-detect printer.
|
||||
|
||||
English:Disconnect printer
|
||||
Translated:Disconnect printer
|
||||
|
||||
English:if currently connected
|
||||
Translated:if currently connected
|
||||
|
||||
English:Press
|
||||
Translated:Press
|
||||
|
||||
English:Continue
|
||||
Translated:Continue
|
||||
|
||||
English:Manual Configuration
|
||||
Translated:Manual Configuration
|
||||
|
||||
English:Setup Manual Configuration
|
||||
Translated:Setup Manual Configuration
|
||||
|
||||
English:or
|
||||
Translated:or
|
||||
|
||||
English:Skip Printer Connection
|
||||
Translated:Skip Printer Connection
|
||||
|
||||
English:You can either
|
||||
Translated:You can either
|
||||
|
||||
English:You can also
|
||||
Translated:You can also
|
||||
|
||||
English:Extruder Temperature Settings
|
||||
Translated:Extruder Temperature Settings
|
||||
|
||||
English:Temperature Shortcut Presets
|
||||
Translated:Temperature Shortcut Presets
|
||||
|
||||
English:Label
|
||||
Translated:Label
|
||||
|
||||
English:Preset
|
||||
Translated:Preset
|
||||
|
||||
English:Max Temp.
|
||||
Translated:Max Temp.
|
||||
|
||||
English:Bed Temperature Settings
|
||||
Translated:Bed Temperature Settings
|
||||
|
||||
English:Movement Speeds
|
||||
Translated:Movement Speeds
|
||||
|
||||
English:Extruder
|
||||
Translated:Extruder
|
||||
|
||||
English:Power on and connect printer
|
||||
Translated:Power on and connect printer
|
||||
|
||||
English:Attempting to connect
|
||||
Translated:Attempting to connect
|
||||
|
||||
English:Connection succeeded
|
||||
Translated:Connection succeeded
|
||||
|
||||
English:You cannot move any lower. This position on your bed is too low for the extruder to reach. You need to raise your bed, or adjust your limits to allow the extruder to go lower.
|
||||
Translated:You cannot move any lower. This position on your bed is too low for the extruder to reach. You need to raise your bed, or adjust your limits to allow the extruder to go lower.
|
||||
|
||||
English:Edit Preset
|
||||
Translated:Edit Preset
|
||||
|
||||
English:Slice-Engine
|
||||
Translated:Slice-Engine
|
||||
|
||||
|
|
|
|||
|
|
@ -5,4 +5,7 @@ should appear at the bottom of that file.
|
|||
|
||||
There is a folder for each langage. The names of these folders
|
||||
match the ISO 639 standard which can be found at:
|
||||
http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
|
||||
http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
|
||||
|
||||
Special thanks to:
|
||||
Filip Bartoszek - original German Translation
|
||||
Loading…
Add table
Add a link
Reference in a new issue