Merge from Origin Development

This commit is contained in:
Matt Moening 2014-11-26 13:06:44 -08:00
commit ba2b96b304
28 changed files with 343 additions and 252 deletions

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<loadFromRemoteSources enabled="true"/>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib" />
<probing privatePath="lib"/>
</assemblyBinding>
</runtime>
</configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>

View file

@ -31,6 +31,8 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<ReleaseVersion>1.1.4</ReleaseVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@ -42,6 +44,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>True</Optimize>
@ -51,6 +54,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>True</DebugSymbols>
@ -62,6 +66,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<WarningLevel>4</WarningLevel>
<Optimize>False</Optimize>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
@ -71,6 +76,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|AnyCPU'">
<OutputPath>bin\Release64\</OutputPath>
@ -86,6 +92,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|x86'">
<OutputPath>bin\x86\Release64\</OutputPath>
@ -103,6 +110,7 @@
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
@ -117,6 +125,7 @@
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|x86'">
<DebugSymbols>true</DebugSymbols>
@ -131,6 +140,7 @@
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@ -144,6 +154,7 @@
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
@ -155,6 +166,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|x64'">
<OutputPath>bin\x64\Release64\</OutputPath>
@ -171,6 +183,7 @@
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|x64'">
<DebugSymbols>true</DebugSymbols>
@ -184,6 +197,7 @@
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

View file

@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup/></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>

View file

