当前位置: 首页>>代码示例>>C#>>正文


C# PrintQueue.PrintItemWrapper类代码示例

本文整理汇总了C#中MatterHackers.MatterControl.PrintQueue.PrintItemWrapper的典型用法代码示例。如果您正苦于以下问题:C# PrintItemWrapper类的具体用法?C# PrintItemWrapper怎么用?C# PrintItemWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PrintItemWrapper类属于MatterHackers.MatterControl.PrintQueue命名空间,在下文中一共展示了PrintItemWrapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的MatterHackers.MatterControl.PrintQueue.PrintItemWrapper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。