Merge branch 'master' into master

This commit is contained in:
Lars Brubaker 2016-12-01 18:23:52 -08:00 committed by GitHub
commit 6449ccc5cb
4 changed files with 30 additions and 21 deletions

View file

@ -68,7 +68,6 @@ namespace MatterHackers.MatterControl
public bool RestartOnClose = false;
private static readonly Vector2 minSize = new Vector2(600, 600);
private static MatterControlApplication instance;
private string[] commandLineArgs = null;
private string confirmExit = "Confirm Exit".Localize();
private bool DoCGCollectEveryDraw = false;
private int drawCount = 0;
@ -100,6 +99,7 @@ namespace MatterHackers.MatterControl
}
public static bool IsLoading { get; private set; } = true;
static bool forceSofwareRendering = false;
static MatterControlApplication()
{
@ -121,21 +121,11 @@ namespace MatterHackers.MatterControl
}
}
private MatterControlApplication(double width, double height)
: base(width, height)
string[] commandLineArgs;
void ProcessCommandLine(string[] commandLineArgs)
{
ApplicationSettings.Instance.set("HardwareHasCamera", "false");
Name = "MatterControl";
// set this at startup so that we can tell next time if it got set to true in close
UserSettings.Instance.Fields.StartCount = UserSettings.Instance.Fields.StartCount + 1;
this.commandLineArgs = Environment.GetCommandLineArgs();
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
bool forceSofwareRendering = false;
this.commandLineArgs = commandLineArgs;
for (int currentCommandIndex = 0; currentCommandIndex < commandLineArgs.Length; currentCommandIndex++)
{
string command = commandLineArgs[currentCommandIndex];
@ -160,6 +150,10 @@ namespace MatterHackers.MatterControl
DoCGCollectEveryDraw = true;
break;
case "ORTHOGRAPHIC_THUMBNAILS":
UserSettings.Instance.set(UserSettingsKey.ThumbnailRenderingMode, "orthographic");
break;
//case "CREATE_AND_SELECT_PRINTER":
// if (currentCommandIndex + 1 <= commandLineArgs.Length)
// {
@ -243,6 +237,21 @@ namespace MatterHackers.MatterControl
// Else send these to the running instance so it can load them.
}
}
}
private MatterControlApplication(string[] commandLine, double width, double height)
: base(width, height)
{
ApplicationSettings.Instance.set("HardwareHasCamera", "false");
Name = "MatterControl";
// set this at startup so that we can tell next time if it got set to true in close
UserSettings.Instance.Fields.StartCount = UserSettings.Instance.Fields.StartCount + 1;
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
ProcessCommandLine(commandLine);
//WriteTestGCodeFile();
#if !DEBUG
@ -410,7 +419,7 @@ namespace MatterHackers.MatterControl
{
if (instance == null)
{
instance = CreateInstance();
instance = CreateInstance(Environment.GetCommandLineArgs());
instance.ShowAsSystemWindow();
}
@ -420,7 +429,7 @@ namespace MatterHackers.MatterControl
public event EventHandler PictureTaken;
public static MatterControlApplication CreateInstance(int overrideWidth = -1, int overrideHeight = -1)
public static MatterControlApplication CreateInstance(string[] commandLine, int overrideWidth = -1, int overrideHeight = -1)
{
int width = 0;
int height = 0;
@ -465,7 +474,7 @@ namespace MatterHackers.MatterControl
using (new PerformanceTimer("Startup", "Total"))
{
instance = new MatterControlApplication(width, height);
instance = new MatterControlApplication(commandLine, width, height);
if (instance.DesktopPosition == new Point2D())
{

@ -1 +1 @@
Subproject commit 2b305bb1ceb9d54d6af60c5aaa71092e8fdc1611
Subproject commit 3a04f46f41c96a0ce5f084112d2ff0000a1d9ac3

@ -1 +1 @@
Subproject commit 75c89c1d25b08a99a63a0f6725eba20e2cb1707c
Subproject commit 768f3a815077a9bda63781ed3199a7302d0403ff

View file

@ -401,7 +401,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
defaultTestImages = TestContext.CurrentContext.ResolveProjectPath(4, "Tests", "TestData", "TestImages");
}
MatterControlApplication matterControlWindow = MatterControlApplication.CreateInstance(overrideWidth, overrideHeight);
MatterControlApplication matterControlWindow = MatterControlApplication.CreateInstance(new string[] { "ORTHOGRAPHIC_THUMBNAILS" }, overrideWidth, overrideHeight);
var config = TestAutomationConfig.Load();