Skip to content

Circuit

ESM: import Circuit from "@arcgis/core/networks/support/Circuit.js";
CDN: const Circuit = await $arcgis.import("@arcgis/core/networks/support/Circuit.js");
Class: @arcgis/core/networks/support/Circuit
Inheritance: CircuitJSONSupport
Since: ArcGIS Maps SDK for JavaScript 4.34
beta

Represents a circuit in a telecom domain network.

Creating a Circuit

Circuits may be created in one of three ways: with start location and stop location, with sections, or with neither.

Keep in mind that name must always be specified when instantiating a Circuit, and the following may be optionally specified: attributes, circuitManager, circuitType, and subcircuits.

With start and stop location

If created with start and stop locations, isSectioned is false.

const startLocation = new CircuitLocation({
  sourceId: 20,
  globalId: "{665803BB-258E-4BAE-A5B2-27DBD8A83C30}",
  terminalId: 1,
  firstUnit: 1,
  numUnits: 1,
});

const stopLocation = new CircuitLocation({
  sourceId: 20,
  globalId: "{58CB492A-1992-4518-A60F-6119B1317E89}",
  terminalId: 1,
  firstUnit: 1,
  numUnits: 1,
});

const circuit = new Circuit({
  name: "FIRSTCIRCUIT",
  circuitType: "physical",
  startLocation,
  stopLocation,
});

With sections

If created with sections, isSectioned is true.

const sectionOne = new CircuitSection({
  sectionId: 1,
  subcircuit: new Subcircuit({ name: "SUBCIRCUITVALUE1" }),
});

const sectionTwo = new CircuitSection({
  sectionId: 2,
  subcircuit: new Subcircuit({ name: "SUBCIRCUITVALUE2" }),
});

const sectionThree = new CircuitSection({
  sectionId: 3,
  subcircuit: new Subcircuit({ name: "SUBCIRCUITVALUE3" }),
});

const sectionFour = new CircuitSection({
  sectionId: 4,
  subcircuit: new Subcircuit({ name: "SUBCIRCUITVALUE4" }),
});

const sections = new Map([
  [sectionOne, [sectionTwo, sectionThree]],
  [sectionTwo, [sectionFour]],
  [sectionThree, [sectionFour]],
  [sectionFour, []],
]);

const circuit = new Circuit({
  name: "TESTCIRCUIT",
  sections,
});

As an empty circuit

It is possible to create an empty circuit, without start locations, stop locations, or sections. In this scenario, isSectioned will be false until locations or sections are added to the Circuit.

const circuit = new Circuit({ name: "TESTCIRCUIT" });
See also

Constructors

Circuit

Constructor
new Circuit(properties)
Parameter
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Name Type Summary Class

User-defined attributes on the circuit.

Circuit

An instance of CircuitManager associated with the circuit.

Circuit

Indicates the type of the circuit.

Circuit

The global ID of the circuit.

Circuit

Whether the circuit has been logically deleted.

Circuit

Whether the circuit is defined by circuit sections.

Circuit

The last time the circuit was exported.

Circuit

The last time the circuit was verified.

Circuit

The name of the circuit.

Circuit

A map representing the logical connectivity between circuit sections as a directed adjacency list.

Circuit

The feature or object associated with the start location of the circuit.

Circuit

Indicates the status of the circuit.

Circuit

The feature or object associated with the stop location of the circuit.

Circuit

The subcircuits that the circuit is subdivided into.

Circuit

Property Details

attributes

Property
attributes HashMap<any> |null |undefined

User-defined attributes on the circuit.

circuitManager

Property
circuitManager CircuitManager |null |undefinedautocast

An instance of CircuitManager associated with the circuit.

This is updated when a circuit is successfully created or altered with CircuitManager.create() or CircuitManager.alter().

circuitType

Property
circuitType Stringautocast

Indicates the type of the circuit.

A virtual circuit does not require traversability between its start and stop locations. If a virtual circuit is also a sectioned circuit, the circuit must have at least one virtual section.

Possible Values:"physical" |"virtual"

globalId

Property
globalId String |null |undefined

The global ID of the circuit.

isDeleted

Property
isDeleted Booleanreadonly

Whether the circuit has been logically deleted.

isSectioned

Property
isSectioned Booleanreadonly

Whether the circuit is defined by circuit sections.

lastExportedTime

