Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align with changes in oM and Engine on Reflection -> Base #543

Merged
merged 2 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion XML_Adapter/AdapterActions/Pull.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override IEnumerable<object> Pull(IRequest request, PullType pullType = P
{
if (!System.IO.File.Exists(_fileSettings.GetFullFileName()))
{
BH.Engine.Reflection.Compute.RecordError("File does not exist to pull from");
BH.Engine.Base.Compute.RecordError("File does not exist to pull from");
return new List<IBHoMObject>();
}

Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/AdapterActions/Push.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public override List<object> Push(IEnumerable<object> objects, String tag = "",

/*if (_xmlSettings == null)
{
BH.Engine.Reflection.Compute.RecordError("Please set some XML Settings on the XML Adapter before pushing to an XML File");
BH.Engine.Base.Compute.RecordError("Please set some XML Settings on the XML Adapter before pushing to an XML File");
return new List<object>();
}*/

Expand Down
4 changes: 2 additions & 2 deletions XML_Adapter/CRUD/CSProject/CreateCSProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private bool CreateCSProject<T>(IEnumerable<T> objects, XMLConfig config)

if (doc == null)
{
BH.Engine.Reflection.Compute.RecordError("The CSProject schema requires a full system to be provided as a single push operation.");
BH.Engine.Base.Compute.RecordError("The CSProject schema requires a full system to be provided as a single push operation.");
return false;
}

Expand Down Expand Up @@ -121,7 +121,7 @@ private bool CreateCSProject<T>(IEnumerable<T> objects, XMLConfig config)
}
catch (Exception e)
{
BH.Engine.Reflection.Compute.RecordError(e.ToString());
BH.Engine.Base.Compute.RecordError(e.ToString());
success = false;
}

Expand Down
10 changes: 5 additions & 5 deletions XML_Adapter/CRUD/Create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ protected override bool ICreate<T>(IEnumerable<T> objects, ActionConfig actionCo
{
if(actionConfig == null)
{
BH.Engine.Reflection.Compute.RecordError("Please provide configuration settings to push to an XML file");
BH.Engine.Base.Compute.RecordError("Please provide configuration settings to push to an XML file");
return false;
}

XMLConfig config = actionConfig as XMLConfig;
if(config == null)
{
BH.Engine.Reflection.Compute.RecordError("Please provide valid a XMLConfig object for pushing to an XML file");
BH.Engine.Base.Compute.RecordError("Please provide valid a XMLConfig object for pushing to an XML file");
return false;
}

Expand All @@ -59,13 +59,13 @@ protected override bool ICreate<T>(IEnumerable<T> objects, ActionConfig actionCo
case Schema.KML:
return CreateKML(objects, config);
case Schema.EnergyPlusLoads:
BH.Engine.Reflection.Compute.RecordError("The EnergyPlusLoads Schema is not supported for push operations at this time");
BH.Engine.Base.Compute.RecordError("The EnergyPlusLoads Schema is not supported for push operations at this time");
return false;
case Schema.Bluebeam:
BH.Engine.Reflection.Compute.RecordError("The Bluebeam markup schema is not supported for push operations at this time.");
BH.Engine.Base.Compute.RecordError("The Bluebeam markup schema is not supported for push operations at this time.");
return false;
default:
BH.Engine.Reflection.Compute.RecordNote("You have not supplied a supported XML Schema to push. Data is being pushed either using a schema set by XML Attributes on the objects, or a default schema based on object properties.");
BH.Engine.Base.Compute.RecordNote("You have not supplied a supported XML Schema to push. Data is being pushed either using a schema set by XML Attributes on the objects, or a default schema based on object properties.");
return CreateDefault(objects, config);
}
}
Expand Down
6 changes: 3 additions & 3 deletions XML_Adapter/CRUD/Default/CreateDefault.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ private bool CreateDefault<T>(IEnumerable<T> objects, XMLConfig config)
catch(Exception ex)
{
//Well something went terribly wrong so lets give the user both error messages to help with debugging
BH.Engine.Reflection.Compute.RecordError("An error occurred in serialising the objects of type " + objects.GetType() + ". Error messages will follow.");
BH.Engine.Reflection.Compute.RecordError(e.ToString());
BH.Engine.Reflection.Compute.RecordError(ex.ToString());
BH.Engine.Base.Compute.RecordError("An error occurred in serialising the objects of type " + objects.GetType() + ". Error messages will follow.");
BH.Engine.Base.Compute.RecordError(e.ToString());
BH.Engine.Base.Compute.RecordError(ex.ToString());
success = false;
}
}
Expand Down
10 changes: 5 additions & 5 deletions XML_Adapter/CRUD/GBXML/CreateGBXML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@ private bool CreateGBXML<T>(IEnumerable<T> objects, XMLConfig config)

if(config.Settings == null)
{
BH.Engine.Reflection.Compute.RecordError("Please provide a suitable set of GBXMLSettings with the XMLConfig to determine how the GBXML file should be created");
BH.Engine.Base.Compute.RecordError("Please provide a suitable set of GBXMLSettings with the XMLConfig to determine how the GBXML file should be created");
return false;
}

GBXMLSettings settings = config.Settings as GBXMLSettings;
if(settings == null)
{
BH.Engine.Reflection.Compute.RecordError("Please provide a suitable set of GBXMLSettings with the XMLConfig to determine how the GBXML file should be created");
BH.Engine.Base.Compute.RecordError("Please provide a suitable set of GBXMLSettings with the XMLConfig to determine how the GBXML file should be created");
return false;
}

GBXMLDocumentBuilder doc = objects.ToList()[0] as GBXMLDocumentBuilder;

if(doc == null)
{
BH.Engine.Reflection.Compute.RecordError("The GBXML schema requires a full model to be provided as a single push operation. For pushing to the GBXML version, you need to plug your objects into a GBXMLDocumentBuilder which collates the objects for pushing and push that to GBXML via this adapter.");
BH.Engine.Base.Compute.RecordError("The GBXML schema requires a full model to be provided as a single push operation. For pushing to the GBXML version, you need to plug your objects into a GBXMLDocumentBuilder which collates the objects for pushing and push that to GBXML via this adapter.");
return false;
}

Expand All @@ -83,7 +83,7 @@ private bool CreateGBXML<T>(IEnumerable<T> objects, XMLConfig config)
}
else
{
BH.Engine.Reflection.Compute.RecordError("The ExportDetail has not been appropriately set. Please set the ExportDetail to continue");
BH.Engine.Base.Compute.RecordError("The ExportDetail has not been appropriately set. Please set the ExportDetail to continue");
return false;
}

Expand All @@ -105,7 +105,7 @@ private bool CreateGBXML<T>(IEnumerable<T> objects, XMLConfig config)
}
catch (Exception e)
{
BH.Engine.Reflection.Compute.RecordError(e.ToString());
BH.Engine.Base.Compute.RecordError(e.ToString());
success = false;
}