@ -20,7 +20,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage
{
Button languageRestartButton;
Button configureUpdateFeedButton;
Button configureLanguageButton;
Button displayControlRestartButton;
public ApplicationSettingsWidget()

View file

@ -64,7 +64,6 @@ namespace MatterHackers.MatterControl
Button disablePrintLevelingButton;
DisableableWidget eePromControlsContainer;
DisableableWidget terminalCommunicationsContainer;
DisableableWidget printLevelingContainer;
@ -135,8 +134,6 @@ namespace MatterHackers.MatterControl
controlsTopToBottomLayout.AddChild(container);
}
Button restartButton;
private void RestartApplication()
{
UiThread.RunOnIdle((state) =>
@ -159,7 +156,6 @@ namespace MatterHackers.MatterControl
if (languageCode != UserSettings.Instance.get("Language"))
{
UserSettings.Instance.set("Language", languageCode);
restartButton.Visible = true;
}
}
@ -450,79 +446,8 @@ namespace MatterHackers.MatterControl
this.textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor;
this.linkButtonFactory.fontSize = 11;
}
}
private void SetVisibleControls()
{
return;
if (ActivePrinterProfile.Instance.ActivePrinter == null)
{
// no printer selected
eePromControlsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
terminalCommunicationsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
printLevelingContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
//cloudMonitorContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
}
else // we at least have a printer selected
{
//cloudMonitorContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
switch (PrinterConnectionAndCommunication.Instance.CommunicationState)
{
case PrinterConnectionAndCommunication.CommunicationStates.Disconnecting:
case PrinterConnectionAndCommunication.CommunicationStates.ConnectionLost:
case PrinterConnectionAndCommunication.CommunicationStates.Disconnected:
case PrinterConnectionAndCommunication.CommunicationStates.AttemptingToConnect:
case PrinterConnectionAndCommunication.CommunicationStates.FailedToConnect:
eePromControlsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
printLevelingContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
terminalCommunicationsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
break;
case PrinterConnectionAndCommunication.CommunicationStates.FinishedPrint:
case PrinterConnectionAndCommunication.CommunicationStates.Connected:
eePromControlsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
printLevelingContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
terminalCommunicationsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
break;
case PrinterConnectionAndCommunication.CommunicationStates.PrintingFromSd:
eePromControlsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
printLevelingContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
terminalCommunicationsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
break;
case PrinterConnectionAndCommunication.CommunicationStates.PreparingToPrint:
case PrinterConnectionAndCommunication.CommunicationStates.PreparingToPrintToSd:
case PrinterConnectionAndCommunication.CommunicationStates.PrintingToSd:
case PrinterConnectionAndCommunication.CommunicationStates.Printing:
switch (PrinterConnectionAndCommunication.Instance.PrintingState)
{
case PrinterConnectionAndCommunication.DetailedPrintingState.HomingAxis:
case PrinterConnectionAndCommunication.DetailedPrintingState.HeatingBed:
case PrinterConnectionAndCommunication.DetailedPrintingState.HeatingExtruder:
case PrinterConnectionAndCommunication.DetailedPrintingState.Printing:
eePromControlsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
printLevelingContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
terminalCommunicationsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
break;
default:
throw new NotImplementedException();
}
break;
case PrinterConnectionAndCommunication.CommunicationStates.Paused:
eePromControlsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
printLevelingContainer.SetEnableLevel(DisableableWidget.EnableLevel.Disabled);
terminalCommunicationsContainer.SetEnableLevel(DisableableWidget.EnableLevel.Enabled);
break;
default:
throw new NotImplementedException();
}
}
}
event EventHandler unregisterEvents;
private void AddHandlers()
{
@ -532,7 +457,6 @@ namespace MatterHackers.MatterControl
private void onPrinterStatusChanged(object sender, EventArgs e)
{
SetVisibleControls();
this.Invalidate();
}

View file

@ -13,7 +13,6 @@ namespace MatterHackers.MatterControl
public class AltGroupBox : FlowLayoutWidget
{
GuiWidget groupBoxLabel;
double lineInset = 8.5;
RGBA_Bytes borderColor = RGBA_Bytes.Black;
GuiWidget clientArea;

View file

@ -75,7 +75,7 @@ namespace MatterHackers.MatterControl
ImageBuffer thumbnailImage = new Agg.Image.ImageBuffer();
// all the color stuff
public double BorderWidth = 0; //Don't delete this - required for OnDraw
new public double BorderWidth = 0; //Don't delete this - required for OnDraw
protected double borderRadius = 0;
protected RGBA_Bytes HoverBorderColor = new RGBA_Bytes();

View file

@ -50,12 +50,18 @@ namespace MatterHackers.MatterControl.EeProm
public void update(string line)
{
string[] lines = line.Substring(4).Split(' ');
int.TryParse(lines[0], out type);
int.TryParse(lines[1], out position);
val = lines[2];
description = line.Substring(7 + lines[0].Length + lines[1].Length + lines[2].Length);
changed = false;
if (line.Length > 4)
{
string[] lines = line.Substring(4).Split(' ');
if (lines.Length > 2)
{
int.TryParse(lines[0], out type);
int.TryParse(lines[1], out position);
val = lines[2];
description = line.Substring(7 + lines[0].Length + lines[1].Length + lines[2].Length);
changed = false;
}
}
}
public void save()

View file

@ -17,6 +17,8 @@
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<ReleaseVersion>0.8.2</ReleaseVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@ -28,6 +30,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@ -37,6 +40,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|AnyCPU'">
<OutputPath>bin\Release64\</OutputPath>
@ -55,6 +59,7 @@
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
@ -67,6 +72,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@ -78,6 +84,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
@ -89,6 +96,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|x64'">
<OutputPath>bin\x64\Release64\</OutputPath>
@ -106,6 +114,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|x64'">
<DebugSymbols>true</DebugSymbols>
@ -117,11 +126,13 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Launcher.cs" />

3
Launcher/app.config Normal file
View file

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>

View file

@ -36,6 +36,10 @@
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@ -47,6 +51,7 @@
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<Commandlineparameters>SHOW_MEMORY</Commandlineparameters>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
@ -57,6 +62,7 @@
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>application.ico</ApplicationIcon>
@ -76,6 +82,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

View file

@ -387,7 +387,6 @@ namespace MatterHackers.MatterControl
}
}
bool cancelClose;
void onConfirmExit(bool messageBoxResponse)
{
bool CancelClose;

View file

@ -258,40 +258,12 @@ namespace MatterHackers.MatterControl
for(int i=0; i<meshGroup.Meshes.Count; i++)
{
Mesh mesh = meshGroup.Meshes[i];
List<IRayTraceable> allPolys = new List<IRayTraceable>();
List<Vector3> positions = new List<Vector3>();
bool continueProcessing;
foreach (Face face in mesh.Faces)
{
positions.Clear();
foreach (Vertex vertex in face.Vertices())
{
positions.Add(vertex.Position);
}
// We should use the teselator for this if it is greater than 3.
Vector3 next = positions[1];
for (int positionIndex = 2; positionIndex < positions.Count; positionIndex++)
{
TriangleShape triangel = new TriangleShape(positions[0], next, positions[positionIndex], null);
allPolys.Add(triangel);
next = positions[positionIndex];
}
if (reportProgress != null)
{
if((currentAction % 256) == 0 || needUpdateTitle)
{
reportProgress(currentAction / (double)totalActionCount, "Creating Trace Polygons", out continueProcessing);
needUpdateTitle = false;
}
currentAction++;
}
}
List<IRayTraceable> allPolys = AddTraceDataForMesh(mesh, totalActionCount, ref currentAction, ref needUpdateTitle, reportProgress);
needUpdateTitle = true;
if (reportProgress != null)
{
bool continueProcessing;
reportProgress(currentAction / (double)totalActionCount, "Creating Trace Group", out continueProcessing);
}
@ -311,5 +283,51 @@ namespace MatterHackers.MatterControl
}
}
}
public static IRayTraceable CreateTraceDataForMesh(Mesh mesh)
{
int unusedInt = 0;
bool unusedBool = false;
List<IRayTraceable> allPolys = AddTraceDataForMesh(mesh, 0, ref unusedInt, ref unusedBool, null);
return BoundingVolumeHierarchy.CreateNewHierachy(allPolys);
}
private static List<IRayTraceable> AddTraceDataForMesh(Mesh mesh, int totalActionCount, ref int currentAction, ref bool needToUpdateProgressReport, ReportProgressRatio reportProgress)
{
bool continueProcessing;
List<IRayTraceable> allPolys = new List<IRayTraceable>();
List<Vector3> positions = new List<Vector3>();
foreach (Face face in mesh.Faces)
{
positions.Clear();
foreach (Vertex vertex in face.Vertices())
{
positions.Add(vertex.Position);
}
// We should use the teselator for this if it is greater than 3.
Vector3 next = positions[1];
for (int positionIndex = 2; positionIndex < positions.Count; positionIndex++)
{
TriangleShape triangel = new TriangleShape(positions[0], next, positions[positionIndex], null);
allPolys.Add(triangel);
next = positions[positionIndex];
}
if (reportProgress != null)
{
if ((currentAction % 256) == 0 || needToUpdateProgressReport)
{
reportProgress(currentAction / (double)totalActionCount, "Creating Trace Polygons", out continueProcessing);
needToUpdateProgressReport = false;
}
currentAction++;
}
}
return allPolys;
}
}
}

