Sample - Network Adapter: Pipeline Rule

Version 2

    Versions: 10.0.1 - current

    Product Availability: ArcFM Desktop

     

    This code sample creates a pipeline rule that can be used with Network Adapter. This pipeline rule creates a simple list of devices in the exported feeder and their downstream connected KVA. The pipeline rule outputs this list to the status window as well as a log file.

     

    The location of the log file is available if you select Tools > Options and select the Log File tab. You must select the checkbox on this tab to generate a log file.

    FeederLoad.png 

    Figure 1, downstream connected KVA highlighted in red box

     

    How to Implement:

    1. You may modify the code sample. This step is not required.
    2. Build the solution.
    3. Copy the DLL to the ArcFM Solution\bin directory. This file must exist in the same directory as NetworkAdapter.exe and NetworkAdapter.exe.config.

    How to Configure:

    To configure this pipeline rule for use, you will need to assign some model names in ArcCatalog and update the NetworkAdapter.exe.config configuration file. Follow the steps as outlined below.

    1. In ArcCatalog, assign the RATEDKVA field model name to the RatedKVA field on the Transformer feature class.
    2. Assign the MAXCURRENT field model name to the MaxContinuousCurrent field for any other exported devices (e.g., Switch, Fuse, DPD).
    3. Assign the FACILITYID field model name to the FacilityID of each exported device feature class (e.g., Switch, Fuse, DPD).
    4. Browse to NetworkAdapter.exe.config. By default, this file is installed here: C:\Program Files (x86)\Miner and Miner\ArcFM Solution\Bin.
    5. Open NetworkAdapter.exe.config using a text or XML editor (e.g., Notepad, XMLSpy). Do not use a word processing application such as WordPad or Microsoft Word as this may corrupt your XML.
    6. You'll add the new pipeline rule and the field model names to this configuration file. Look for the following XML:

    <FieldModelNames> <!-- Any field with any of these model names will be exported -->

       <add name="MULTISPEAKFIELD" />

       <add name="MULTISPEAKEXTENSION" />

       <add name="MULTISPEAKEQUIPMENT" />

       <add name="HIGHSIDECONFIGURATION" />

       <add name="LOWSIDECONFIGURATION" />

       <add name="FEEDERID" />

       <add name="SUBSTATIONID" />

       <add name="BAYID"/>

       <add name="LOWSIDEVOLTAGE" />

       <add name="OPERATINGVOLTAGE" />

       <add name="SCADACONTROLID" />

       <add name="FACILITYID" />

       <add name="MEASUREDLENGTH"/>

       <add name="FAULTINDICATORDIRECTION" />

       <add name="TAPCHANGEREQUIPMENT"/>

       <add name="TAPCHANGEREQUIPMENT1"/>

       <add name="TAPCHANGEREQUIPMENT2"/>

       <add name="TAPCHANGEREQUIPMENT3"/>

       <add name="TAPCHANGEREQUIPMENT4"/>

       </FieldModelNames>

    1. Add a line for each field model name assigned in steps 1-3: RATEDKVA, MAXCURRENT, FACILITYID. One or more of these field model names may already have an <add> tag in this list. If it does, you do not need to add it again. In the example above, you would only have to add the folowing two lines. FACILITYID is already in the list.

    <add name="RATEDKVA" />

    <add name="MAXCURRENT" />

    1. Next, you'll add the pipeline rule to the configuration file. Look for the following XML in the <PipelineRules> section.

    <!-- Adds relationships to the traced features -->

    <add name="Relationships"
      ChildName
    ="Features"
      type
    ="Miner.Geodatabase.Integration.Electric.GetRelationships, Miner.Geodatabase, Version=10.1.0.0, Culture=neutral, PublicKeyToken=196beceb052ed5dc" />

     

    <!-- Checks for Voltage consistency in the exported features -->

    <add name="Validate Voltage"
      ChildName
    ="Relationships"
      type
    ="Miner.Geodatabase.Integration.Electric.ValidateVoltages`1[[Miner.Geodatabase.Integration.ElectricExportScope, Miner.Geodatabase, Version=10.0.0.0, Culture=neutral, PublicKeyToken=196beceb052ed5dc]], Miner.Geodatabase, Version=10.0.0.0, Culture=neutral, PublicKeyToken=196beceb052ed5dc"
    />

        

    Child Pipeline Rules: Pipeline rules initialize from the bottom up, making the child rule always above its parent. Once initialized, the rules execute from the top of the list down.

    1. The first rule (name="Relationships") in the example above will be the child rule to your custom pipeline rule. Note that you can assign any name to your pipeline rule. In this example, we used FeederLoad. So add your custom pipeline rule after the Relationships rule (and before the Validate Voltage rule). Like this:

    <!-- Adds relationships to the traced features -->

    <add name="Relationships"
      ChildName
    ="Features"
      type
    ="Miner.Geodatabase.Integration.Electric.GetRelationships, Miner.Geodatabase, Version=10.0.0.0, Culture=neutral, PublicKeyToken=196beceb052ed5dc" />

     

    <!-- Custom Rule -->

    <add name="FeederLoad"
      ChildName
    ="Relationships"
      type
    ="Miner.Samples.NetworkAdapter.FeederLoad, Miner.Samples.NetworkAdapter, Version=1.0.0.0" />

     

    <!-- Checks for Voltage consistency in the exported features -->

    <add name="Validate Voltage"
      ChildName
    ="FeederLoad"
      type
    ="Miner.Geodatabase.Integration.Electric.ValidateVoltages`1[[Miner.Geodatabase.Integration.ElectricExportScope, Miner.Geodatabase, Version=10.1.0.0, Culture=neutral, PublicKeyToken=196beceb052ed5dc]], Miner.Geodatabase, Version=10.1.0.0, Culture=neutral, PublicKeyToken=196beceb052ed5dc"
    />

    1. The child to your custom rule (e.g., FeederLoad) is Relationships. So set the ChildName value on your custom pipeline rule to "Relationships."
    2. Your custom rule is the child to the rule that comes after it. So you will need to update the ChildName parameter on this rule as well. It should point to your custom rule (e.g., FeederLoad). The example above displays the correct ChildName assignments on all three rules.
    3. If you haven't already, you will need to set the database connection information in the Network Adapter configuration file. Refer to the Configuration Guide for specific information.
    4. Save and close NetworkAdapter.exe.config.

    How to Determine Where Your Custom Rule Goes in the Configuration

    The Network Adapter configuration file (NetworkAdapter.exe.config) includes a number of pipeline rules. These rules are initialized from the bottom up and executed from the top down. Child rules are determined during initialization. So a "child" rule will always be listed before its parent. This is important to remember when determining the value of the ChildName parameter.

     

    When determining where in the list to include a custom pipeline rule, it may be useful to know what these rules are doing as they are executed. Each rule in the configuration file is preceded by a comment that briefly summarizes what it does. This help file attempts to provide additional information.

     

    • The first three rules in the list (from the top) retrieve data from the database.
    • The next two rules (starting with "validate") perform validation on the data.
    • The Serialize rule puts the data into XML.
    • The next several rules (between Serialize and Save Data) transform the XML to prepare it for import into DMS.
    • The last rules save the XML and (if enabled) perform some tasks required by DMS and/or OASyS.

    A full list of the pipeline rules and their functions is available in the Configuration Guide.

    How to Use:

    When you run an export from NetworkAdapter.exe, the downstream connected KVA will appear in the status window at the bottom of the user interface (see Figure 1) and in the export log.

    Requires:

    All of the files shown below are required for the solution to build successfully.

     

    FileDescription
    Miner.Samples.NetworkAdapter.csprojC# project containing the code to generate a custom pipeline rule for use with Network Adapter.
    FeederLoad.csThe code implementing the custom pipeline rule that tabulates connected KVA for devices on the feeder.