Expand Down
8 changes: 4 additions & 4 deletions XML_Adapter/CRUD/KML/CreateKML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ private bool CreateKML<T>(IEnumerable<T> objects, XMLConfig config)

if (config.Settings == null)
{
BH.Engine.Reflection.Compute.RecordError("Please provide a suitable set of KMLSettings with the XMLConfig to determine how the KML file should be created");
BH.Engine.Base.Compute.RecordError("Please provide a suitable set of KMLSettings with the XMLConfig to determine how the KML file should be created");
return false;
}

KMLSettings settings = config.Settings as KMLSettings;
if (settings == null)
{
BH.Engine.Reflection.Compute.RecordError("Please provide a suitable set of KMLSettings with the XMLConfig to determine how the KML file should be created");
BH.Engine.Base.Compute.RecordError("Please provide a suitable set of KMLSettings with the XMLConfig to determine how the KML file should be created");
return false;
}

KMLDocumentBuilder docBuilder = objects.ToList()[0] as KML.KMLDocumentBuilder;

if (docBuilder == null)
{
BH.Engine.Reflection.Compute.RecordError("The KML schema requires a full model to be provided as a single push operation. For pushing to the KML version, you need to plug your objects into a KMLDocumentBuilder which collates the objects for pushing and push that to KML via this adapter.");
BH.Engine.Base.Compute.RecordError("The KML schema requires a full model to be provided as a single push operation. For pushing to the KML version, you need to plug your objects into a KMLDocumentBuilder which collates the objects for pushing and push that to KML via this adapter.");
return false;
}

