Ejemplo n.º 1
0
        public PrintItem GetSTLToPrint(int index)
        {
            if (index >= 0 && index < Count)
            {
                GuiWidget            itemHolder = topToBottomItemList.Children[index];
                PrintLibraryListItem child      = (PrintLibraryListItem)itemHolder.Children[0];
                return(new PrintItem(child.printItem.Name, child.printItem.FileLocation));
            }

            return(null);
        }
Ejemplo n.º 2
0
        public ExportLibraryItemWindow(PrintLibraryListItem printLibraryItem)
            : base(400, 250)
        {
            if (System.IO.Path.GetExtension(printLibraryItem.printItem.FileLocation).ToUpper() == ".GCODE")
            {
                partIsGCode = true;
            }

            this.Title           = "MatterControl: Export File";
            this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

            // TODO: Complete member initialization
            this.printQueueItem = printLibraryItem;


            doLayout();
            PrinterCommunication.Instance.ActivePrinterChanged.RegisterEvent(reloadAfterPrinterProfileChanged, ref unregisterEvents);
        }
        public ExportLibraryItemWindow(PrintLibraryListItem printLibraryItem)
            : base(400, 250)
        {
            if (System.IO.Path.GetExtension(printLibraryItem.printItem.FileLocation).ToUpper() == ".GCODE")
            {
                partIsGCode = true;
            }

			string exportLibraryFileTitle = new LocalizedString("MatterControl").Translated;
			string exportLibraryFileTitleFull = new LocalizedString("Export File").Translated;
			this.Title = string.Format("{0}: {1}", exportLibraryFileTitle, exportLibraryFileTitleFull);
            this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

            // TODO: Complete member initialization
            this.printQueueItem = printLibraryItem;


            doLayout();
            ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent(reloadAfterPrinterProfileChanged, ref unregisterEvents);
        }
        public ExportLibraryItemWindow(PrintLibraryListItem printLibraryItem)
            : base(400, 250)
        {
            if (System.IO.Path.GetExtension(printLibraryItem.printItem.FileLocation).ToUpper() == ".GCODE")
            {
                partIsGCode = true;
            }

            string exportLibraryFileTitle     = new LocalizedString("MatterControl").Translated;
            string exportLibraryFileTitleFull = new LocalizedString("Export File").Translated;

            this.Title           = string.Format("{0}: {1}", exportLibraryFileTitle, exportLibraryFileTitleFull);
            this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;

            // TODO: Complete member initialization
            this.printQueueItem = printLibraryItem;


            doLayout();
            ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent(reloadAfterPrinterProfileChanged, ref unregisterEvents);
        }
Ejemplo n.º 5
0
        void loadFile_Click(object sender, MouseEventArgs mouseEvent)
        {
            OpenFileDialogParams openParams = new OpenFileDialogParams("Select an STL file, Select a GCODE file|*.stl;*.gcode", multiSelect: true);

            FileDialog.OpenFileDialog(ref openParams);
            if (openParams.FileNames != null)
            {
                foreach (string loadedFileName in openParams.FileNames)
                {
                    PrintItem printItem = new PrintItem();
                    printItem.Name                  = System.IO.Path.GetFileNameWithoutExtension(loadedFileName);
                    printItem.FileLocation          = System.IO.Path.GetFullPath(loadedFileName);
                    printItem.PrintItemCollectionID = PrintLibraryListControl.Instance.LibraryCollection.Id;
                    printItem.Commit();

                    PrintLibraryListItem queueItem = new PrintLibraryListItem(new PrintItemWrapper(printItem));
                    PrintLibraryListControl.Instance.AddChild(queueItem);
                }
                PrintLibraryListControl.Instance.Invalidate();
            }
            PrintLibraryListControl.Instance.SaveLibraryItems();
        }
Ejemplo n.º 6
0
        public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
        {
            foreach (string droppedFileName in fileDropEventArgs.DroppedFiles)
            {
                string extension = Path.GetExtension(droppedFileName).ToUpper();
                if (extension == ".STL" || extension == ".GCODE")
                {
                    PrintItem printItem = new PrintItem();
                    printItem.Name                  = System.IO.Path.GetFileNameWithoutExtension(droppedFileName);
                    printItem.FileLocation          = System.IO.Path.GetFullPath(droppedFileName);
                    printItem.PrintItemCollectionID = PrintLibraryListControl.Instance.LibraryCollection.Id;
                    printItem.Commit();

                    PrintLibraryListItem queueItem = new PrintLibraryListItem(new PrintItemWrapper(printItem));
                    PrintLibraryListControl.Instance.AddChild(queueItem);
                }
                PrintLibraryListControl.Instance.Invalidate();
            }
            PrintLibraryListControl.Instance.SaveLibraryItems();

            base.OnDragDrop(fileDropEventArgs);
        }
Ejemplo n.º 7
0
        void loadFile_Click(object sender, MouseEventArgs mouseEvent)
        {
            OpenFileDialogParams openParams = new OpenFileDialogParams("Select an STL file, Select a GCODE file|*.stl;*.gcode", multiSelect: true);
            FileDialog.OpenFileDialog(ref openParams);
            if (openParams.FileNames != null)
            {
                foreach (string loadedFileName in openParams.FileNames)
                {
                    PrintItem printItem = new PrintItem();
                    printItem.Name = System.IO.Path.GetFileNameWithoutExtension(loadedFileName);
                    printItem.FileLocation = System.IO.Path.GetFullPath(loadedFileName);
                    printItem.PrintItemCollectionID = PrintLibraryListControl.Instance.LibraryCollection.Id;
                    printItem.Commit();

                    PrintLibraryListItem queueItem = new PrintLibraryListItem(new PrintItemWrapper(printItem));
                    PrintLibraryListControl.Instance.AddChild(queueItem);
                }
                PrintLibraryListControl.Instance.Invalidate();
            }
            PrintLibraryListControl.Instance.SaveLibraryItems();
        }
Ejemplo n.º 8
0
        public override void OnDragDrop(FileDropEventArgs fileDropEventArgs)
        {
            foreach (string droppedFileName in fileDropEventArgs.DroppedFiles)
            {
                string extension = Path.GetExtension(droppedFileName).ToUpper();
                if (extension == ".STL" || extension == ".GCODE")
                {
                    PrintItem printItem = new PrintItem();
                    printItem.Name = System.IO.Path.GetFileNameWithoutExtension(droppedFileName);
                    printItem.FileLocation = System.IO.Path.GetFullPath(droppedFileName);
                    printItem.PrintItemCollectionID = PrintLibraryListControl.Instance.LibraryCollection.Id;
                    printItem.Commit();

                    PrintLibraryListItem queueItem = new PrintLibraryListItem(new PrintItemWrapper(printItem));
                    PrintLibraryListControl.Instance.AddChild(queueItem);
                }
                PrintLibraryListControl.Instance.Invalidate();
            }
            PrintLibraryListControl.Instance.SaveLibraryItems();

            base.OnDragDrop(fileDropEventArgs);
        }