Change value diagram calculator
This commit is contained in:
@@ -24,7 +24,7 @@ namespace StructureHelperCommon.Services
|
||||
/// <exception cref="StructureHelperException"></exception>
|
||||
public static void CompareTypes(object targetObject, object sourceObject)
|
||||
{
|
||||
IsNull(targetObject, sourceObject);
|
||||
ThrowIfNull(targetObject, sourceObject);
|
||||
if (targetObject.GetType() != sourceObject.GetType())
|
||||
{
|
||||
throw new StructureHelperException
|
||||
@@ -32,10 +32,10 @@ namespace StructureHelperCommon.Services
|
||||
}
|
||||
}
|
||||
|
||||
public static void IsNull(object targetObject, object sourceObject, string senderName = "")
|
||||
public static void ThrowIfNull(object targetObject, object sourceObject, string senderName = "")
|
||||
{
|
||||
IsNull(targetObject,$"{senderName} target object");
|
||||
IsNull(sourceObject, $"{senderName} source object");
|
||||
ThrowIfNull(targetObject,$"{senderName} target object");
|
||||
ThrowIfNull(sourceObject, $"{senderName} source object");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -44,7 +44,7 @@ namespace StructureHelperCommon.Services
|
||||
/// <param name="item">Checked object</param>
|
||||
/// <param name="message">Message while error occur</param>
|
||||
/// <exception cref="StructureHelperException"></exception>
|
||||
public static void IsNull(object item, string message = "")
|
||||
public static void ThrowIfNull(object item, string message = "")
|
||||
{
|
||||
if (item is null)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace StructureHelperCommon.Services.Exports
|
||||
{
|
||||
public class EntitiesToDxfExportLogic : IExportToFileLogic
|
||||
{
|
||||
private const double metresToMillimeters = 1000.0;
|
||||
private IGetDxfLayerLogic layerLogic = new GetDxfLayerLogic();
|
||||
public List<(EntityObject entity, LayerNames layerName)> Entities { get; set; } = [];
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace StructureHelperCommon.Services.Exports
|
||||
private const string PrimitivesLayer = "STR-PRM";
|
||||
private const string OpeningsLayer = "STR-OPN";
|
||||
private const string RebarLayer = "STR-REB";
|
||||
private const string PointLayer = "STR-PNT";
|
||||
private const string LayerNameIsUnKnown = ": Layer name is unknown";
|
||||
public Layer GetOrCreateLayer(DxfDocument dxf, LayerNames layerName)
|
||||
{
|
||||
@@ -29,6 +30,7 @@ namespace StructureHelperCommon.Services.Exports
|
||||
if (layerName == LayerNames.StructiralPrimitives) { return PrimitivesLayer; }
|
||||
else if (layerName == LayerNames.StructuralOpenings) { return OpeningsLayer; }
|
||||
else if (layerName == LayerNames.StructuralRebars) { return RebarLayer; }
|
||||
else if (layerName == LayerNames.StructuralPoints) { return PointLayer; }
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(layerName) + LayerNameIsUnKnown);
|
||||
@@ -40,6 +42,7 @@ namespace StructureHelperCommon.Services.Exports
|
||||
if (layerName == LayerNames.StructiralPrimitives) { return AciColor.Blue; }
|
||||
else if (layerName == LayerNames.StructuralOpenings) { return AciColor.DarkGray; }
|
||||
else if (layerName == LayerNames.StructuralRebars) { return AciColor.Magenta; }
|
||||
else if (layerName == LayerNames.StructuralPoints) { return AciColor.Green; }
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(layerName) + LayerNameIsUnKnown);
|
||||
|
||||
@@ -10,7 +10,8 @@ namespace StructureHelperCommon.Services.Exports
|
||||
{
|
||||
StructiralPrimitives,
|
||||
StructuralOpenings,
|
||||
StructuralRebars
|
||||
StructuralRebars,
|
||||
StructuralPoints
|
||||
}
|
||||
public class ShapesExportToDxfLogic : IExportToFileLogic
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user