Expand All @@ -85,7 +85,7 @@ private bool CreateKML<T>(IEnumerable<T> objects, XMLConfig config)
}
catch (Exception e)
{
BH.Engine.Reflection.Compute.RecordError(e.ToString());
BH.Engine.Base.Compute.RecordError(e.ToString());
success = false;
}

Expand Down
8 changes: 4 additions & 4 deletions XML_Adapter/CRUD/Read.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ protected override IEnumerable<IBHoMObject> IRead(Type type, IList indices = nul
{
if (actionConfig == null)
{
BH.Engine.Reflection.Compute.RecordError("Please provide configuration settings to push to an XML file");
BH.Engine.Base.Compute.RecordError("Please provide configuration settings to push to an XML file");
return new List<IBHoMObject>();
}

XMLConfig config = actionConfig as XMLConfig;
if (config == null)
{
BH.Engine.Reflection.Compute.RecordError("Please provide valid a XMLConfig object for pushing to an XML file");
BH.Engine.Base.Compute.RecordError("Please provide valid a XMLConfig object for pushing to an XML file");
return new List<IBHoMObject>();
}

Expand All @@ -70,12 +70,12 @@ protected override IEnumerable<IBHoMObject> IRead(Type type, IList indices = nul
case Schema.GBXML:
return ReadGBXML(type, config);
case Schema.KML:
BH.Engine.Reflection.Compute.RecordError("The KML Schema is not supported for pull operations at this time");
BH.Engine.Base.Compute.RecordError("The KML Schema is not supported for pull operations at this time");
return new List<IBHoMObject>();
case Schema.Bluebeam:
return ReadBluebeam(type, config);
default:
BH.Engine.Reflection.Compute.RecordNote("You have not supplied a supported XML Schema to pull. Data is being returned as Custom Objects.");
BH.Engine.Base.Compute.RecordNote("You have not supplied a supported XML Schema to pull. Data is being returned as Custom Objects.");
return ReadDefault();
}
}
Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/Convert/GBXML/Architecture/Level.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
using BH.Engine.Geometry;
using BH.Engine.Environment;
using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;
using BH.oM.Adapters.XML.Settings;

namespace BH.Adapter.XML
Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/Convert/GBXML/Environment/Building.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
using BH.Engine.Environment;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;
using BH.oM.Adapters.XML.Settings;
using BH.oM.XML.Fragments;

Expand Down
4 changes: 2 additions & 2 deletions XML_Adapter/Convert/GBXML/Environment/Construction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
using BHM = BH.oM.Physical.Materials;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;

using BH.Engine.Adapters.XML;
using BH.oM.Adapters.XML.Settings;
Expand Down Expand Up @@ -109,7 +109,7 @@ public static BHX.Construction ToGBXML(this BHC.Construction construction, BHE.P
gbConstruction.UValue.Value = (analysisProperties == null || analysisProperties.UValue == 0 ? (construction.UValue() == double.NaN || double.IsInfinity(construction.UValue()) ? 10 : construction.UValue()) : analysisProperties.UValue).ToString();

if (gbConstruction.UValue.Value == "10")
BH.Engine.Reflection.Compute.RecordWarning(string.Format("U-Value has been calculated to Infinity or NaN. Has been set to default 10"));
BH.Engine.Base.Compute.RecordWarning(string.Format("U-Value has been calculated to Infinity or NaN. Has been set to default 10"));

return gbConstruction;
}
Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/Convert/GBXML/Environment/ElementType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using BHE = BH.oM.Environment.Elements;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;

namespace BH.Adapter.XML
{
Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/Convert/GBXML/Environment/Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
using BH.Engine.Environment;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;

using BH.Engine.Adapters.XML;
using BH.oM.Adapters.XML.Settings;
Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/Convert/GBXML/Environment/Opening.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
using BH.oM.Adapters.XML.Settings;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;

using BH.Engine.Adapters.XML;

Expand Down
4 changes: 2 additions & 2 deletions XML_Adapter/Convert/GBXML/Environment/Panel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
using BHP = BH.oM.Environment.Fragments;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;

using BH.Engine.Adapters.XML;

Expand Down Expand Up @@ -241,7 +241,7 @@ public static BHX.RectangularGeometry ToGBXMLGeometry(this BHE.Panel element, GB
if (geom.Width == 0)
geom.Width = Math.Round(element.Area() / geom.Height, settings.RoundingSettings.GeometryWidth);
if (geom.Tilt == -1)
BH.Engine.Reflection.Compute.RecordWarning("Warning, panel " + element.BHoM_Guid + " has been calculated to have a tilt of -1.");
BH.Engine.Base.Compute.RecordWarning("Warning, panel " + element.BHoM_Guid + " has been calculated to have a tilt of -1.");

return geom;
}
Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/Convert/GBXML/Environment/Roughness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
using BHX = BH.Adapter.XML.GBXMLSchema;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;

namespace BH.Adapter.XML
{
Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/Convert/GBXML/Geometry/Point.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
using BH.Engine.Geometry;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;
using BH.oM.Adapters.XML.Settings;

namespace BH.Adapter.XML
Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/Convert/GBXML/Geometry/Polyline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
using BH.Engine.Geometry;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;
using BH.oM.Adapters.XML.Settings;

namespace BH.Adapter.XML
Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/Convert/GBXML/Geometry/SpaceBoundaries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
using BH.Engine.Environment;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;

using BH.oM.Adapters.XML.Settings;

Expand Down
4 changes: 2 additions & 2 deletions XML_Adapter/Convert/GBXML/ToGBXML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public static GBXML.GBXML ToGBXML(this List<IBHoMObject> objs, GBXMLSettings set
List<Building> buildings = objs.Buildings();

if (buildings.Count > 1)
BH.Engine.Reflection.Compute.RecordWarning("More than 1 building has been supplied. Space information will be assigned to the first building but all buildings will be serialised");
BH.Engine.Base.Compute.RecordWarning("More than 1 building has been supplied. Space information will be assigned to the first building but all buildings will be serialised");
else if (buildings.Count == 0)
{
BH.Engine.Reflection.Compute.RecordWarning("No building was supplied, generic empty building is being used to group the data");
BH.Engine.Base.Compute.RecordWarning("No building was supplied, generic empty building is being used to group the data");
buildings.Add(new Building());
}

Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/Query/CADObjectID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
using BH.Engine.Environment;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;

namespace BH.Adapter.XML
{
Expand Down
2 changes: 1 addition & 1 deletion XML_Adapter/Query/ConstructionID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
using BHC = BH.oM.Physical.Constructions;

using System.ComponentModel;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;

namespace BH.Adapter.XML
{
Expand Down
6 changes: 3 additions & 3 deletions XML_Adapter/XMLAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
using BH.oM.Base;
using System.Reflection;

using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;
using System.ComponentModel;
using System.IO;

Expand All @@ -47,13 +47,13 @@ public XMLAdapter(BH.oM.Adapter.FileSettings fileSettings = null)
{
if (fileSettings == null)
{
BH.Engine.Reflection.Compute.RecordError("Please set the File Settings correctly to enable the XML Adapter to work correctly");
BH.Engine.Base.Compute.RecordError("Please set the File Settings correctly to enable the XML Adapter to work correctly");
return;
}

if (!Path.HasExtension(fileSettings.FileName) || (Path.GetExtension(fileSettings.FileName) != ".xml" && Path.GetExtension(fileSettings.FileName) != ".csproj"))
{
BH.Engine.Reflection.Compute.RecordError("File name must contain a file extension");
BH.Engine.Base.Compute.RecordError("File name must contain a file extension");
return;
}

Expand Down
10 changes: 0 additions & 10 deletions XML_Adapter/XML_Adapter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,6 @@
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Reflection_Engine">
<SpecificVersion>False</SpecificVersion>
<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="Serialiser_Engine">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\ProgramData\BHoM\Assemblies\Serialiser_Engine.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion XML_Engine/Create/DocumentBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BH.oM.Reflection.Attributes;
using BH.oM.Base.Attributes;

using BH.oM.Environment.Elements;
using GBXML = BH.oM.Adapters.XML;
Expand Down
Loading