Configuration

Overview

Utility measurement workflows can be configured to match your specific utility environment and business requirements. Configuration ranges from basic setups using defaults to fully customized inventory lists and measurement parameters.

VerticalMeasurementConfiguration

The VerticalMeasurementConfiguration struct is used to configure both pole and midspan measurements:

public struct VerticalMeasurementConfiguration {
    let type: UtilityMeasurementType          // .pole or .midspan
    let accuracy: MeasurementAccuracy          // .standardAccuracy or .highAccuracy
    let inventoryClasses: [InventoryClass]?    // Selectable options for pole attachments
    let wireClasses: [InventoryClass]?         // Selectable options for wires
    let guyWireOptions: [InventoryClass]?      // Selectable options for guy attachment options
    let ownerOptions: [String]?                // Selectable options for equipment owner
    let shouldCaptureAttachments: Bool?        // Allow user to select attachments in the field
}

Basic Configuration

The simplest way to start a utility workflow is with basic configuration using defaults:

// Basic pole measurement with default settings
let basicConfig = VerticalMeasurementConfiguration(
    type: .pole,
    accuracy: .standardAccuracy,
    inventoryClasses: nil,      
    wireClasses: nil,           
    guyWireOptions: nil,       
    ownerOptions: nil,          
    shouldCaptureAttachments: nil // Default behavior (true)
)

let result = try await cloneable.startVerticalMeasurement(config: basicConfig)

Advanced Configuration with Custom Inventory

For specialized utility environments, provide custom inventory options:

Complete Custom Configuration

let customConfig = VerticalMeasurementConfiguration(
    type: .pole,
    accuracy: .highAccuracy,
    
    // Custom pole attachments - these will override the default schema-based options
    inventoryClasses: [
        InventoryClass(name: "Transformer", subcategories: [
            InventorySubcategory(name: "KVA Rating", options: ["25", "50", "75", "100"], required: true),
            InventorySubcategory(name: "Phase", options: ["Single", "Three"], required: true),
            InventorySubcategory(name: "Mounting", options: ["Pole Mount", "Pad Mount"], required: false)
        ]),
        InventoryClass(name: "Capacitor Bank", subcategories: [
            InventorySubcategory(name: "KVAR Rating", options: ["300", "600", "900", "1200"], required: true),
            InventorySubcategory(name: "Control", options: ["Fixed", "Switched"], required: true)
        ]),
        InventoryClass(name: "Switch", subcategories: [
            InventorySubcategory(name: "Type", options: ["Manual", "Automatic", "Remote"], required: false),
            InventorySubcategory(name: "Voltage", options: ["12kV", "25kV", "35kV"], required: true)
        ]),
        InventoryClass(name: "Streetlight", subcategories: [
            InventorySubcategory(name: "Type", options: ["LED", "HPS", "Metal Halide"], required: false),
            InventorySubcategory(name: "Wattage", options: ["50W", "100W", "150W", "250W"], required: false)
        ])
    ],
    
    // Custom wire types
    wireClasses: [
        InventoryClass(name: "Primary Wire", subcategories: [
            InventorySubcategory(name: "Conductor", options: ["ACSR", "AAC", "AAAC", "Copper"], required: true),
            InventorySubcategory(name: "Size", options: ["1/0", "2/0", "4/0", "336", "477", "795"], required: true),
            InventorySubcategory(name: "Voltage", options: ["12kV", "25kV", "35kV"], required: true)
        ]),
        InventoryClass(name: "Secondary Wire", subcategories: [
            InventorySubcategory(name: "Type", options: ["Triplex", "Quadruplex", "Open Wire"], required: true),
            InventorySubcategory(name: "Size", options: ["2 AWG", "1/0 AWG", "2/0 AWG"], required: false)
        ]),
        InventoryClass(name: "Communication Cable", subcategories: [
            InventorySubcategory(name: "Type", options: ["Fiber Optic", "Coaxial", "Copper"], required: true),
            InventorySubcategory(name: "Count", options: ["12", "24", "48", "96"], required: false)
        ])
    ],
    
    // Custom guy wire options
    guyWireOptions: [
        InventoryClass(name: "3/8\" EHS Guy Wire", subcategories: [
            InventorySubcategory(name: "Grade", options: ["Common", "Siemens Martin"], required: false)
        ]),
        InventoryClass(name: "7/16\" EHS Guy Wire", subcategories: [
            InventorySubcategory(name: "Grade", options: ["Common", "Siemens Martin"], required: false)
        ]),
        InventoryClass(name: "1/2\" EHS Guy Wire", subcategories: [
            InventorySubcategory(name: "Grade", options: ["Common", "Siemens Martin"], required: false)
        ])
    ],
    
    // Custom owner options
    ownerOptions: [
        "City Power & Light",
        "Regional Electric Cooperative", 
        "State Utility Company",
        "Private Utility",
        "Municipal Electric",
        "Telecommunications Provider",
        "Cable Company"
    ],
    
    // Control whether to include attachments stage
    shouldCaptureAttachments: true
)

