mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-14 06:58:34 +00:00
Shifted Settings.Globals to Variables.Global
This commit is contained in:
parent
ac6f3c2f51
commit
8b05e2af6a
@ -1,4 +1,5 @@
|
||||
using OSCADSharp.Solids;
|
||||
using OSCADSharp.Scripting;
|
||||
using OSCADSharp.Solids;
|
||||
using OSCADSharp.Transforms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -13,10 +14,9 @@ namespace OSCADSharp.ConsoleTests
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
Settings.Globals["$fn"] = 100;
|
||||
Variables.Global["$fn"] = 100;
|
||||
var obj = new Sphere(30);
|
||||
|
||||
|
||||
var pos = obj.Position();
|
||||
var cyl1 = new Cylinder(1, 100, true).Translate(pos);
|
||||
var cyl2 = new Cylinder(1, 100, true).Rotate(0, 90, 0).Translate(pos);
|
||||
|
||||
@ -160,7 +160,7 @@ namespace OSCADSharp.UnitTests
|
||||
{
|
||||
var cube = new Cube();
|
||||
string[] output = null;
|
||||
Settings.Globals["$fn"] = 100;
|
||||
Variables.Global["$fn"] = 100;
|
||||
|
||||
var mock = new Mock<IFileWriter>();
|
||||
mock.Setup(_wrtr => _wrtr.WriteAllLines(It.IsAny<string>(), It.IsAny<string[]>()))
|
||||
|
||||
@ -18,7 +18,7 @@ namespace OSCADSharp.UnitTests
|
||||
public void Settings_NullVariablesDoNothing()
|
||||
{
|
||||
var cube = new Cube();
|
||||
Settings.Globals["thing"] = null;
|
||||
Variables.Global["thing"] = null;
|
||||
string[] output = null;
|
||||
|
||||
var mock = new Mock<IFileWriter>();
|
||||
|
||||
@ -334,7 +334,7 @@ namespace OSCADSharp
|
||||
Settings.FileWriter.WriteAllLines(path, new string[]
|
||||
{
|
||||
Settings.OSCADSharpHeader,
|
||||
Settings.Globals.ToString(),
|
||||
Variables.Global.ToString(),
|
||||
this.ToString()
|
||||
});
|
||||
|
||||
|
||||
@ -11,6 +11,12 @@ namespace OSCADSharp.Scripting
|
||||
/// </summary>
|
||||
public sealed class Variables
|
||||
{
|
||||
/// <summary>
|
||||
/// Global variables that can be assigned for output at the
|
||||
/// top of OpenSCAD scripts
|
||||
/// </summary>
|
||||
public static Variables Global = new Variables();
|
||||
|
||||
private Dictionary<string, object> variables = new Dictionary<string, object>();
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -18,13 +18,7 @@ namespace OSCADSharp
|
||||
/// </summary>
|
||||
public static readonly string OSCADSharpHeader = String.Format("/*Code Generated using OSCADSharp on {0}. {1}{2}For more information, please visit https://github.com/Exolun/OSCADSharp */{3}",
|
||||
DateTime.Now.ToString(), Environment.NewLine, Environment.NewLine, Environment.NewLine);
|
||||
|
||||
/// <summary>
|
||||
/// Global variables that can be assigned for output at the
|
||||
/// top of OpenSCAD scripts
|
||||
/// </summary>
|
||||
public static Variables Globals = new Variables();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Used to write scripts to file
|
||||
/// </summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user