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

            return(null);
        }
Beispiel #2
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 = ToolsListControl.Instance.LibraryCollection.Id;
                    printItem.Commit();

                    ToolsListItem queueItem = new ToolsListItem(new PrintItemWrapper(printItem));
                    ToolsListControl.Instance.AddChild(queueItem);
                }
                ToolsListControl.Instance.Invalidate();
            }
            ToolsListControl.Instance.SaveLibraryItems();
        }
Beispiel #3
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 = ToolsListControl.Instance.LibraryCollection.Id;
                    printItem.Commit();

                    ToolsListItem queueItem = new ToolsListItem(new PrintItemWrapper(printItem));
                    ToolsListControl.Instance.AddChild(queueItem);
                }
                ToolsListControl.Instance.Invalidate();
            }
            ToolsListControl.Instance.SaveLibraryItems();

            base.OnDragDrop(fileDropEventArgs);
        }
Beispiel #4
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 = ToolsListControl.Instance.LibraryCollection.Id;
                    printItem.Commit();

                    ToolsListItem queueItem = new ToolsListItem(new PrintItemWrapper(printItem));
                    ToolsListControl.Instance.AddChild(queueItem);
                }
                ToolsListControl.Instance.Invalidate();
            }
            ToolsListControl.Instance.SaveLibraryItems();
        }
Beispiel #5
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 = ToolsListControl.Instance.LibraryCollection.Id;
                    printItem.Commit();

                    ToolsListItem queueItem = new ToolsListItem(new PrintItemWrapper(printItem));
                    ToolsListControl.Instance.AddChild(queueItem);
                }
                ToolsListControl.Instance.Invalidate();
            }
            ToolsListControl.Instance.SaveLibraryItems();

            base.OnDragDrop(fileDropEventArgs);
        }