Skip to content

Commit

Permalink
Align with changes in oM and Engine on Reflection -> Base
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraser Greenroyd committed Jan 13, 2022
1 parent be85217 commit 5ec2ffd
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Dynamo20/Dynamo_Engine/Compute/RunCaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<Event> events = Reflection.Query.CurrentEvents();
List<Event> events = Base.Query.CurrentEvents();
if (events != null && events.Count != 0)
{
List<Event> errors = events.FindAll(x => x.Type == EventType.Error);
Expand Down
2 changes: 1 addition & 1 deletion Dynamo20/Dynamo_Engine/Convert/FromDesignScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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() };
}

Expand Down
4 changes: 2 additions & 2 deletions Dynamo20/Dynamo_Engine/Convert/ToDesignScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dynamo20/Dynamo_Engine/Convert/ToPortData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions Dynamo20/Dynamo_Engine/Dynamo20_Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@
<HintPath>C:\ProgramData\BHoM\Assemblies\Reflection_Engine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Reflection_oM">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\ProgramData\BHoM\Assemblies\Reflection_oM.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
6 changes: 3 additions & 3 deletions Dynamo20/Dynamo_Engine/Objects/DataAccessor_Dynamo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public bool SetDataItem<T>(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;
}
}
Expand All @@ -197,7 +197,7 @@ public bool SetDataList<T>(int index, IEnumerable<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;
}
}
Expand All @@ -220,7 +220,7 @@ public bool SetDataTree<T>(int index, IEnumerable<IEnumerable<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;
}
}
Expand Down
6 changes: 3 additions & 3 deletions Dynamo20/Dynamo_UI/Global/Extention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/*******************************************/
Expand Down

0 comments on commit 5ec2ffd

Please sign in to comment.