Configuration for Different Use Cases

Quick Survey Configuration

For rapid surveys where attachments will be documented separately:

let quickSurveyConfig = VerticalMeasurementConfiguration(
    type: .pole,
    accuracy: .standardAccuracy,
    inventoryClasses: nil,
    wireClasses: nil,
    guyWireOptions: nil,
    ownerOptions: ["City Electric", "Private"],  // Minimal owner list
    shouldCaptureAttachments: false  // Skip attachments stage for speed
)

High-Accuracy Inspection Configuration

For detailed inspections requiring precise measurements:

let inspectionConfig = VerticalMeasurementConfiguration(
    type: .pole,
    accuracy: .highAccuracy,
    inventoryClasses: detailedInventoryClasses,  // Comprehensive attachment list
    wireClasses: detailedWireClasses,
    guyWireOptions: detailedGuyOptions,
    ownerOptions: allUtilityOwners,
    shouldCaptureAttachments: true  // Full attachment documentation
)

Midspan-Specific Configuration

For span measurements focusing on conductors:

let midspanConfig = VerticalMeasurementConfiguration(
    type: .midspan,
    accuracy: .standardAccuracy,
    inventoryClasses: nil,              // Midspans typically don't have attachments
    wireClasses: conductorTypes,        // Focus on wire/conductor classification
    guyWireOptions: nil,
    ownerOptions: circuitOwners,
    shouldCaptureAttachments: false     // Midspans rarely have attachments
)

InventoryClass Structure

The InventoryClass structure allows for hierarchical categorization:

struct InventoryClass {
    let name: String                           // Main category name
    let subcategories: [InventorySubcategory] // Optional detailed classifications
}

struct InventorySubcategory {
    let name: String        // Subcategory name (e.g., "KVA Rating")
    let options: [String]   // Available options (e.g., ["25", "50", "75"])
    let required: Bool      // Whether this subcategory must be filled
}

Example: Complex Transformer Classification

let transformerClass = InventoryClass(
    name: "Distribution Transformer",
    subcategories: [
        InventorySubcategory(
            name: "KVA Rating", 
            options: ["15", "25", "37.5", "50", "75", "100", "167", "250"], 
            required: true
        ),
        InventorySubcategory(
            name: "Primary Voltage", 
            options: ["7200V", "12470V", "24940V", "34500V"], 
            required: true
        ),
        InventorySubcategory(
            name: "Secondary Voltage", 
            options: ["120/240V", "208Y/120V", "480Y/277V"], 
            required: true
        ),
        InventorySubcategory(
            name: "Phase", 
            options: ["Single", "Three"], 
            required: true
        ),
        InventorySubcategory(
            name: "Mounting", 
            options: ["Pole Mount", "Pad Mount", "Submersible"], 
            required: false
        )
    ]
)

Accuracy Settings

Standard Accuracy

  • Suitable for most utility surveying and maintenance work

  • Faster measurement process

  • Potential for greater than 6 inches of error

  • Single-point measurement methodology

High Accuracy

See our published report on accuracy: https://www.cloneable.ai/blog/accuracy-report

  • Requires a physical reference stick

  • More detailed measurement process with reference stick

  • Β±2 inch accuracy for height measurements

Configuration Validation

The system validates configurations at runtime:

// The system will use defaults for any nil values
// Empty arrays will disable those inventory categories
// Invalid configurations will throw descriptive errors

do {
    let result = try await cloneable.startVerticalMeasurement(config: config)
} catch VerticalMeasurementError.invalidConfiguration(let reason) {
    print("Configuration error: \(reason)")
} catch {
    print("Measurement failed: \(error)")
}

Best Practices

  1. Start Simple: Begin with basic configurations and add complexity as needed

  2. Test Configurations: Validate inventory options with field crews before deployment

  3. Document Choices: Keep records of which configurations work best for different scenarios

  4. Validate Required Fields: Ensure required subcategories have appropriate options

Last updated