Property
lastExportedTime Date |null |undefinedreadonly

The last time the circuit was exported.

lastVerifiedTime

Property
lastVerifiedTime Date |null |undefinedreadonly

The last time the circuit was verified.

name

Property
name String

The name of the circuit. This name is unique within the domain network.

sections

Property
sections Map<CircuitSection, CircuitSection[]> |null |undefined

A map representing the logical connectivity between circuit sections as a directed adjacency list. Each key is a CircuitSection that connects to the other CircuitSection instances indicated by the key's value.

For example, consider the following keys and values, where each number is a section ID:

{
  "1": [2, 3],
  "2": [4],
  "3": [4],
  "4": [],
}

In this example, section 1 connects to 2 and 3 (where sections 2 and 3 are in parallel), 2 connects to 4, 3 connects to 4, and 4 connects to nothing (is the end of the circuit).

This connectivity between sections is graphically represented as:

  1
 / \
2   3
 \ /
  4
Example
const sectionOne = new CircuitSection({
  sectionId: 1,
  subcircuit: new Subcircuit({ name: "SUBCIRCUITVALUE1" }),
});

const sectionTwo = new CircuitSection({
  sectionId: 2,
  subcircuit: new Subcircuit({ name: "SUBCIRCUITVALUE2" }),
});

const sectionThree = new CircuitSection({
  sectionId: 3,
  subcircuit: new Subcircuit({ name: "SUBCIRCUITVALUE3" }),
});

const sectionFour = new CircuitSection({
  sectionId: 4,
  subcircuit: new Subcircuit({ name: "SUBCIRCUITVALUE4" }),
});

const sections = new Map([
  [sectionOne, [sectionTwo, sectionThree]],
  [sectionTwo, [sectionFour]],
  [sectionThree, [sectionFour]],
  [sectionFour, []],
]);

const circuit = new Circuit({
  name: "TESTCIRCUIT",
  sections,
});

startLocation

Property
startLocation CircuitLocation |null |undefinedautocast

The feature or object associated with the start location of the circuit. This property is null if the circuit is sectioned.

status

Property
status Stringreadonly

Indicates the status of the circuit.

The circuit status is initially "dirty" and remains dirty until the circuit is validated. The circuit status is "clean" when the circuit has been successfully validated. The circuit status returns to "clean" if any circuit components are modified.

Possible Values:"clean" |"dirty"

stopLocation

Property
stopLocation CircuitLocation |null |undefinedautocast

The feature or object associated with the stop location of the circuit. This property is null if the circuit is sectioned.

subcircuits

Property
subcircuits Subcircuit[]autocast

The subcircuits that the circuit is subdivided into.

Method Overview

Name Return Type Summary Class
*

Returns the value of the specified attribute.

Circuit

Returns the CircuitSection instance with a specified section ID from the circuit's sections.

Circuit
void

Sets a new value for the specified attribute.

Circuit
void

Sets the sections of the circuit.

Circuit
void

Sets the start and stop locations of the circuit.

Circuit

Method Details

getAttribute

Method
getAttribute(name){*}

Returns the value of the specified attribute.

Parameter
name String

The name of the attribute.

Returns
Type Description
* Returns the value of the attribute specified by name.

getSectionById

Method
getSectionById(sectionId){CircuitSection |null |undefined}

Returns the CircuitSection instance with a specified section ID from the circuit's sections.

Parameter
sectionId Number

The section ID of the section to retrieve.

Returns
Type Description
CircuitSection | null | undefined The circuit section with the specified ID, if one exists in the circuit.

setAttribute

Method
setAttribute(name, newValue){void}

Sets a new value for the specified attribute.

Parameters
name String

The name of the attribute to set.

newValue *

The new value to set on the named attribute.

Returns
Type Description
void

setSections

Method
setSections(sections){void}

Sets the sections of the circuit. This method sets the circuit's startLocation and stopLocation to null, making this a sectioned circuit.

Parameter

The circuit's sections.

Returns
Type Description
void

setStartStopLocations

Method
setStartStopLocations(startLocation, stopLocation){void}

Sets the start and stop locations of the circuit. This method sets the circuit's sections to null, making this a non-sectioned circuit.

Parameters
startLocation CircuitLocation

The start location of the circuit.

stopLocation CircuitLocation

The stop location of the circuit.

Returns
Type Description
void

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.