> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloneable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

## Overview

Configure utility measurement workflows for your utility environment and business requirements. Use defaults or custom inventory lists and measurement parameters.

## VerticalMeasurementConfiguration

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

```swift theme={null}
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

Use the default configuration to start a utility workflow:

```swift theme={null}
// 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

Provide custom inventory options for specialized utility environments:

### Complete custom configuration

```swift theme={null}
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

Use this configuration when attachments are documented separately:

```swift theme={null}
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

Use this configuration for detailed inspections:

```swift theme={null}
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

Use this configuration for conductor-focused span measurements:

```swift theme={null}
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:

```swift theme={null}
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

```swift theme={null}
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

* Use for most utility surveys and maintenance work.
* Complete measurements faster.
* Expect potential error exceeding 6 inches.
* Use a single-point measurement method.

### High Accuracy

<Info>
  See our published report on accuracy: [https://www.cloneable.ai/blog/accuracy-report](https://www.cloneable.ai/blog/accuracy-report)
</Info>

* Requires a physical reference stick.
* Uses a detailed reference-stick measurement process.
* Provides ±2 inch height accuracy.

## Configuration Validation

The system validates configurations at runtime:

```swift theme={null}
// 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

* Start with a basic configuration, then add complexity as needed.
* Validate inventory options with field crews before deployment.
* Record configurations that work for each scenario.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.