View file

@ -35,7 +35,6 @@ using MatterHackers.Localizations;
using MatterHackers.MeshVisualizer;
using MatterHackers.VectorMath;
using MatterHackers.PolygonMesh;
using MatterHackers.MeshVisualizer;
namespace MatterHackers.MatterControl.PartPreviewWindow
{

View file

@ -64,6 +64,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
createSelectionDataBackgroundWorker.RunWorkerAsync();
}
SelectedMeshGroupIndex = 0;
}
void createSelectionDataBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)

View file

@ -60,36 +60,64 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
public class UpArrow3D : InteractionVolume
{
Mesh upArrow;
MeshViewerWidget meshViewerToDrawWith;
public UpArrow3D(MeshViewerWidget meshViewerToDrawWith)
: base(new CylinderShape(3, 12, new SolidMaterial(RGBA_Floats.Red, .5, 0, .4)))
: base(new CylinderShape(6, 15, new SolidMaterial(RGBA_Floats.Red, .5, 0, .4)), meshViewerToDrawWith)
{
this.meshViewerToDrawWith = meshViewerToDrawWith;
string arrowFile = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "Icons", "3D Icons", "up_pointer.stl");
List<MeshGroup> loadedMeshGroups = MeshFileIo.Load(arrowFile);
upArrow = loadedMeshGroups[0].Meshes[0];
if (File.Exists(arrowFile))
{
List<MeshGroup> loadedMeshGroups = MeshFileIo.Load(arrowFile);
upArrow = loadedMeshGroups[0].Meshes[0];
//CollisionVolume = PlatingHelper.CreateTraceDataForMesh(upArrow);
}
}
public override void OnMouseDown(MouseEvent3DArgs mouseEvent3D)
{
base.OnMouseDown(mouseEvent3D);
}
public override void OnMouseMove(MouseEvent3DArgs mouseEvent3D)
{
base.OnMouseMove(mouseEvent3D);
}
public void SetPosition()
{
Matrix4X4 transform = MeshViewerToDrawWith.SelectedMeshGroupTransform.TotalTransform;
AxisAlignedBoundingBox selectedBounds = MeshViewerToDrawWith.SelectedMeshGroup.GetAxisAlignedBoundingBox();
Vector3 boundsCenter = selectedBounds.Center;
Vector3 centerTop = new Vector3(boundsCenter.x, boundsCenter.y, selectedBounds.maxXYZ.z);
Vector2 centerTopScreenPosition = MeshViewerToDrawWith.TrackballTumbleWidget.GetScreenPosition(centerTop);
//centerTopScreenPosition = meshViewerToDrawWith.TransformToParentSpace(this, centerTopScreenPosition);
double distBetweenPixelsWorldSpace = MeshViewerToDrawWith.TrackballTumbleWidget.GetWorldUnitsPerScreenPixelAtPosition(centerTop);
transform = Matrix4X4.CreateTranslation(new Vector3(centerTop.x, centerTop.y, centerTop.z + 20 * distBetweenPixelsWorldSpace)) * transform;
transform = Matrix4X4.CreateScale(distBetweenPixelsWorldSpace) * transform;
TotalTransform = transform;
}
public override void DrawGlContent(EventArgs e)
{
if (meshViewerToDrawWith.SelectedMeshGroup != null)
if (MeshViewerToDrawWith.SelectedMeshGroup != null)
{
AxisAlignedBoundingBox selectedBounds = meshViewerToDrawWith.SelectedMeshGroup.GetAxisAlignedBoundingBox(meshViewerToDrawWith.SelectedMeshGroupTransform.TotalTransform);
Vector3 boundsCenter = selectedBounds.Center;
Vector3 centerTop = new Vector3(boundsCenter.x, boundsCenter.y, selectedBounds.maxXYZ.z);
Vector2 centerTopScreenPosition = meshViewerToDrawWith.TrackballTumbleWidget.GetScreenPosition(centerTop);
//centerTopScreenPosition = meshViewerToDrawWith.TransformToParentSpace(this, centerTopScreenPosition);
double scalling = meshViewerToDrawWith.TrackballTumbleWidget.GetWorldUnitsPerScreenPixelAtPosition(centerTop);
GL.MatrixMode(MatrixMode.Modelview);
GL.PushMatrix();
GL.Translate(new Vector3(centerTop.x, centerTop.y, centerTop.z + 20 * scalling));
GL.Scale(scalling, scalling, scalling);
GL.MultMatrix(TotalTransform.GetAsDoubleArray());
RenderMeshToGl.Render(upArrow, RGBA_Bytes.Black, RenderTypes.Shaded);
if (MouseOver)
{
RenderMeshToGl.Render(upArrow, RGBA_Bytes.Red, RenderTypes.Shaded);
}
else
{
RenderMeshToGl.Render(upArrow, RGBA_Bytes.Black, RenderTypes.Shaded);
}
GL.PopMatrix();
}
@ -103,6 +131,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
public WindowType windowType { get; set; }
EventHandler SelectionChanged;
UpArrow3D upArrow;
FlowLayoutWidget viewOptionContainer;
FlowLayoutWidget rotateOptionContainer;
@ -250,25 +279,30 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
&& ModifierKeys != Keys.Control
&& ModifierKeys != Keys.Alt)
{
int meshGroupHitIndex;
if (FindMeshGroupHitPosition(mouseEvent.Position, out meshGroupHitIndex))
if (!meshViewerWidget.MouseDownOnInteractionVolume)
{
meshSelectInfo.hitPlane = new PlaneShape(Vector3.UnitZ, meshSelectInfo.planeDownHitPos.z, null);
SelectedMeshGroupIndex = meshGroupHitIndex;
transformOnMouseDown = SelectedMeshGroupTransform.translation;
Invalidate();
meshSelectInfo.downOnPart = true;
if (SelectionChanged != null)
int meshGroupHitIndex;
if (FindMeshGroupHitPosition(mouseEvent.Position, out meshGroupHitIndex))
{
SelectionChanged(this, null);
meshSelectInfo.hitPlane = new PlaneShape(Vector3.UnitZ, meshSelectInfo.planeDownHitPos.z, null);
SelectedMeshGroupIndex = meshGroupHitIndex;
transformOnMouseDown = SelectedMeshGroupTransform.translation;
Invalidate();
meshSelectInfo.downOnPart = true;
if (SelectionChanged != null)
{
SelectionChanged(this, null);
}
}
}
else
{
SelectedMeshGroupIndex = -1;
else
{
SelectedMeshGroupIndex = -1;
}
UpdateSizeInfo();
}
}
}
@ -276,6 +310,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
public override void OnDraw(Graphics2D graphics2D)
{
if (HaveSelection)
{
upArrow.SetPosition();
}
hasDrawn = true;
base.OnDraw(graphics2D);
DrawStuffForSelectedPart(graphics2D);
@ -636,13 +675,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
});
}
meshViewerWidget.InteractionVolumes.Add(new UpArrow3D(meshViewerWidget));
upArrow = new UpArrow3D(meshViewerWidget);
meshViewerWidget.interactionVolumes.Add(upArrow);
// make sure the colors are set correctl
ThemeChanged(this, null);
}
private void OpenExportWindow()
private void OpenExportWindow()
{
if (exportingWindow == null)
{
@ -1289,25 +1329,28 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
void SetNewModelSize(double sizeInMm, int axis)
{
// because we remove any current scale before we change to a new one we only get the size of the base mesh data
AxisAlignedBoundingBox originalMeshBounds = SelectedMeshGroup.GetAxisAlignedBoundingBox();
if (HaveSelection)
{
// because we remove any current scale before we change to a new one we only get the size of the base mesh data
AxisAlignedBoundingBox originalMeshBounds = SelectedMeshGroup.GetAxisAlignedBoundingBox();
double currentSize = originalMeshBounds.Size[axis];
double desiredSize = sizeDisplay[axis].GetValue();
double scaleFactor = 1;
if (currentSize != 0)
{
scaleFactor = desiredSize / currentSize;
}
double currentSize = originalMeshBounds.Size[axis];
double desiredSize = sizeDisplay[axis].GetValue();
double scaleFactor = 1;
if (currentSize != 0)
{
scaleFactor = desiredSize / currentSize;
}
if (uniformScale.Checked)
{
scaleRatioControl.ActuallNumberEdit.Value = scaleFactor;
ApplyScaleFromEditField();
}
else
{
ScaleAxis(scaleFactor, axis);
if (uniformScale.Checked)
{
scaleRatioControl.ActuallNumberEdit.Value = scaleFactor;
ApplyScaleFromEditField();
}
else
{
ScaleAxis(scaleFactor, axis);
}
}
}
@ -1321,6 +1364,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
sizeDisplay[1].SetDisplayString("{0:0.00}".FormatWith(bounds.Size[1]));
sizeDisplay[2].SetDisplayString("{0:0.00}".FormatWith(bounds.Size[2]));
}
else
{
sizeDisplay[0].SetDisplayString("---");
sizeDisplay[1].SetDisplayString("---");
sizeDisplay[2].SetDisplayString("---");
}
}
private void SetApplyScaleVisability(Object sender, EventArgs e)
@ -1463,12 +1512,15 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
private void ApplyScaleFromEditField()
{
double scale = scaleRatioControl.ActuallNumberEdit.Value;
if (scale > 0)
if (HaveSelection)
{
ScaleAxis(scale, 0);
ScaleAxis(scale, 1);
ScaleAxis(scale, 2);
double scale = scaleRatioControl.ActuallNumberEdit.Value;
if (scale > 0)
{
ScaleAxis(scale, 0);
ScaleAxis(scale, 1);
ScaleAxis(scale, 2);
}
}
}
@ -1584,15 +1636,18 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
rotateControls.Add(rotateXButton);
rotateXButton.Click += (object sender, EventArgs mouseEvent) =>
{
double radians = MathHelper.DegreesToRadians(degreesControl.ActuallNumberEdit.Value);
// rotate it
ScaleRotateTranslate rotated = SelectedMeshGroupTransform;
rotated.rotation *= Matrix4X4.CreateRotationX(radians);
SelectedMeshGroupTransform = rotated;
if (SelectedMeshGroupIndex != -1)
{
double radians = MathHelper.DegreesToRadians(degreesControl.ActuallNumberEdit.Value);
// rotate it
ScaleRotateTranslate rotated = SelectedMeshGroupTransform;
rotated.rotation *= Matrix4X4.CreateRotationX(radians);
SelectedMeshGroupTransform = rotated;
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
saveButtons.Visible = true;
Invalidate();
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
saveButtons.Visible = true;
Invalidate();
}
};
Button rotateYButton = textImageButtonFactory.Generate("", "icon_rotate_32x32.png");
@ -1601,14 +1656,17 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
rotateControls.Add(rotateYButton);
rotateYButton.Click += (object sender, EventArgs mouseEvent) =>
{
double radians = MathHelper.DegreesToRadians(degreesControl.ActuallNumberEdit.Value);
// rotate it
ScaleRotateTranslate rotated = SelectedMeshGroupTransform;
rotated.rotation *= Matrix4X4.CreateRotationY(radians);
SelectedMeshGroupTransform = rotated;
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
saveButtons.Visible = true;
Invalidate();
if (SelectedMeshGroupIndex != -1)
{
double radians = MathHelper.DegreesToRadians(degreesControl.ActuallNumberEdit.Value);
// rotate it
ScaleRotateTranslate rotated = SelectedMeshGroupTransform;
rotated.rotation *= Matrix4X4.CreateRotationY(radians);
SelectedMeshGroupTransform = rotated;
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
saveButtons.Visible = true;
Invalidate();
}
};
Button rotateZButton = textImageButtonFactory.Generate("", "icon_rotate_32x32.png");
@ -1617,15 +1675,18 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
rotateControls.Add(rotateZButton);
rotateZButton.Click += (object sender, EventArgs mouseEvent) =>
{
double radians = MathHelper.DegreesToRadians(degreesControl.ActuallNumberEdit.Value);
// rotate it
ScaleRotateTranslate rotated = SelectedMeshGroupTransform;
rotated.rotation *= Matrix4X4.CreateRotationZ(radians);
SelectedMeshGroupTransform = rotated;
if (SelectedMeshGroupIndex != -1)
{
double radians = MathHelper.DegreesToRadians(degreesControl.ActuallNumberEdit.Value);
// rotate it
ScaleRotateTranslate rotated = SelectedMeshGroupTransform;
rotated.rotation *= Matrix4X4.CreateRotationZ(radians);
SelectedMeshGroupTransform = rotated;
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
saveButtons.Visible = true;
Invalidate();
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
saveButtons.Visible = true;
Invalidate();
}
};
buttonPanel.AddChild(rotateButtonContainer);
@ -1636,10 +1697,13 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
layFlatButton.Click += (object sender, EventArgs mouseEvent) =>
{
MakeLowestFaceFlat(SelectedMeshGroupIndex);
if (SelectedMeshGroupIndex != -1)
{
MakeLowestFaceFlat(SelectedMeshGroupIndex);
saveButtons.Visible = true;
Invalidate();
saveButtons.Visible = true;
Invalidate();
}
};
buttonPanel.AddChild(generateHorizontalRule());
@ -1661,16 +1725,19 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
mirrorControls.Add(mirrorXButton);
mirrorXButton.Click += (object sender, EventArgs mouseEvent) =>
{
SelectedMeshGroup.ReverseFaceEdges();
if (SelectedMeshGroupIndex != -1)
{
SelectedMeshGroup.ReverseFaceEdges();
ScaleRotateTranslate scale = SelectedMeshGroupTransform;
scale.scale *= Matrix4X4.CreateScale(-1, 1, 1);
SelectedMeshGroupTransform = scale;
ScaleRotateTranslate scale = SelectedMeshGroupTransform;
scale.scale *= Matrix4X4.CreateScale(-1, 1, 1);
SelectedMeshGroupTransform = scale;
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
saveButtons.Visible = true;
Invalidate();
saveButtons.Visible = true;
Invalidate();
}
};
Button mirrorYButton = textImageButtonFactory.Generate("Y", centerText: true);
@ -1678,16 +1745,19 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
mirrorControls.Add(mirrorYButton);
mirrorYButton.Click += (object sender, EventArgs mouseEvent) =>
{
SelectedMeshGroup.ReverseFaceEdges();
if (SelectedMeshGroupIndex != -1)
{
SelectedMeshGroup.ReverseFaceEdges();
ScaleRotateTranslate scale = SelectedMeshGroupTransform;
scale.scale *= Matrix4X4.CreateScale(1, -1, 1);
SelectedMeshGroupTransform = scale;
ScaleRotateTranslate scale = SelectedMeshGroupTransform;
scale.scale *= Matrix4X4.CreateScale(1, -1, 1);
SelectedMeshGroupTransform = scale;
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
saveButtons.Visible = true;
Invalidate();
saveButtons.Visible = true;
Invalidate();
}
};
Button mirrorZButton = textImageButtonFactory.Generate("Z", centerText: true);
@ -1695,16 +1765,19 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
mirrorControls.Add(mirrorZButton);
mirrorZButton.Click += (object sender, EventArgs mouseEvent) =>
{
SelectedMeshGroup.ReverseFaceEdges();
if (SelectedMeshGroupIndex != -1)
{
SelectedMeshGroup.ReverseFaceEdges();
ScaleRotateTranslate scale = SelectedMeshGroupTransform;
scale.scale *= Matrix4X4.CreateScale(1, 1, -1);
SelectedMeshGroupTransform = scale;
ScaleRotateTranslate scale = SelectedMeshGroupTransform;
scale.scale *= Matrix4X4.CreateScale(1, 1, -1);
SelectedMeshGroupTransform = scale;
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
PlatingHelper.PlaceMeshGroupOnBed(MeshGroups, MeshGroupTransforms, SelectedMeshGroupIndex, false);
saveButtons.Visible = true;
Invalidate();
saveButtons.Visible = true;
Invalidate();
}
};
buttonPanel.AddChild(buttonContainer);
buttonPanel.AddChild(generateHorizontalRule());
@ -1785,7 +1858,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
}
int nextColor = 0;
RGBA_Bytes[] SelectionColors = new RGBA_Bytes[] { new RGBA_Bytes(131, 4, 66), new RGBA_Bytes(227, 31, 61), new RGBA_Bytes(255, 148, 1), new RGBA_Bytes(247, 224, 23), new RGBA_Bytes(143, 212, 1) };
private void AddHandlers()

