Skip to content

Commit

Permalink
Merged library into single namespace L5Sharp.Core so that going forwa…
Browse files Browse the repository at this point in the history
…rd reorganizations won't cause breaking changes. Incrementing to v.0.17
  • Loading branch information
tnunnink committed Dec 8, 2023
1 parent c801b21 commit 695ca37
Show file tree
Hide file tree
Showing 254 changed files with 531 additions and 785 deletions.
260 changes: 251 additions & 9 deletions src/.idea/.idea.L5Sharp/.idea/workspace.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using L5Sharp.Utilities;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// Provides a wrapper around the string port address value to indicate what type of address the value is.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using L5Sharp.Types;
using L5Sharp.Types.Atomics;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// Represents an argument to an instruction, which could be a tag name reference or an immediate atomic value.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using L5Sharp.Utilities;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// A composite key for a logix component that can be used to uniquely identify a component in the L5X file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
using System.Linq;
using System.Xml.Linq;
using JetBrains.Annotations;
using L5Sharp.Enums;
using L5Sharp.Utilities;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// Represents a reference to a component within a Logix project. This could be a code reference or a reference
Expand Down Expand Up @@ -45,7 +43,7 @@ public CrossReference(XElement element, string type, string reference, string? i
}

/// <summary>
/// The corresponding <see cref="Common.ComponentKey"/> of the reference, indicating both the component type and name
/// The corresponding <see cref="ComponentKey"/> of the reference, indicating both the component type and name
/// this element is in reference to.
/// </summary>
public ComponentKey Key => new(Type, Reference);
Expand Down Expand Up @@ -101,9 +99,9 @@ public CrossReference(XElement element, string type, string reference, string? i
public string Task => Scope.Task(_element);

/// <summary>
/// The <see cref="Enums.Scope"/> type that the reference is contained within.
/// The <see cref="Core.Scope"/> type that the reference is contained within.
/// </summary>
/// <value>A <see cref="Enums.Scope"/> indicating scope of the reference.</value>
/// <value>A <see cref="Core.Scope"/> indicating scope of the reference.</value>
public Scope Scope => Scope.Type(_element);

/// <summary>
Expand All @@ -125,7 +123,7 @@ public CrossReference(XElement element, string type, string reference, string? i
/// <summary>
/// The instruction object containing the reference to the component if this reference is a logic or code reference.
/// </summary>
/// <value>If the reference is a code reference, then the <see cref="Common.Instruction"/> object the reference
/// <value>If the reference is a code reference, then the <see cref="Core.Instruction"/> object the reference
/// was found; Otherwise, <c>null</c>.</value>
/// <remarks>
/// The helps further identify where in the logix element the reference is located. Having the associated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using L5Sharp.Utilities;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// Represents the dimensions of an array for a Logix type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
using System.Reflection;
using System.Text.RegularExpressions;
using JetBrains.Annotations;
using L5Sharp.Utilities;

// ReSharper disable StringLiteralTypo
// ReSharper disable IdentifierTypo
// ReSharper disable InconsistentNaming
// ReSharper disable CommentTypo

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using L5Sharp.Enums;
using L5Sharp.Utilities;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// A thin wrapper around the textual representation of logic notation called neutral text. This could represent a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using L5Sharp.Components;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// An entity that represents the type of product of a given <see cref="Module"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Globalization;
using System.Text.RegularExpressions;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// Represents a revision number that is expressed by as {Major}.{Minor}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System;
using System.Globalization;
using L5Sharp.Components;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// A configurable property of a <see cref="Task"/> that controls the rate at which the task will be evaluated or scanned.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections;
using System.Collections.Generic;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

public class TagMap : IEnumerable<KeyValuePair<TagName, TagName>>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using L5Sharp.Utilities;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// A string wrapper representing a Logix <c>TagName</c>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using L5Sharp.Components;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// A configurable property of a <see cref="Task"/> that controls the order in which the Logix Controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using L5Sharp.Components;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// An entity that represents the vendor of a given <see cref="Module"/>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System;
using System.Globalization;
using L5Sharp.Components;

namespace L5Sharp.Common;
namespace L5Sharp.Core;

/// <summary>
/// A configurable property of a <see cref="Task"/> that specified how long a task can rung before triggering a major fault.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using L5Sharp.Common;
using L5Sharp.Elements;
using L5Sharp.Utilities;

namespace L5Sharp.Components;
namespace L5Sharp.Core;

/// <summary>
/// A logix <c>AddOnInstruction</c> component. Contains the properties that comprise the L5X
Expand Down Expand Up @@ -51,7 +48,7 @@ public AddOnInstruction(XElement element) : base(element)
/// <summary>
/// The revision of the instruction.
/// </summary>
/// <value>A <see cref="Common.Revision"/> representing the version of the instruction.</value>
/// <value>A <see cref="Core.Revision"/> representing the version of the instruction.</value>
/// <remarks>
/// Specify the revision of the Add-On Instruction, in the form of MajorRevision.MinorRevision.
/// Each revision number can be 1...65,535.
Expand Down Expand Up @@ -167,7 +164,7 @@ public string? EditedBy
/// Specify the revision of the application last used to edit the Add-On Instruction.
/// The default is the currently open version of the application.
/// </summary>
/// <value>A <see cref="Common.Revision"/> representing the version of the instruction.</value>
/// <value>A <see cref="Core.Revision"/> representing the version of the instruction.</value>
public Revision? SoftwareRevision
{
get => GetValue<Revision>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using System;
using System.Xml.Linq;
using L5Sharp.Common;
using L5Sharp.Elements;
using L5Sharp.Enums;
using L5Sharp.Utilities;

namespace L5Sharp.Components;
namespace L5Sharp.Core;

/// <summary>
/// A logix <c>Controller</c> component. Contains the properties that comprise the L5X Controller element.
Expand Down Expand Up @@ -124,7 +120,7 @@ public string? CommDriver
/// <summary>
/// The revision or hardware version of the controller.
/// </summary>
/// <value>A <see cref="Common.Revision"/> value representing the major/minor version of the controller</value>
/// <value>A <see cref="Core.Revision"/> value representing the major/minor version of the controller</value>
public Revision? Revision
{
get
Expand Down Expand Up @@ -304,7 +300,7 @@ public string? EtherNetIPMode
}

/// <summary>
/// The <see cref="Elements.RedundancyInfo"/> object that specifies the redundancy configuration of the controller.
/// The <see cref="Core.RedundancyInfo"/> object that specifies the redundancy configuration of the controller.
/// </summary>
public RedundancyInfo? RedundancyInfo
{
Expand All @@ -313,7 +309,7 @@ public RedundancyInfo? RedundancyInfo
}

/// <summary>
/// The <see cref="Elements.Security"/> object that specifies the security configuration of the controller.
/// The <see cref="Core.Security"/> object that specifies the security configuration of the controller.
/// </summary>
public Security? Security
{
Expand All @@ -322,7 +318,7 @@ public Security? Security
}

/// <summary>
/// The <see cref="Elements.SafetyInfo"/> object that specifies the safety configuration of the controller.
/// The <see cref="Core.SafetyInfo"/> object that specifies the safety configuration of the controller.
/// </summary>
public SafetyInfo? SafetyInfo
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using L5Sharp.Elements;
using L5Sharp.Enums;
using L5Sharp.Utilities;

namespace L5Sharp.Components;
namespace L5Sharp.Core;

/// <summary>
/// A logix <c>DataType</c> component. Contains the properties that comprise the L5X DataType element.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
using System.Linq;
using System.Net;
using System.Xml.Linq;
using L5Sharp.Common;
using L5Sharp.Elements;
using L5Sharp.Enums;
using L5Sharp.Utilities;
using L5Sharp.Utilities.Catalog;

namespace L5Sharp.Components;
namespace L5Sharp.Core;

/// <summary>
/// A logix <c>Module</c> component. Contains the properties that comprise the L5X Module element.
Expand Down Expand Up @@ -69,7 +64,7 @@ public string? CatalogNumber
/// <summary>
/// The vendor or manufacturer of the module.
/// </summary>
/// <value>A <see cref="Common.Vendor"/> entity that contains the id and name of the vendor.</value>
/// <value>A <see cref="Core.Vendor"/> entity that contains the id and name of the vendor.</value>
/// <remarks>
/// All modules have a vendor representing the manufacturer of the module.
/// </remarks>
Expand Down Expand Up @@ -106,7 +101,7 @@ public ushort ProductCode
/// <summary>
/// The revision number or hardware version of the module.
/// </summary>
/// <value>A <see cref="Common.Revision"/> object representing the major and minor version.</value>
/// <value>A <see cref="Core.Revision"/> object representing the major and minor version.</value>
/// <remarks>
/// All modules must have a specified revision number.
/// </remarks>
Expand Down Expand Up @@ -334,7 +329,6 @@ public IEnumerable<Tag> Tags
/// Adds a child module to the current module object by updating the parent module properties, configuring the
/// child module upstream port, and adding the component to the underlying L5X content.
/// </summary>
/// <param name="parent">The module for which to add a child.</param>
/// <param name="child">The module to add.</param>
/// <param name="address">The optional <see cref="Address"/> (slot or IP) of the module to add.</param>
/// <exception cref="InvalidOperationException"><c>parent</c> does not have a downstream port for which to connect
Expand Down Expand Up @@ -371,12 +365,12 @@ public void Add(Module child, Address? address = default)
}

/// <summary>
/// Creates a new <see cref="Components.Module"/> with the provided name and catalog number.
/// Creates a new <see cref="Module"/> with the provided name and catalog number.
/// </summary>
/// <param name="name">The name of the module</param>
/// <param name="catalogNumber">The catalog number to lookup a catalog entry for.</param>
/// <param name="address"></param>
/// <returns>A new <see cref="Components.Module"/> object initialized with data return by the catalog service.</returns>
/// <returns>A new <see cref="Module"/> object initialized with data return by the catalog service.</returns>
/// <exception cref="InvalidOperationException">The module catalog service could not load the installed catalog
/// database file -or- catalog number does not exist in the catalog database.</exception>
/// <exception cref="ArgumentException"><c>catalogNumber</c> is null or empty.</exception>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using L5Sharp.Enums;
using L5Sharp.Utilities;

namespace L5Sharp.Components;
namespace L5Sharp.Core;

/// <summary>
/// A logix <c>Program</c> component. Contains the properties that comprise the L5X Program element.
Expand Down Expand Up @@ -43,7 +41,7 @@ public Program(XElement element) : base(element)
/// <summary>
/// Gets the type of the program (Normal, Equipment Phase).
/// </summary>
/// <value>A <see cref="Enums.ProgramType"/> enum representing the type of the program.</value>
/// <value>A <see cref="ProgramType"/> enum representing the type of the program.</value>
public ProgramType Type
{
get => GetValue<ProgramType>() ?? ProgramType.Normal;
Expand Down Expand Up @@ -153,10 +151,10 @@ public LogixContainer<Routine> Routines
L5X?.Programs.Where(p => Children.Any(c => c == p.Name)) ?? Enumerable.Empty<Program>();

/// <summary>
/// Finds the <see cref="Components.Task"/> in which this <see cref="Program"/> is scheduled.
/// Finds the <see cref="Core.Task"/> in which this <see cref="Program"/> is scheduled.
/// </summary>
/// <value>If this component is attached and is scheduled to a defined <c>Task</c>, then the
/// <see cref="Components.Task"/> component instance, Otherwise, null.</value>
/// <see cref="Core.Task"/> component instance, Otherwise, null.</value>
/// <remarks>
/// This is a helper for retrieving the parent <c>Task</c> for this program.
/// This requires an attached L5X as it traverses the L5X document tree to find the target component(s).
Expand Down
Loading

0 comments on commit 695ca37

Please sign in to comment.