Revise scene content loading

- Remove file system dependencies
- Use library container interfaces
- Issue MatterHackers/MCCentral#2248
Bed no longer persists and rounds trips application restarts
- Issue MatterHackers/MCCentral#1764
Get edit part mode working
This commit is contained in:
John Lewin 2017-11-14 15:45:23 -08:00
parent 40c038032d
commit fb84b6a18a
8 changed files with 145 additions and 61 deletions

View file

@ -277,7 +277,7 @@ namespace MatterControl.Tests.MatterControl
AggContext.StaticData = new FileSystemStaticData(TestContext.CurrentContext.ResolveProjectPath(4, "StaticData"));
MatterControlUtilities.OverrideAppDataLocation(TestContext.CurrentContext.ResolveProjectPath(4));
var field = new ComPortField(new PrinterConfig(false, PrinterSettings.Empty));
var field = new ComPortField(new PrinterConfig(null, PrinterSettings.Empty));
await ValidateAgainstValueMap(
field,

View file

@ -35,6 +35,7 @@ using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.DataConverters3D;
using MatterHackers.MatterControl;
using MatterHackers.MatterControl.Library;
using MatterHackers.MatterControl.Tests.Automation;
using MatterHackers.MeshVisualizer;
using Newtonsoft.Json;
@ -101,7 +102,7 @@ namespace MatterHackers.PolygonMesh.UnitTests
MatterControlUtilities.OverrideAppDataLocation(TestContext.CurrentContext.ResolveProjectPath(4));
#endif
var sceneContext = new BedConfig();
var sceneContext = new BedConfig(null);
var scene = sceneContext.Scene;
scene.Children.Add(new Object3D
@ -135,7 +136,10 @@ namespace MatterHackers.PolygonMesh.UnitTests
scene.Children.Modify(list => list.Clear());
// Reload the model
await Task.Run(() => sceneContext.Scene.Load(filePath));
await Task.Run(() =>
{
sceneContext.Scene.Load(Object3D.Load(filePath, CancellationToken.None));
});
// Serialize and compare the two trees
string onDiskData = JsonConvert.SerializeObject(loadedItem, Formatting.Indented);