View file

@ -16,6 +16,8 @@
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<ReleaseVersion>1.1.4</ReleaseVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@ -27,6 +29,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@ -37,6 +40,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|AnyCPU'">
<OutputPath>bin\Release64\</OutputPath>
@ -56,6 +60,7 @@
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
@ -69,6 +74,7 @@
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@ -82,6 +88,7 @@
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
@ -94,6 +101,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|x64'">
<OutputPath>bin\x64\Release64\</OutputPath>
@ -111,6 +119,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|x64'">
<DebugSymbols>true</DebugSymbols>
@ -125,6 +134,7 @@
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

View file

@ -51,7 +51,6 @@ namespace MatterHackers.MatterControl.PrintHistory
public class PrintHistoryWidget : GuiWidget
{
TextImageButtonFactory textImageButtonFactory = new TextImageButtonFactory();
Button deleteFromLibraryButton;
CheckBox showOnlyCompletedCheckbox;
CheckBox showTimestampCheckbox;
PrintHistoryDataView historyView;

View file

@ -123,7 +123,6 @@ namespace MatterHackers.MatterControl.PrintLibrary
public SelectedListItems<LibraryRowItem> SelectedItems = new SelectedListItems<LibraryRowItem>();
int selectedIndex = -1;
int hoverIndex = -1;
int dragIndex = -1;
int Count
{

View file

@ -56,7 +56,6 @@ namespace MatterHackers.MatterControl.PrintQueue
Button removeItemButton;
Button enterEditModeButton;
Button leaveEditModeButton;
QueueRowItem queueRowItem;
Button addToQueueButton;
Button createButton;

View file

@ -2405,6 +2405,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication
ExtrusionRatio = 1;
FeedRateRatio = 1;
LinesToWriteQueue.Clear();
ClearQueuedGCode();
loadedGCode = GCodeFile.ParseGCodeString(string.Join("\n", printableGCode.ToArray()));

View file

@ -44,8 +44,6 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
TextImageButtonFactory textImageButtonFactory = new TextImageButtonFactory();
TextImageButtonFactory editButtonFactory = new TextImageButtonFactory();
Button closeButton;
Button enterEditModeButton;
Button leaveEditModeButton;
bool editMode;

View file

@ -17,6 +17,8 @@
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<ReleaseVersion>1.1.4</ReleaseVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@ -28,6 +30,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@ -37,6 +40,7 @@
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|AnyCPU'">
<OutputPath>bin\Release64\</OutputPath>
@ -55,6 +59,7 @@
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
@ -68,6 +73,7 @@
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
@ -81,6 +87,7 @@
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
@ -93,6 +100,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|x64'">
<OutputPath>bin\x64\Release64\</OutputPath>
@ -110,6 +118,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|x64'">
<DebugSymbols>true</DebugSymbols>
@ -123,6 +132,7 @@
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
@ -160,5 +170,8 @@
<ItemGroup>
<Compile Include="InfInstaller.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>

View file

@ -429,7 +429,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
this.windowController.ActivePresetLayer.settingsDictionary[addRowSettingData.SlicerConfigName] = sliceSetting;
OnSettingsChanged();
HasUncommittedChanges = true;
}
addRowSettingData = null;
PopulateAddSettingRow(-1, -1, "-1");
@ -475,7 +474,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
});
}
bool HasUncommittedChanges;
public RootedObjectEventHandler CommitStatusChanged = new RootedObjectEventHandler();
public RootedObjectEventHandler SettingsChanged = new RootedObjectEventHandler();
@ -487,7 +485,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
this.windowController.ActivePresetLayer.settingsDictionary[keyName].Value = keyValue;
OnSettingsChanged();
HasUncommittedChanges = true;
}
else
{
@ -499,7 +496,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
this.windowController.ActivePresetLayer.settingsDictionary[keyName] = sliceSetting;
OnSettingsChanged();
HasUncommittedChanges = true;
}
}
@ -927,7 +923,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
LoadSettingsRows();
}
}
catch (Exception e)
catch (Exception)
{
// Error loading configuration
}

