From 5ec2ffd9b7c01ced188c9cfe28e2f7c6cd459e8b Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Tue, 11 Jan 2022 17:36:54 +0000 Subject: [PATCH] Align with changes in oM and Engine on Reflection -> Base --- Dynamo20/Dynamo_Engine/Compute/RunCaller.cs | 8 ++++---- Dynamo20/Dynamo_Engine/Convert/FromDesignScript.cs | 2 +- Dynamo20/Dynamo_Engine/Convert/ToDesignScript.cs | 4 ++-- Dynamo20/Dynamo_Engine/Convert/ToPortData.cs | 2 +- Dynamo20/Dynamo_Engine/Dynamo20_Engine.csproj | 5 ----- Dynamo20/Dynamo_Engine/Objects/DataAccessor_Dynamo.cs | 6 +++--- Dynamo20/Dynamo_UI/Global/Extention.cs | 6 +++--- 7 files changed, 14 insertions(+), 19 deletions(-) diff --git a/Dynamo20/Dynamo_Engine/Compute/RunCaller.cs b/Dynamo20/Dynamo_Engine/Compute/RunCaller.cs index a508aa7..e53fb92 100644 --- a/Dynamo20/Dynamo_Engine/Compute/RunCaller.cs +++ b/Dynamo20/Dynamo_Engine/Compute/RunCaller.cs @@ -24,7 +24,7 @@ using BH.Engine.Dynamo; using BH.Engine.Dynamo.Objects; using BH.oM.Base; -using BH.oM.Reflection.Debugging; +using BH.oM.Base.Debugging; using BH.oM.UI; using BH.UI.Base; using Dynamo.Graph.Nodes; @@ -364,7 +364,7 @@ public static object RunCaller(string callerId, object a1, object a2, object a3, private static object RunCaller(string callerId, object[] arguments) // It is super important for this to be private of Dynamo mess things up { object result = null; - Engine.Reflection.Compute.ClearCurrentEvents(); + Engine.Base.Compute.ClearCurrentEvents(); // Run the caller Caller caller = null; @@ -393,12 +393,12 @@ public static object RunCaller(string callerId, object a1, object a2, object a3, } else { - Reflection.Compute.RecordError("The method caller cannot be found."); + Base.Compute.RecordError("The method caller cannot be found."); result = null; } // Handle errors and warnings - List events = Reflection.Query.CurrentEvents(); + List events = Base.Query.CurrentEvents(); if (events != null && events.Count != 0) { List errors = events.FindAll(x => x.Type == EventType.Error); diff --git a/Dynamo20/Dynamo_Engine/Convert/FromDesignScript.cs b/Dynamo20/Dynamo_Engine/Convert/FromDesignScript.cs index 31497a1..f209984 100644 --- a/Dynamo20/Dynamo_Engine/Convert/FromDesignScript.cs +++ b/Dynamo20/Dynamo_Engine/Convert/FromDesignScript.cs @@ -201,7 +201,7 @@ public static BHG.ICurve FromDesignScript(this ADG.Curve curve) else { // Fallback method for the missing converts, e.g. Helix. - BH.Engine.Reflection.Compute.RecordWarning(String.Format("Convert from DesignScript to BHoM is missing for curves of type {0}. The curve has been approximated with lines and arcs.", curve.GetType())); + BH.Engine.Base.Compute.RecordWarning(String.Format("Convert from DesignScript to BHoM is missing for curves of type {0}. The curve has been approximated with lines and arcs.", curve.GetType())); return new BHG.PolyCurve { Curves = curve.ApproximateWithArcAndLineSegments().Select(x => x?.IFromDesignScript()).ToList() }; } diff --git a/Dynamo20/Dynamo_Engine/Convert/ToDesignScript.cs b/Dynamo20/Dynamo_Engine/Convert/ToDesignScript.cs index bb7b96c..6e092cb 100644 --- a/Dynamo20/Dynamo_Engine/Convert/ToDesignScript.cs +++ b/Dynamo20/Dynamo_Engine/Convert/ToDesignScript.cs @@ -266,7 +266,7 @@ public static ADG.Surface ToDesignScript(this BHG.NurbsSurface surface) } catch { - Reflection.Compute.RecordWarning("Surface trim failed. Untrimmed surface has been returned instead."); + Base.Compute.RecordWarning("Surface trim failed. Untrimmed surface has been returned instead."); } return ADGSurface; @@ -280,7 +280,7 @@ public static ADG.Surface ToDesignScript(this BHG.PlanarSurface surface) return null; else if (surface.InternalBoundaries.Count != 0) { - BH.Engine.Reflection.Compute.RecordError("Dynamo does not support surfaces with openings, convert failed."); + BH.Engine.Base.Compute.RecordError("Dynamo does not support surfaces with openings, convert failed."); return null; } else diff --git a/Dynamo20/Dynamo_Engine/Convert/ToPortData.cs b/Dynamo20/Dynamo_Engine/Convert/ToPortData.cs index c6f4590..211624a 100644 --- a/Dynamo20/Dynamo_Engine/Convert/ToPortData.cs +++ b/Dynamo20/Dynamo_Engine/Convert/ToPortData.cs @@ -71,7 +71,7 @@ public static PortData ToPortData(this ParamInfo info) if (defaultNode == null) { - BH.Engine.Reflection.Compute.RecordError("Port " + info.Name + " failed to assigned it default value of " + defaultValue.ToString()); + BH.Engine.Base.Compute.RecordError("Port " + info.Name + " failed to assigned it default value of " + defaultValue.ToString()); return new PortData(info.Name, info.Description); } else diff --git a/Dynamo20/Dynamo_Engine/Dynamo20_Engine.csproj b/Dynamo20/Dynamo_Engine/Dynamo20_Engine.csproj index fd1c7c0..b333327 100644 --- a/Dynamo20/Dynamo_Engine/Dynamo20_Engine.csproj +++ b/Dynamo20/Dynamo_Engine/Dynamo20_Engine.csproj @@ -129,11 +129,6 @@ C:\ProgramData\BHoM\Assemblies\Reflection_Engine.dll False - - False - C:\ProgramData\BHoM\Assemblies\Reflection_oM.dll - False - diff --git a/Dynamo20/Dynamo_Engine/Objects/DataAccessor_Dynamo.cs b/Dynamo20/Dynamo_Engine/Objects/DataAccessor_Dynamo.cs index 81161ce..2c7332c 100644 --- a/Dynamo20/Dynamo_Engine/Objects/DataAccessor_Dynamo.cs +++ b/Dynamo20/Dynamo_Engine/Objects/DataAccessor_Dynamo.cs @@ -174,7 +174,7 @@ public bool SetDataItem(int index, T data) catch (Exception e) { SetOutputAt(index, data); - Engine.Reflection.Compute.RecordWarning("Failed to convert output " + index + " to DesignScript. Returning it without conversion.\nError: " + e.Message); + Engine.Base.Compute.RecordWarning("Failed to convert output " + index + " to DesignScript. Returning it without conversion.\nError: " + e.Message); return false; } } @@ -197,7 +197,7 @@ public bool SetDataList(int index, IEnumerable data) catch (Exception e) { SetOutputAt(index, data); - Engine.Reflection.Compute.RecordWarning("Failed to convert output " + index + " to DesignScript. Returning it without conversion.\nError: " + e.Message); + Engine.Base.Compute.RecordWarning("Failed to convert output " + index + " to DesignScript. Returning it without conversion.\nError: " + e.Message); return false; } } @@ -220,7 +220,7 @@ public bool SetDataTree(int index, IEnumerable> data) catch (Exception e) { SetOutputAt(index, data); - Engine.Reflection.Compute.RecordWarning("Failed to convert output " + index + " to DesignScript. Returning it without conversion.\nError: " + e.Message); + Engine.Base.Compute.RecordWarning("Failed to convert output " + index + " to DesignScript. Returning it without conversion.\nError: " + e.Message); return false; } } diff --git a/Dynamo20/Dynamo_UI/Global/Extention.cs b/Dynamo20/Dynamo_UI/Global/Extention.cs index e284c4c..0830c0a 100644 --- a/Dynamo20/Dynamo_UI/Global/Extention.cs +++ b/Dynamo20/Dynamo_UI/Global/Extention.cs @@ -76,9 +76,9 @@ public void Startup(ViewStartupParams sp) .FirstOrDefault(); // Preload all the BHoM content - Engine.Reflection.Compute.LoadAllAssemblies(); - Engine.Reflection.Query.AllTypeList(); - Engine.Reflection.Query.AllMethodList(); + Engine.Base.Compute.LoadAllAssemblies(); + Engine.Base.Query.AllTypeList(); + Engine.Base.Query.AllMethodList(); } /*******************************************/