Merge pull request #2920 from larsbrubaker/design_tools

Design tools
This commit is contained in:
Lars Brubaker 2018-01-19 17:26:39 -08:00 committed by GitHub
commit b0c6338cd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 51 additions and 46 deletions

View file

@ -968,6 +968,48 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
}
public override void OnMouseMove(MouseEventArgs mouseEvent)
{
// File system Drop validation
mouseEvent.AcceptDrop = this.AllowDragDrop()
&& mouseEvent.DragFiles?.Count > 0
&& mouseEvent.DragFiles.TrueForAll(filePath => ApplicationController.Instance.IsLoadableFile(filePath));
// View3DWidgets Filesystem DropDrop handler
if (mouseEvent.AcceptDrop
&& this.PositionWithinLocalBounds(mouseEvent.X, mouseEvent.Y))
{
if (this.DragOperationActive)
{
DragOver(screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position));
}
else
{
// Project DragFiles to IEnumerable<FileSystemFileItem>
this.StartDragDrop(
mouseEvent.DragFiles.Select(path => new FileSystemFileItem(path)),
screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position),
trackSourceFiles: true);
}
}
if (CurrentSelectInfo.DownOnPart && this.TrackballTumbleWidget.TransformState == TrackBallController.MouseDownType.None)
{
DragSelectedObject(new Vector2(mouseEvent.X, mouseEvent.Y));
}
if (DragSelectionInProgress)
{
DragSelectionEndPosition = mouseEvent.Position - OffsetToMeshViewerWidget();
DragSelectionEndPosition = new Vector2(
Math.Max(Math.Min(DragSelectionEndPosition.X, meshViewerWidget.LocalBounds.Right), meshViewerWidget.LocalBounds.Left),
Math.Max(Math.Min(DragSelectionEndPosition.Y, meshViewerWidget.LocalBounds.Top), meshViewerWidget.LocalBounds.Bottom));
Invalidate();
}
base.OnMouseMove(mouseEvent);
}
public IntersectInfo GetIntersectPosition(Vector2 screenSpacePosition)
{
//Vector2 meshViewerWidgetScreenPosition = meshViewerWidget.TransformFromParentSpace(this, new Vector2(mouseEvent.X, mouseEvent.Y));
@ -1058,48 +1100,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
}
public override void OnMouseMove(MouseEventArgs mouseEvent)
{
// File system Drop validation
mouseEvent.AcceptDrop = this.AllowDragDrop()
&& mouseEvent.DragFiles?.Count > 0
&& mouseEvent.DragFiles.TrueForAll(filePath => ApplicationController.Instance.IsLoadableFile(filePath));
// View3DWidgets Filesystem DropDrop handler
if (mouseEvent.AcceptDrop
&& this.PositionWithinLocalBounds(mouseEvent.X, mouseEvent.Y))
{
if (this.DragOperationActive)
{
DragOver(screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position));
}
else
{
// Project DragFiles to IEnumerable<FileSystemFileItem>
this.StartDragDrop(
mouseEvent.DragFiles.Select(path => new FileSystemFileItem(path)),
screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position),
trackSourceFiles: true);
}
}
if (CurrentSelectInfo.DownOnPart && this.TrackballTumbleWidget.TransformState == TrackBallController.MouseDownType.None)
{
DragSelectedObject(new Vector2(mouseEvent.X, mouseEvent.Y));
}
if (DragSelectionInProgress)
{
DragSelectionEndPosition = mouseEvent.Position - OffsetToMeshViewerWidget();
DragSelectionEndPosition = new Vector2(
Math.Max(Math.Min(DragSelectionEndPosition.X, meshViewerWidget.LocalBounds.Right), meshViewerWidget.LocalBounds.Left),
Math.Max(Math.Min(DragSelectionEndPosition.Y, meshViewerWidget.LocalBounds.Top), meshViewerWidget.LocalBounds.Bottom));
Invalidate();
}
base.OnMouseMove(mouseEvent);
}
Vector2 OffsetToMeshViewerWidget()
{
List<GuiWidget> parents = new List<GuiWidget>();

View file

@ -90,6 +90,8 @@ namespace MatterHackers.MatterControl
// We make a local variable to create a closure around it to ensure we get the correct instance
var localMacroReference = macro;
var oldColor = linkButtonFactory.textColor;
linkButtonFactory.textColor = Color.Black;
Button editLink = linkButtonFactory.Generate("edit".Localize());
editLink.Margin = new BorderDouble(right: 5);
editLink.Click += (s, e) =>
@ -106,6 +108,7 @@ namespace MatterHackers.MatterControl
this.RebuildList(printerSettings, linkButtonFactory);
};
macroRow.AddChild(removeLink);
linkButtonFactory.textColor = oldColor;
contentRow.AddChild(macroRow);
}

View file

@ -198,11 +198,11 @@ Printer
Material Loading
Loading
load_filament_length
unload_filament_length
load_filament_speed
trim_image
insert_image
running_clean_image
unload_filament_length
G-Code
G-Code
G-Code

View file

@ -44,8 +44,8 @@
},
{
"SlicerConfigName": "load_filament_speed",
"PresentationName": "Load Filament Speed",
"HelpText": "The speed to run filament into the printer when loading.",
"PresentationName": "Filament Speed",
"HelpText": "The speed to run filament into and out of the printer.",
"DataEditType": "POSITIVE_DOUBLE",
"Units": "mm/s",
"ShowIfSet": "!sla_printer",

View file

@ -1,5 +1,6 @@
; host.choose_material(title:"Choose the material that you are loading.")
M106 S0 ; turn off the fan
M104 S[temperature] ; start heating up the extruder
; host.show_message(title:"Trim the end of the filament to ensure a good load.", image:"[trim_image]", wait_ok:"true")

View file

@ -1,6 +1,7 @@
; host.choose_material(title:"Confirm the material you are unloading.")
; host.show_message(title:"Waiting for extruder to heat to [temperature], before unloading.")
M106 S0 ; turn off the fan
G4 S1 ; wait message to display
M109 S[temperature] ; heat up the extruder

@ -1 +1 @@
Subproject commit 9b89cd664f4d642229459fa9e86d6c8aa201e5d4
Subproject commit 7fd54159b5795c89203a516fe551347f5708a831