View file

@ -207,7 +207,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
windowController.ChangeToSlicePresetList();
}
}
catch (Exception e)
catch (Exception)
{
// Error loading configuration
}

View file

@ -63,7 +63,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
public SliceSettingsWidget(SliceSettingsWidgetUiState uiState)
{
int minSettingNameWidth = 220;
int minSettingNameWidth = 190;
buttonFactory.FixedHeight = 20;
buttonFactory.fontSize = 10;
buttonFactory.normalFillColor = RGBA_Bytes.White;
@ -200,7 +200,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
}
return "Minimal";
return "Beginner";
//return "Beginner";
}
}
@ -524,6 +524,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
int intEditWidth = 60;
int doubleEditWidth = 60;
if (settingData.QuickMenuSettings.Count > 0)
{
doubleEditWidth = 35;
}
int vectorXYEditWidth = 60;
int multiLineEditHeight = 60;
@ -605,7 +609,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
if (settingData.QuickMenuSettings.Count > 0)
{
leftToRightLayout.AddChild(CreateQuickMenu(settingData, content));
leftToRightLayout.AddChild(CreateQuickMenu(settingData, content, doubleEditWidget.ActuallNumberEdit.InternalTextEditWidget));
}
else
{
@ -661,7 +665,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
if (settingData.QuickMenuSettings.Count > 0)
{
leftToRightLayout.AddChild(CreateQuickMenu(settingData, content));
leftToRightLayout.AddChild(CreateQuickMenu(settingData, content, stringEdit.ActualTextEditWidget.InternalTextEditWidget));
}
else
{
@ -930,7 +934,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
return container;
}
private GuiWidget CreateQuickMenu(OrganizerSettingsData settingData, GuiWidget content)
private GuiWidget CreateQuickMenu(OrganizerSettingsData settingData, GuiWidget content, InternalTextEditWidget internalTextWidget)
{
string sliceSettingValue = ActiveSliceSettings.Instance.GetActiveValue(settingData.SlicerConfigName);
FlowLayoutWidget totalContent = new FlowLayoutWidget();
@ -946,28 +950,44 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
if (sliceSettingValue == valueLocal)
{
selectableOptions.SelectedLabel = nameValue.MenuName;
content.Visible = false;
}
newItem.Selected += (sender, e) =>
{
SaveSetting(settingData.SlicerConfigName, valueLocal);
CallEventsOnSettingsChange(settingData);
content.Visible = false;
internalTextWidget.Text = valueLocal;
};
}
// put in the custom menu to allow direct editing
MenuItem customMenueItem = selectableOptions.AddItem("Custom");
customMenueItem.Selected += (sender, e) =>
{
content.Visible = true;
};
totalContent.AddChild(selectableOptions);
content.VAnchor = VAnchor.ParentCenter;
totalContent.AddChild(content);
internalTextWidget.EditComplete += (sender, e) =>
{
bool foundSetting = false;
foreach (QuickMenuNameValue nameValue in settingData.QuickMenuSettings)
{
string localName = nameValue.MenuName;
string newSliceSettingValue = ActiveSliceSettings.Instance.GetActiveValue(settingData.SlicerConfigName);
if (newSliceSettingValue == nameValue.Value)
{
selectableOptions.SelectedLabel = localName;
foundSetting = true;
break;
}
}
if (!foundSetting)
{
selectableOptions.SelectedLabel = "Custom";
}
};
return totalContent;
}

