Put in bread crumbs for PrintItem to tell where it came from.
CodeMaid
This commit is contained in:
parent
c0d2d60c6f
commit
77c5c3dfb2
9 changed files with 239 additions and 115 deletions
|
|
@ -199,6 +199,8 @@ namespace MatterHackers.MatterControl.DataStorage
|
|||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string LibraryProviderBreadCrumbs { get; set; }
|
||||
|
||||
public string FileLocation { get; set; }
|
||||
|
||||
public DateTime DateAdded { get; set; }
|
||||
|
|
@ -210,10 +212,11 @@ namespace MatterHackers.MatterControl.DataStorage
|
|||
{
|
||||
}
|
||||
|
||||
public PrintItem(string name, string fileLocation)
|
||||
public PrintItem(string name, string fileLocation, string libraryProviderBreadCrumbs = "")
|
||||
{
|
||||
this.Name = name;
|
||||
this.FileLocation = fileLocation;
|
||||
this.LibraryProviderBreadCrumbs = libraryProviderBreadCrumbs;
|
||||
|
||||
DateAdded = DateTime.Now;
|
||||
PrintCount = 0;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ using MatterHackers.MatterControl.CustomWidgets;
|
|||
using MatterHackers.MatterControl.DataStorage;
|
||||
using MatterHackers.MatterControl.PrinterCommunication;
|
||||
using MatterHackers.MatterControl.PrintLibrary;
|
||||
using MatterHackers.MatterControl.PrintLibrary.Provider;
|
||||
using MatterHackers.MatterControl.PrintQueue;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.MeshVisualizer;
|
||||
|
|
@ -1871,6 +1872,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
}
|
||||
|
||||
saveSucceded = true;
|
||||
//LibraryProvider.Instance.SaveToCollection(printItemWrapper.PrintItem.LibraryProviderBreadCrumbs
|
||||
LibrarySQLiteData.SaveToLibraryFolder(printItemWrapper, asynchMeshGroups, true);
|
||||
}
|
||||
catch (System.UnauthorizedAccessException)
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ either expressed or implied, of the FreeBSD Project.
|
|||
*/
|
||||
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.MatterControl.PrintLibrary.Provider;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.MatterControl.DataStorage;
|
||||
using MatterHackers.MatterControl.PrintLibrary.Provider;
|
||||
using MatterHackers.MatterControl.PrintQueue;
|
||||
using MatterHackers.VectorMath;
|
||||
using System;
|
||||
using MatterHackers.MatterControl.DataStorage;
|
||||
|
||||
namespace MatterHackers.MatterControl.PrintLibrary
|
||||
{
|
||||
|
|
@ -232,7 +232,6 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
AddAllItems();
|
||||
}
|
||||
|
||||
|
||||
public override void OnClosed(EventArgs e)
|
||||
{
|
||||
if (unregisterEvents != null)
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ using MatterHackers.VectorMath;
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace MatterHackers.MatterControl.PrintLibrary
|
||||
{
|
||||
|
|
@ -46,6 +47,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
private TextImageButtonFactory textImageButtonFactory = new TextImageButtonFactory();
|
||||
private TextImageButtonFactory editButtonFactory = new TextImageButtonFactory();
|
||||
private TextWidget navigationLabel;
|
||||
private TextWidget breadCrumbDisplay;
|
||||
|
||||
private FlowLayoutWidget itemOperationButtons;
|
||||
private List<bool> editOperationMultiCapable = new List<bool>();
|
||||
|
|
@ -150,8 +152,12 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
|
||||
CreateEditBarButtons();
|
||||
|
||||
breadCrumbDisplay = new TextWidget("");
|
||||
breadCrumbDisplay.AutoExpandBoundsToText = true;
|
||||
|
||||
//allControls.AddChild(navigationPanel);
|
||||
allControls.AddChild(searchPanel);
|
||||
allControls.AddChild(breadCrumbDisplay);
|
||||
allControls.AddChild(itemOperationButtons);
|
||||
libraryDataView = new LibraryDataView();
|
||||
allControls.AddChild(libraryDataView);
|
||||
|
|
@ -200,10 +206,47 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
editButtonFactory.FixedWidth = oldWidth;
|
||||
}
|
||||
|
||||
private event EventHandler unregisterEvents;
|
||||
private void AddHandlers()
|
||||
{
|
||||
libraryDataView.SelectedItems.OnAdd += onLibraryItemsSelected;
|
||||
libraryDataView.SelectedItems.OnRemove += onLibraryItemsSelected;
|
||||
LibraryProvider.CollectionChanged.RegisterEvent(CollectionChanged, ref unregisterEvents);
|
||||
}
|
||||
|
||||
private void CollectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
string breadCrumbs = LibraryProvider.Instance.GetBreadCrumbs();
|
||||
StringBuilder path = new StringBuilder();
|
||||
string[] splitOnBar = breadCrumbs.Split('|');
|
||||
if (splitOnBar.Length > 1)
|
||||
{
|
||||
bool first = true;
|
||||
foreach (string split in splitOnBar)
|
||||
{
|
||||
if (!first)
|
||||
{
|
||||
path.Append("->");
|
||||
}
|
||||
string[] splitOnComma = split.Split(',');
|
||||
if (splitOnComma.Length > 1
|
||||
&& splitOnComma[1] != "..")
|
||||
{
|
||||
path.Append(splitOnComma[1]);
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
breadCrumbDisplay.Text = path.ToString();
|
||||
}
|
||||
|
||||
public override void OnClosed(EventArgs e)
|
||||
{
|
||||
if (unregisterEvents != null)
|
||||
{
|
||||
unregisterEvents(this, null);
|
||||
}
|
||||
base.OnClosed(e);
|
||||
}
|
||||
|
||||
private void searchInputKeyUp(object sender, KeyEventArgs keyEvent)
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
{
|
||||
public abstract class LibraryProvider
|
||||
{
|
||||
public static RootedObjectEventHandler CollectionChanged = new RootedObjectEventHandler();
|
||||
public static RootedObjectEventHandler DataReloaded = new RootedObjectEventHandler();
|
||||
public static RootedObjectEventHandler ItemAdded = new RootedObjectEventHandler();
|
||||
public static RootedObjectEventHandler ItemRemoved = new RootedObjectEventHandler();
|
||||
|
|
@ -50,7 +51,6 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
{
|
||||
if (instance == null)
|
||||
{
|
||||
//instance = new LibraryProviderSQLite(null);
|
||||
instance = new LibraryProviderSelector();
|
||||
}
|
||||
|
||||
|
|
@ -60,22 +60,25 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
|
||||
#region Abstract Methods
|
||||
|
||||
public abstract bool HasParent { get; }
|
||||
|
||||
public abstract string ProviderTypeKey { get; }
|
||||
|
||||
public abstract string Name { get; }
|
||||
|
||||
public abstract int CollectionCount { get; }
|
||||
|
||||
public abstract bool HasParent { get; }
|
||||
|
||||
public abstract int ItemCount { get; }
|
||||
|
||||
public abstract string KeywordFilter { get; set; }
|
||||
|
||||
public abstract string Name { get; }
|
||||
|
||||
public abstract string ProviderKey { get; }
|
||||
|
||||
public abstract void AddCollectionToLibrary(string collectionName);
|
||||
|
||||
public abstract void AddFilesToLibrary(IList<string> files, ReportProgressRatio reportProgress = null, RunWorkerCompletedEventHandler callback = null);
|
||||
|
||||
// A key,value list that threads into the current collection looks like "key0,displayName0|key1,displayName1|key2,displayName2|...|keyN,displayNameN".
|
||||
public abstract string GetBreadCrumbs();
|
||||
|
||||
public abstract PrintItemCollection GetCollectionItem(int collectionIndex);
|
||||
|
||||
public abstract PrintItemCollection GetParentCollectionItem();
|
||||
|
|
@ -107,11 +110,6 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
ItemRemoved.CallEvents(Instance, eventArgs);
|
||||
}
|
||||
|
||||
public static void SetCurrent(LibraryProvider current)
|
||||
{
|
||||
LibraryProvider.instance = current;
|
||||
}
|
||||
|
||||
#endregion Static Methods
|
||||
}
|
||||
}
|
||||
|
|
@ -49,8 +49,9 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
private string parentKey = null;
|
||||
private string rootPath;
|
||||
|
||||
public LibraryProviderFileSystem(string rootPath, string description)
|
||||
public LibraryProviderFileSystem(string rootPath, string description, string parentKeyKey)
|
||||
{
|
||||
this.parentKey = parentKeyKey;
|
||||
this.description = description;
|
||||
this.rootPath = rootPath;
|
||||
|
||||
|
|
@ -59,17 +60,6 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
GetFilesInCurrentDirectory();
|
||||
}
|
||||
|
||||
public LibraryProviderFileSystem(PrintItemCollection collectionBase, string description, string parentKey)
|
||||
{
|
||||
this.parentKey = parentKey;
|
||||
this.description = description;
|
||||
this.rootPath = collectionBase.Key;
|
||||
key = keyCount.ToString();
|
||||
keyCount++;
|
||||
|
||||
GetFilesInCurrentDirectory();
|
||||
}
|
||||
|
||||
public override int CollectionCount
|
||||
{
|
||||
get
|
||||
|
|
@ -99,14 +89,6 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
}
|
||||
}
|
||||
|
||||
public override string ProviderTypeKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return "LibraryProvider_" + key.ToString() + "_Key";
|
||||
}
|
||||
}
|
||||
|
||||
public override string KeywordFilter
|
||||
{
|
||||
get
|
||||
|
|
@ -127,6 +109,14 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
|
||||
public override string Name { get { return description; } }
|
||||
|
||||
public override string ProviderKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return "FileSystem_" + key.ToString() + "_Key";
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddCollectionToLibrary(string collectionName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
@ -137,6 +127,35 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override string GetBreadCrumbs()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
// append all of the collection keys with names
|
||||
string addDirectory = currentDirectory;
|
||||
List<string> collectionKeys = new List<string>();
|
||||
while (addDirectory != ".")
|
||||
{
|
||||
collectionKeys.Add(addDirectory);
|
||||
addDirectory = Path.GetDirectoryName(addDirectory);
|
||||
}
|
||||
|
||||
string total = "";
|
||||
bool first = true;
|
||||
for(int i = collectionKeys.Count-1; i>=0; i--)
|
||||
{
|
||||
string key = collectionKeys[i];
|
||||
if (!first)
|
||||
{
|
||||
total += "|";
|
||||
}
|
||||
total += key + "," + Path.GetFileName(key);
|
||||
first = false;
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public override PrintItemCollection GetCollectionItem(int collectionIndex)
|
||||
{
|
||||
string directoryName = currentDirectoryDirectories[collectionIndex];
|
||||
|
|
@ -166,7 +185,8 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
public override PrintItemWrapper GetPrintItemWrapper(int itemIndex)
|
||||
{
|
||||
string fileName = currentDirectoryFiles[itemIndex];
|
||||
return new PrintItemWrapper(new DataStorage.PrintItem(Path.GetFileNameWithoutExtension(fileName), fileName));
|
||||
string breadCrumbs = LibraryProvider.Instance.GetBreadCrumbs();
|
||||
return new PrintItemWrapper(new DataStorage.PrintItem(Path.GetFileNameWithoutExtension(fileName), fileName, breadCrumbs));
|
||||
}
|
||||
|
||||
public override void RemoveCollection(string collectionName)
|
||||
|
|
@ -200,7 +220,8 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
if (keywordFilter.Trim() == string.Empty
|
||||
|| Path.GetFileNameWithoutExtension(directoryName).Contains(keywordFilter))
|
||||
{
|
||||
currentDirectoryDirectories.Add(directoryName);
|
||||
string subPath = directoryName.Substring(rootPath.Length + 1);
|
||||
currentDirectoryDirectories.Add(subPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,37 +34,41 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
||||
{
|
||||
public class LibraryProviderSelector : LibraryProvider
|
||||
{
|
||||
private List<LibraryProvider> libraryProviders = new List<LibraryProvider>();
|
||||
int selectedLibraryProvider = -1;
|
||||
private int selectedLibraryProvider = -1;
|
||||
|
||||
public LibraryProviderSelector()
|
||||
{
|
||||
// put in the sqlite provider
|
||||
LibraryProviderSQLite localStore = new LibraryProviderSQLite(this.ProviderTypeKey);
|
||||
LibraryProviderSQLite localStore = new LibraryProviderSQLite(this.ProviderKey);
|
||||
libraryProviders.Add(localStore);
|
||||
|
||||
// and any directory providers (sd card provider, etc...)
|
||||
PrintItemCollection downloadsCollection = new PrintItemCollection("Downloads", Path.Combine("C:\\", "Users", "LarsBrubaker", "Downloads"));
|
||||
//libraryProviders.Add(new LibraryProviderFileSystem(downloadsCollection, "Downloads", this.ProviderTypeKey));
|
||||
libraryProviders.Add(new LibraryProviderFileSystem(Path.Combine("C:\\", "Users", "LarsBrubaker", "Downloads"), "Downloads", this.ProviderKey));
|
||||
|
||||
PrintItemCollection libraryCollection = new PrintItemCollection("Library Folder1", Path.Combine("C:\\", "Users", "LarsBrubaker", "AppData", "Local", "MatterControl", "Library"));
|
||||
//libraryProviders.Add(new LibraryProviderFileSystem(libraryCollection, "Library Folder2", this.ProviderTypeKey));
|
||||
//libraryProviders.Add(new LibraryProviderFileSystem(libraryCollection, "Library Folder2", this.ProviderKey));
|
||||
|
||||
// Check for LibraryProvider factories and put them in the list too.
|
||||
PluginFinder<LibraryProviderFactory> libraryFactories = new PluginFinder<LibraryProviderFactory>();
|
||||
foreach (LibraryProviderFactory factory in libraryFactories.Plugins)
|
||||
{
|
||||
libraryProviders.Add(factory.CreateProvider(this.ProviderTypeKey));
|
||||
libraryProviders.Add(factory.CreateProvider(this.ProviderKey));
|
||||
}
|
||||
|
||||
breadCrumbStack.Add(new PrintItemCollection("..", ProviderKey));
|
||||
}
|
||||
|
||||
#region Overriden Abstract Methods
|
||||
|
||||
private List<PrintItemCollection> breadCrumbStack = new List<PrintItemCollection>();
|
||||
|
||||
public override int CollectionCount
|
||||
{
|
||||
get
|
||||
|
|
@ -80,6 +84,21 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
}
|
||||
}
|
||||
|
||||
public override bool HasParent
|
||||
{
|
||||
get
|
||||
{
|
||||
if (selectedLibraryProvider == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return libraryProviders[selectedLibraryProvider].HasParent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override int ItemCount
|
||||
{
|
||||
get
|
||||
|
|
@ -121,6 +140,22 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
}
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Never visible";
|
||||
}
|
||||
}
|
||||
|
||||
public override string ProviderKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return "ProviderSelectorKey";
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddCollectionToLibrary(string collectionName)
|
||||
{
|
||||
if (selectedLibraryProvider == -1)
|
||||
|
|
@ -145,12 +180,42 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
}
|
||||
}
|
||||
|
||||
// A key,value list that threads into the current collection loos like "key0,displayName0|key1,displayName1|key2,displayName2|...|keyN,displayNameN".
|
||||
public override string GetBreadCrumbs()
|
||||
{
|
||||
if (selectedLibraryProvider == -1)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
StringBuilder breadCrumbString = new StringBuilder();
|
||||
bool first = true;
|
||||
|
||||
for(int i=0; i<breadCrumbStack.Count; i++)
|
||||
{
|
||||
PrintItemCollection collection = breadCrumbStack[i];
|
||||
if (first)
|
||||
{
|
||||
breadCrumbString.Append("{0},{1}".FormatWith(collection.Key, collection.Name));
|
||||
first = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
breadCrumbString.Append("|{0},{1}".FormatWith(collection.Key, collection.Name));
|
||||
}
|
||||
}
|
||||
|
||||
return breadCrumbString.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public override PrintItemCollection GetCollectionItem(int collectionIndex)
|
||||
{
|
||||
if (selectedLibraryProvider == -1)
|
||||
{
|
||||
LibraryProvider provider = libraryProviders[collectionIndex];
|
||||
return new PrintItemCollection(provider.Name, provider.ProviderTypeKey);
|
||||
return new PrintItemCollection(provider.Name, provider.ProviderKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -158,22 +223,6 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
}
|
||||
}
|
||||
|
||||
public override string ProviderTypeKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return "LibraryProviderSelectorKey";
|
||||
}
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Never visible";
|
||||
}
|
||||
}
|
||||
|
||||
public override PrintItemCollection GetParentCollectionItem()
|
||||
{
|
||||
if (selectedLibraryProvider == -1)
|
||||
|
|
@ -198,21 +247,6 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
}
|
||||
}
|
||||
|
||||
public override bool HasParent
|
||||
{
|
||||
get
|
||||
{
|
||||
if (selectedLibraryProvider == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return libraryProviders[selectedLibraryProvider].HasParent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void RemoveCollection(string collectionName)
|
||||
{
|
||||
if (selectedLibraryProvider == -1)
|
||||
|
|
@ -239,27 +273,46 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
|
||||
public override void SetCollectionBase(PrintItemCollection collectionBase)
|
||||
{
|
||||
if (collectionBase.Key == this.ProviderTypeKey)
|
||||
// This logic may need to be move legitamately into the virtual functions of the providers rather than all
|
||||
// gathered up here. If you find that this is not working the way you want ask me. LBB
|
||||
if ((breadCrumbStack.Count > 2
|
||||
&& collectionBase.Key == breadCrumbStack[breadCrumbStack.Count - 2].Key)
|
||||
|| (breadCrumbStack.Count > 1
|
||||
&& selectedLibraryProvider != -1
|
||||
&& collectionBase.Key == libraryProviders[selectedLibraryProvider].GetParentCollectionItem().Key)
|
||||
)
|
||||
{
|
||||
selectedLibraryProvider = -1;
|
||||
return;
|
||||
breadCrumbStack.RemoveAt(breadCrumbStack.Count-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
breadCrumbStack.Add(collectionBase);
|
||||
}
|
||||
|
||||
bool wasSet = false;
|
||||
for (int i = 0; i < libraryProviders.Count; i++)
|
||||
if (collectionBase.Key == this.ProviderKey)
|
||||
{
|
||||
if (libraryProviders[i].ProviderTypeKey == collectionBase.Key)
|
||||
selectedLibraryProvider = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool wasSet = false;
|
||||
for (int i = 0; i < libraryProviders.Count; i++)
|
||||
{
|
||||
selectedLibraryProvider = i;
|
||||
wasSet = true;
|
||||
break;
|
||||
if (libraryProviders[i].ProviderKey == collectionBase.Key)
|
||||
{
|
||||
selectedLibraryProvider = i;
|
||||
wasSet = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!wasSet)
|
||||
{
|
||||
libraryProviders[selectedLibraryProvider].SetCollectionBase(collectionBase);
|
||||
}
|
||||
}
|
||||
|
||||
if (!wasSet)
|
||||
{
|
||||
libraryProviders[selectedLibraryProvider].SetCollectionBase(collectionBase);
|
||||
}
|
||||
CollectionChanged.CallEvents(this, null);
|
||||
}
|
||||
|
||||
#endregion Overriden Abstract Methods
|
||||
|
|
|
|||
|
|
@ -74,14 +74,6 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
}
|
||||
}
|
||||
|
||||
public override string ProviderTypeKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return "LibraryProviderSqliteKey";
|
||||
}
|
||||
}
|
||||
|
||||
public override string KeywordFilter
|
||||
{
|
||||
get
|
||||
|
|
@ -103,6 +95,14 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
}
|
||||
}
|
||||
|
||||
public override string ProviderKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return "LibraryProviderSqliteKey";
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddCollectionToLibrary(string collectionName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
@ -113,6 +113,11 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
LibrarySQLiteData.Instance.LoadFilesIntoLibrary(files, reportProgress, callback);
|
||||
}
|
||||
|
||||
public override string GetBreadCrumbs()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override PrintItemCollection GetCollectionItem(int collectionIndex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
|
|||
|
|
@ -192,16 +192,16 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
|
||||
// Start heating all the extruder that we are going to use.
|
||||
for (int extruderIndex = 0; extruderIndex < numberOfHeatedExtruders; extruderIndex++)
|
||||
for (int extruderIndex0Based = 0; extruderIndex0Based < numberOfHeatedExtruders; extruderIndex0Based++)
|
||||
{
|
||||
if (extrudersUsed.Count > extruderIndex
|
||||
&& extrudersUsed[extruderIndex])
|
||||
if (extrudersUsed.Count > extruderIndex0Based
|
||||
&& extrudersUsed[extruderIndex0Based])
|
||||
{
|
||||
string materialTemperature = ActiveSliceSettings.Instance.GetMaterialValue("temperature", extruderIndex);
|
||||
string materialTemperature = ActiveSliceSettings.Instance.GetMaterialValue("temperature", extruderIndex0Based + 1);
|
||||
if (materialTemperature != "0")
|
||||
{
|
||||
string setTempString = "M104 T{0} S{1}".FormatWith(extruderIndex, materialTemperature);
|
||||
AddDefaultIfNotPresent(preStartGCode, setTempString, preStartGCodeLines, string.Format("start heating extruder {0}", extruderIndex));
|
||||
string setTempString = "M104 T{0} S{1}".FormatWith(extruderIndex0Based, materialTemperature);
|
||||
AddDefaultIfNotPresent(preStartGCode, setTempString, preStartGCodeLines, string.Format("start heating extruder {0}", extruderIndex0Based + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -209,16 +209,16 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
// If we need to wait for the heaters to heat up before homing then set them to M109 (heat and wait).
|
||||
if (ActiveSliceSettings.Instance.GetActiveValue("heat_extruder_before_homing") == "1")
|
||||
{
|
||||
for (int extruderIndex = 0; extruderIndex < numberOfHeatedExtruders; extruderIndex++)
|
||||
for (int extruderIndex0Based = 0; extruderIndex0Based < numberOfHeatedExtruders; extruderIndex0Based++)
|
||||
{
|
||||
if (extrudersUsed.Count > extruderIndex
|
||||
&& extrudersUsed[extruderIndex])
|
||||
if (extrudersUsed.Count > extruderIndex0Based
|
||||
&& extrudersUsed[extruderIndex0Based])
|
||||
{
|
||||
string materialTemperature = ActiveSliceSettings.Instance.GetMaterialValue("temperature", extruderIndex);
|
||||
string materialTemperature = ActiveSliceSettings.Instance.GetMaterialValue("temperature", extruderIndex0Based + 1);
|
||||
if (materialTemperature != "0")
|
||||
{
|
||||
string setTempString = "M109 T{0} S{1}".FormatWith(extruderIndex, materialTemperature);
|
||||
AddDefaultIfNotPresent(preStartGCode, setTempString, preStartGCodeLines, string.Format("wait for extruder {0}", extruderIndex));
|
||||
string setTempString = "M109 T{0} S{1}".FormatWith(extruderIndex0Based, materialTemperature);
|
||||
AddDefaultIfNotPresent(preStartGCode, setTempString, preStartGCodeLines, string.Format("wait for extruder {0}", extruderIndex0Based));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -261,16 +261,16 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
// don't set the extrudes to heating if we alread waited for them to reach temp
|
||||
if (ActiveSliceSettings.Instance.GetActiveValue("heat_extruder_before_homing") != "1")
|
||||
{
|
||||
for (int extruderIndex = 0; extruderIndex < numberOfHeatedExtruders; extruderIndex++)
|
||||
for (int extruderIndex0Based = 0; extruderIndex0Based < numberOfHeatedExtruders; extruderIndex0Based++)
|
||||
{
|
||||
if (extrudersUsed.Count > extruderIndex
|
||||
&& extrudersUsed[extruderIndex])
|
||||
if (extrudersUsed.Count > extruderIndex0Based
|
||||
&& extrudersUsed[extruderIndex0Based])
|
||||
{
|
||||
string materialTemperature = ActiveSliceSettings.Instance.GetMaterialValue("temperature", extruderIndex + 1);
|
||||
string materialTemperature = ActiveSliceSettings.Instance.GetMaterialValue("temperature", extruderIndex0Based + 1);
|
||||
if (materialTemperature != "0")
|
||||
{
|
||||
string setTempString = "M109 T{0} S{1}".FormatWith(extruderIndex, materialTemperature);
|
||||
AddDefaultIfNotPresent(postStartGCode, setTempString, postStartGCodeLines, string.Format("wait for extruder {0} to reach temperature", extruderIndex));
|
||||
string setTempString = "M109 T{0} S{1}".FormatWith(extruderIndex0Based, materialTemperature);
|
||||
AddDefaultIfNotPresent(postStartGCode, setTempString, postStartGCodeLines, string.Format("wait for extruder {0} to reach temperature", extruderIndex0Based));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue