本文整理汇总了C#中MatterHackers.MatterControl.PrintQueue.PrintItemWrapper类的典型用法代码示例。如果您正苦于以下问题:C# PrintItemWrapper类的具体用法?C# PrintItemWrapper怎么用?C# PrintItemWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PrintItemWrapper类属于MatterHackers.MatterControl.PrintQueue命名空间,在下文中一共展示了PrintItemWrapper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: PartPreviewMainWindow
public PartPreviewMainWindow(PrintItemWrapper printItem, View3DWidget.AutoRotate autoRotate3DView, View3DWidget.OpenMode openMode = View3DWidget.OpenMode.Viewing)
: base(750, 550)
{
UseOpenGL = true;
string partPreviewTitle = LocalizedString.Get("MatterControl");
Title = string.Format("{0}: ", partPreviewTitle) + Path.GetFileName(printItem.Name);
this.Name = "Part Preview Window";
partPreviewWidget = new PartPreviewContent(printItem, View3DWidget.WindowMode.StandAlone, autoRotate3DView, openMode);
partPreviewWidget.Closed += (sender, e) =>
{
Close();
};
this.AddChild(partPreviewWidget);
AddHandlers();
Width = 750;
Height = 550;
MinimumSize = new Vector2(400, 300);
ShowAsSystemWindow();
}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:25,代码来源:PartPreviewMainWindow.cs
示例2: Start
public void Start()
{
if (PrintQueueControl.Instance.Count > 0)
{
if (StartingNextPart != null)
{
StartingNextPart(this, new StringEventArgs(ItemNameBeingWorkedOn));
}
savedGCodeFileNames = new List<string>();
allFilesToExport = PrintQueueControl.Instance.CreateReadOnlyPartList();
foreach (PrintItem part in allFilesToExport)
{
PrintItemWrapper printItemWrapper = new PrintItemWrapper(part);
if (System.IO.Path.GetExtension(part.FileLocation).ToUpper() == ".STL")
{
SlicingQueue.Instance.QueuePartForSlicing(printItemWrapper);
printItemWrapper.Done += new EventHandler(sliceItem_Done);
printItemWrapper.SlicingOutputMessage += printItemWrapper_SlicingOutputMessage;
}
else if (System.IO.Path.GetExtension(part.FileLocation).ToUpper() == ".GCODE")
{
sliceItem_Done(printItemWrapper, null);
}
}
}
}
开发者ID:rubenkar,项目名称:MatterControl,代码行数:27,代码来源:ExportToSdCardProcess.cs
示例3: LibraryThumbnailWidget
public LibraryThumbnailWidget(PrintItemWrapper item, string noThumbnailFileName, string buildingThumbnailFileName, Vector2 size)
{
this.PrintItem = item;
// Set Display Attributes
this.Margin = new BorderDouble(0);
this.Padding = new BorderDouble(5);
this.Width = size.x;
this.Height = size.y;
this.MinimumSize = size;
this.BackgroundColor = normalBackgroundColor;
this.Cursor = Cursors.Hand;
// set background images
if (noThumbnailImage.Width == 0)
{
ImageBMPIO.LoadImageData(this.GetImageLocation(noThumbnailFileName), noThumbnailImage);
ImageBMPIO.LoadImageData(this.GetImageLocation(buildingThumbnailFileName), buildingThumbnailImage);
}
this.image = new ImageBuffer(buildingThumbnailImage);
// Add Handlers
this.Click += new ButtonEventHandler(onMouseClick);
this.MouseEnterBounds += new EventHandler(onEnter);
this.MouseLeaveBounds += new EventHandler(onExit);
ActiveTheme.Instance.ThemeChanged.RegisterEvent(onThemeChanged, ref unregisterEvents);
CreateThumNailThreadIfNeeded();
}
开发者ID:rubenkar,项目名称:MatterControl,代码行数:29,代码来源:PrintLibraryListItem.cs
示例4: PartPreviewMainWindow
public PartPreviewMainWindow(PrintItemWrapper printItem, View3DWidget.AutoRotate autoRotate3DView, View3DWidget.OpenMode openMode = View3DWidget.OpenMode.Viewing)
: base(690, 340)
{
UseOpenGL = true;
string partPreviewTitle = LocalizedString.Get("MatterControl");
Title = string.Format("{0}: ", partPreviewTitle) + Path.GetFileName(printItem.Name);
partPreviewWidget = new PartPreviewContent(printItem, View3DWidget.WindowMode.StandAlone, autoRotate3DView, openMode);
partPreviewWidget.Closed += (sender, e) =>
{
Close();
};
#if __ANDROID__
TerminalWidget terminalWidget = new TerminalWidget(true);
this.AddChild(new SoftKeyboardContentOffset(partPreviewWidget, SoftKeyboardContentOffset.AndroidKeyboardOffset));
//mainContainer.Closed += (sender, e) => { Close(); };
#else
this.AddChild(partPreviewWidget);
#endif
AddHandlers();
Width = 640;
Height = 480;
MinimumSize = new Vector2(400, 300);
ShowAsSystemWindow();
}
开发者ID:fuding,项目名称:MatterControl,代码行数:29,代码来源:PartPreviewMainWindow.cs
示例5: SaveToLibraryFolder2
static public void SaveToLibraryFolder2(PrintItemWrapper printItemWrapper, List<MeshGroup> meshGroups, bool AbsolutePositioned)
{
string[] metaData = { "Created By", "MatterControl" };
if (AbsolutePositioned)
{
metaData = new string[] { "Created By", "MatterControl", "BedPosition", "Absolute" };
}
if (printItemWrapper.FileLocation.Contains(ApplicationDataStorage.Instance.ApplicationLibraryDataPath))
{
MeshOutputSettings outputInfo = new MeshOutputSettings(MeshOutputSettings.OutputType.Binary, metaData);
MeshFileIo.Save(meshGroups, printItemWrapper.FileLocation, outputInfo);
}
else // save a copy to the library and update this to point at it
{
string fileName = Path.ChangeExtension(Path.GetRandomFileName(), ".amf");
printItemWrapper.FileLocation = Path.Combine(ApplicationDataStorage.Instance.ApplicationLibraryDataPath, fileName);
MeshOutputSettings outputInfo = new MeshOutputSettings(MeshOutputSettings.OutputType.Binary, metaData);
MeshFileIo.Save(meshGroups, printItemWrapper.FileLocation, outputInfo);
printItemWrapper.PrintItem.Commit();
// let the queue know that the item has changed so it load the correct part
QueueData.Instance.SaveDefaultQueue();
}
printItemWrapper.OnFileHasChanged();
}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:28,代码来源:LibrarySQLiteData.cs
示例6: PrintQueueItem
public PrintQueueItem(string displayName, string fileLocation)
{
PrintItem printItem = new PrintItem();
printItem.Name = displayName;
printItem.FileLocation = fileLocation;
this.PrintItemWrapper = new PrintItemWrapper(printItem);
ConstructPrintQueueItem();
}
开发者ID:rubenkar,项目名称:MatterControl,代码行数:8,代码来源:PrintQueueItem.cs
示例7: GcodeViewBasic
public GcodeViewBasic(PrintItemWrapper printItem, GetSizeFunction bedSizeFunction, GetSizeFunction bedCenterFunction)
{
this.printItem = printItem;
this.bedSizeFunction = bedSizeFunction;
this.bedCenterFunction = bedCenterFunction;
CreateAndAddChildren(null);
}
开发者ID:rubenkar,项目名称:MatterControl,代码行数:9,代码来源:GcodeViewBasic.cs
示例8: QueuePartForSlicing
public void QueuePartForSlicing(PrintItemWrapper itemToQueue)
{
itemToQueue.DoneSlicing = false;
string preparingToSliceModelTxt = new LocalizedString("Preparing to slice model").Translated;
string peparingToSliceModelFull = string.Format ("{0}...", preparingToSliceModelTxt);
itemToQueue.OnSlicingOutputMessage(new StringEventArgs(peparingToSliceModelFull));
using (TimedLock.Lock(listOfSlicingItems, "QueuePartForSlicing"))
{
//Add to thumbnail generation queue
listOfSlicingItems.Add(itemToQueue);
}
}
开发者ID:rubenkar,项目名称:MatterControl,代码行数:12,代码来源:SlicingQueue.cs
示例9: PartPreviewMainWindow
//PartPreview3DGcode part3DGcodeView;
public PartPreviewMainWindow(PrintItemWrapper printItem)
: base(690, 340)
{
string partPreviewTitle = new LocalizedString ("MatterControl").Translated;
Title = string.Format("{0}: ", partPreviewTitle) + Path.GetFileName(printItem.Name);
BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
TabControl tabControl = new TabControl();
tabControl.TabBar.BorderColor = new RGBA_Bytes(0, 0, 0, 0);
tabControl.TabBar.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
double buildHeight = ActiveSliceSettings.Instance.BuildHeight;
string part3DViewLblBeg = ("3D");
string part3DViewLblEnd = new LocalizedString ("View").Translated;
string part3DViewLblFull = string.Format("{0} {1} ", part3DViewLblBeg, part3DViewLblEnd);
part3DView = new View3DTransformPart(printItem, new Vector3(ActiveSliceSettings.Instance.BedSize, buildHeight), ActiveSliceSettings.Instance.BedShape);
TabPage partPreview3DView = new TabPage(part3DView, part3DViewLblFull);
partGcodeView = new GcodeViewBasic(printItem, ActiveSliceSettings.Instance.GetBedSize, ActiveSliceSettings.Instance.GetBedCenter);
TabPage layerView = new TabPage(partGcodeView, new LocalizedString("Layer View").Translated);
//part3DGcodeView = new PartPreview3DGcode(printItem.FileLocation, bedXSize, bedYSize);
tabControl.AddTab(new SimpleTextTabWidget(partPreview3DView , 16,
ActiveTheme.Instance.TabLabelSelected, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes()));
tabControl.AddTab(new SimpleTextTabWidget(layerView, 16,
ActiveTheme.Instance.TabLabelSelected, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes()));
this.AddChild(tabControl);
this.AnchorAll();
AddHandlers();
Width = 640;
Height = 480;
ShowAsSystemWindow();
MinimumSize = new Vector2(400, 300);
// We do this after showing the system window so that when we try and take fucus the parent window (the system window)
// exists and can give the fucus to its child the gecode window.
if (Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE")
{
tabControl.TabBar.SwitchToPage(layerView);
partGcodeView.Focus();
}
}
开发者ID:rubenkar,项目名称:MatterControl,代码行数:52,代码来源:PartPreviewMainWindow.cs
示例10: PartThumbnailWidget
public PartThumbnailWidget(PrintItemWrapper item, string noThumbnailFileName, string buildingThumbnailFileName, ImageSizes size)
{
ToolTipText = "Click to show in 3D View".Localize();
this.ItemWrapper = item;
// Set Display Attributes
this.Margin = new BorderDouble(0);
this.Padding = new BorderDouble(5);
Size = size;
switch (size)
{
case ImageSizes.Size50x50:
this.Width = 50 * GuiWidget.DeviceScale;
this.Height = 50 * GuiWidget.DeviceScale;
break;
case ImageSizes.Size115x115:
this.Width = 115 * GuiWidget.DeviceScale;
this.Height = 115 * GuiWidget.DeviceScale;
break;
default:
throw new NotImplementedException();
}
this.MinimumSize = new Vector2(this.Width, this.Height);
this.BackgroundColor = normalBackgroundColor;
this.Cursor = Cursors.Hand;
this.ToolTipText = "Click to show in 3D View".Localize();
// set background images
if (noThumbnailImage.Width == 0)
{
StaticData.Instance.LoadIcon(noThumbnailFileName, noThumbnailImage);
noThumbnailImage.InvertLightness();
StaticData.Instance.LoadIcon(buildingThumbnailFileName, buildingThumbnailImage);
buildingThumbnailImage.InvertLightness();
}
this.thumbnailImage = new ImageBuffer(buildingThumbnailImage);
// Add Handlers
this.Click += DoOnMouseClick;
this.MouseEnterBounds += onEnter;
this.MouseLeaveBounds += onExit;
ActiveTheme.ThemeChanged.RegisterEvent(ThemeChanged, ref unregisterEvents);
}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:46,代码来源:PartThumbnailWidget.cs
示例11: PartPreviewContent
public PartPreviewContent(PrintItemWrapper printItem, View3DWidget.WindowMode windowMode, View3DWidget.AutoRotate autoRotate3DView, View3DWidget.OpenMode openMode = View3DWidget.OpenMode.Viewing)
{
this.openMode = openMode;
this.autoRotate3DView = autoRotate3DView;
this.windowMode = windowMode;
BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
this.AnchorAll();
this.Load(printItem);
// We do this after showing the system window so that when we try and take focus of the parent window (the system window)
// it exists and can give the focus to its child the gcode window.
if (printItem != null
&& Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE")
{
SwitchToGcodeView();
}
}
开发者ID:broettge,项目名称:MatterControl,代码行数:18,代码来源:PartPreviewContent.cs
示例12: ExportPrintItemWindow
public ExportPrintItemWindow(PrintItemWrapper printItemWrapper)
: base(400, 300)
{
this.printItemWrapper = printItemWrapper;
if (Path.GetExtension(printItemWrapper.FileLocation).ToUpper() == ".GCODE")
{
partIsGCode = true;
}
string McExportFileTitleBeg = LocalizedString.Get("MatterControl");
string McExportFileTitleEnd = LocalizedString.Get("Export File");
string McExportFileTitleFull = string.Format("{0}: {1}", McExportFileTitleBeg, McExportFileTitleEnd);
this.Title = McExportFileTitleFull;
this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
CreateWindowContent();
ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent(ReloadAfterPrinterProfileChanged, ref unregisterEvents);
ActivePrinterProfile.Instance.DoPrintLevelingChanged.RegisterEvent(ReloadAfterPrinterProfileChanged, ref unregisterEvents);
}
开发者ID:fuding,项目名称:MatterControl,代码行数:20,代码来源:ExportPrintItemWindow.cs
示例13: OpenExportWindow
private void OpenExportWindow(PrintItemWrapper printItem)
{
if (exportingWindow == null)
{
exportingWindow = new ExportPrintItemWindow(printItem);
exportingWindow.Closed += new EventHandler(ExportQueueItemWindow_Closed);
exportingWindow.ShowAsSystemWindow();
}
else
{
exportingWindow.BringToFront();
}
}
开发者ID:Joao-Fonseca,项目名称:MatterControl,代码行数:13,代码来源:LibraryRowItemPart.cs
示例14: AddItem
public void AddItem(PrintItemWrapper item, int indexToInsert = -1)
{
throw new NotImplementedException();
//PrintHistoryData.Instance.AddItem(item, indexToInsert);
}
开发者ID:fitzsimk,项目名称:MatterControl,代码行数:5,代码来源:LibraryProviderHistory.cs
示例15: AddItem
public override void AddItem(PrintItemWrapper itemToAdd)
{
if (Directory.Exists(itemToAdd.FileLocation))
{
libraryCreators.Add(new LibraryProviderFileSystemCreator(itemToAdd.FileLocation, Path.GetFileName(itemToAdd.FileLocation)));
AddFolderImage("folder.png");
UiThread.RunOnIdle(() => OnDataReloaded(null));
}
}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:9,代码来源:LibraryProviderSelector.cs
示例16: DeleteCacheData
public static void DeleteCacheData()
{
if(LibraryProviderSQLite.Instance.PreloadingCalibrationFiles)
{
return;
}
// delete everything in the GCodeOutputPath
// AppData\Local\MatterControl\data\gcode
// delete everything in the temp data that is not in use
// AppData\Local\MatterControl\data\temp
// plateImages
// project-assembly
// project-extract
// stl
// delete all unreference models in Library
// AppData\Local\MatterControl\Library
// delete all old update downloads
// AppData\updates
// start cleaning out unused data
// MatterControl\data\gcode
RemoveDirectory(DataStorage.ApplicationDataStorage.Instance.GCodeOutputPath);
string userDataPath = DataStorage.ApplicationDataStorage.Instance.ApplicationUserDataPath;
RemoveDirectory(Path.Combine(userDataPath, "updates"));
HashSet<string> referencedPrintItemsFilePaths = new HashSet<string>();
HashSet<string> referencedThumbnailFiles = new HashSet<string>();
// Get a list of all the stl and amf files referenced in the queue.
foreach (PrintItemWrapper printItem in QueueData.Instance.PrintItems)
{
string fileLocation = printItem.FileLocation;
if (!referencedPrintItemsFilePaths.Contains(fileLocation))
{
referencedPrintItemsFilePaths.Add(fileLocation);
referencedThumbnailFiles.Add(PartThumbnailWidget.GetImageFileName(printItem));
}
}
// Add in all the stl and amf files referenced in the library.
foreach (PrintItem printItem in LibraryProviderSQLite.GetAllPrintItemsRecursive())
{
PrintItemWrapper printItemWrapper = new PrintItemWrapper(printItem);
string fileLocation = printItem.FileLocation;
if (!referencedPrintItemsFilePaths.Contains(fileLocation))
{
referencedPrintItemsFilePaths.Add(fileLocation);
referencedThumbnailFiles.Add(PartThumbnailWidget.GetImageFileName(printItemWrapper));
}
}
// If the count is less than 0 then we have never run and we need to populate the library and queue still. So don't delete anything yet.
if (referencedPrintItemsFilePaths.Count > 0)
{
CleanDirectory(userDataPath, referencedPrintItemsFilePaths, referencedThumbnailFiles);
}
}
开发者ID:ddpruitt,项目名称:MatterControl,代码行数:58,代码来源:AboutWidget.cs
示例17: ClearBedAndLoadPrintItemWrapper
private void ClearBedAndLoadPrintItemWrapper(PrintItemWrapper printItemWrapper)
{
SwitchStateToNotEditing();
MeshGroups.Clear();
MeshGroupExtraData.Clear();
MeshGroupTransforms.Clear();
if (printItemWrapper != null)
{
// remove it first to make sure we don't double add it
printItemWrapper.FileHasChanged -= ReloadMeshIfChangeExternaly;
printItemWrapper.FileHasChanged += ReloadMeshIfChangeExternaly;
// don't load the mesh until we get all the rest of the interface built
meshViewerWidget.LoadDone += new EventHandler(meshViewerWidget_LoadDone);
Vector2 bedCenter = new Vector2();
MeshViewerWidget.CenterPartAfterLoad doCentering = MeshViewerWidget.CenterPartAfterLoad.DONT;
if(ActiveSliceSettings.Instance != null
&& ActiveSliceSettings.Instance.CenterOnBed())
{
doCentering = MeshViewerWidget.CenterPartAfterLoad.DO;
bedCenter = ActiveSliceSettings.Instance.BedCenter;
}
meshViewerWidget.LoadMesh(printItemWrapper.FileLocation, doCentering, bedCenter);
}
partHasBeenEdited = false;
}
开发者ID:gobrien4418,项目名称:MatterControl,代码行数:31,代码来源:View3DWidget.cs
示例18: AddItem
public override void AddItem(PrintItemWrapper itemToAdd)
{
QueueData.Instance.AddItem(itemToAdd);
}
开发者ID:sizanjavad,项目名称:MatterControl,代码行数:4,代码来源:LibraryProviderQueue.cs
示例19: RemoveItem
public void RemoveItem(PrintItemWrapper printItemWrapper)
{
int index = PrintItems.IndexOf(printItemWrapper);
if (index < 0)
{
// It may be possible to have the same item in the remove list twice.
// so if it is not in the PrintItems then ignore it.
return;
}
PrintItems.RemoveAt(index);
// and remove it from the data base
printItemWrapper.Delete();
}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:14,代码来源:LibrarySQLiteData.cs
示例20: AddItem
public void AddItem(PrintItemWrapper item, int indexToInsert = -1)
{
if (indexToInsert == -1)
{
indexToInsert = PrintItems.Count;
}
PrintItems.Insert(indexToInsert, item);
// Check if the collection we are adding to is the the currently visible collection.
List<ProviderLocatorNode> currentDisplayedCollection = LibraryProviderSQLite.Instance.GetProviderLocator();
if (currentDisplayedCollection.Count > 0 && currentDisplayedCollection[1].Key == LibraryProviderSQLite.StaticProviderKey)
{
//OnItemAdded(new IndexArgs(indexToInsert));
}
item.PrintItem.PrintItemCollectionID = RootLibraryCollection.Id;
item.PrintItem.Commit();
}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:16,代码来源:LibrarySQLiteData.cs
注:本文中的MatterHackers.MatterControl.PrintQueue.PrintItemWrapper类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论