View file

@ -284,7 +284,7 @@
"PresentationName": "Fill Density",
"HelpText": "The ratio of material to empty space ranged 0 to 1. Zero would be no infill; 1 is solid infill.",
"DataEditType": "DOUBLE_OR_PERCENT",
"ExtraSettings": "Ratio (0 to 1)",
"ExtraSettings": "Ratio\n(0 to 1)",
"QuickMenuSettings": [{"MenuName" : "Light", "Value": "10%"},{"MenuName" : "Standard", "Value": "30%"},{"MenuName" : "Heavy", "Value": "90%"}]
},
{
@ -475,7 +475,7 @@
"HelpText": "Sets the height of each layer of the print. A smaller number will create more layers and more vertical accuracy but also a slower print.",
"DataEditType": "POSITIVE_DOUBLE",
"ExtraSettings": "mm",
"QuickMenuSettings": [{"MenuName" : "Coarse", "Value": ".3"},{"MenuName" : "Standard", "Value": ".2"},{"MenuName" : "Fine", "Value": ".1"}]
"QuickMenuSettings": [{"MenuName" : "Fine", "Value": "0.1"},{"MenuName" : "Standard", "Value": "0.2"},{"MenuName" : "Coarse", "Value": "0.3"}]
},
{
"SlicerConfigName": "max_fan_speed",