{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://lzxindustries.net/eis/data/claim.schema.json",
 "title": "EIS claim file",
 "description": "One file per product: the conformance claim and everything EIS asks the product to publish. tools/claim.py --check validates it against the register.",
 "type": "object",
 "required": [
  "eis_edition",
  "product_type",
  "name",
  "maker"
 ],
 "properties": {
  "eis_edition": {
   "type": "string",
   "pattern": "^(v\\d+\\.\\d+\\.\\d+|draft)$",
   "description": "A released edition tag of the specification, or draft until one is tagged (clause 4.2)"
  },
  "product_type": {
   "type": "string",
   "enum": [
    "module",
    "enclosure",
    "bus board",
    "power supply",
    "power converter",
    "cable"
   ]
  },
  "features": {
   "description": "Features claimed, in capitals: PWR-BUS, PWR-DC12, PWR-A6 for each power domain the product takes at an entry or gives at an outlet; VID-REF-IN, VID-REF-OUT, VID-REF-PASSTHRU, VID-REF-LOOPTHRU for its video reference ports; VID-75 for a coaxial picture port or a coaxial cable; CTRL-USB. No product type implies a feature (clause 4.1).",
   "type": "array",
   "items": {
    "type": "string",
    "enum": [
     "PWR-BUS-IN",
     "PWR-BUS-OUT",
     "PWR-DC12-IN",
     "PWR-DC12-OUT",
     "PWR-A6-IN",
     "PWR-A6-OUT",
     "PWR-A15-IN",
     "PWR-A15-OUT",
     "VID-REF-IN",
     "VID-REF-OUT",
     "VID-REF-PASSTHRU",
     "VID-REF-LOOPTHRU",
     "CTRL-USB-DEV",
     "CTRL-USB-HOST"
    ]
   },
   "uniqueItems": true
  },
  "also_claims": {
   "type": "array",
   "items": {
    "type": "string",
    "enum": [
     "module",
     "enclosure",
     "bus board",
     "power supply",
     "power converter",
     "cable",
     "video distribution",
     "DC distribution"
    ]
   },
   "uniqueItems": true,
   "description": "Every other role the product plays beyond its product type, such as power supply and bus board for an enclosure with both built in; they join the claim line with +"
  },
  "todo": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "Figures the claim still has to publish; the claim is INCOMPLETE while any remain"
  },
  "name": {
   "type": "string",
   "minLength": 1
  },
  "maker": {
   "type": "string",
   "minLength": 1
  },
  "documentation": {
   "type": "string",
   "description": "URL or path of the manual that carries these figures"
  },
  "module": {
   "$ref": "#/$defs/module"
  },
  "enclosure": {
   "$ref": "#/$defs/enclosure"
  },
  "bus_board": {
   "$ref": "#/$defs/bus_board"
  },
  "power_supply": {
   "$ref": "#/$defs/power_supply"
  },
  "cable": {
   "$ref": "#/$defs/cable"
  },
  "dc_12": {
   "$ref": "#/$defs/dc_12"
  },
  "video_75": {
   "$ref": "#/$defs/video_75"
  },
  "power": {
   "$ref": "#/$defs/power"
  },
  "power_converter": {
   "type": "object",
   "description": "A power converter's mounting (SUP-008); its power is in power",
   "properties": {
    "heat_w": {
     "type": "number",
     "minimum": 0
    },
    "depth_mm": {
     "type": "number",
     "minimum": 0
    },
    "for": {
     "type": "string",
     "description": "The product or kind of product it powers"
    }
   }
  },
  "ctrl_usb": {
   "type": "object",
   "description": "CTRL-USB (clause 8.1): a device gives port, iproduct, and sysex_id; a case host gives host",
   "required": [
    "role"
   ],
   "properties": {
    "port": {
     "type": "string",
     "enum": [
      "USB-PH4"
     ],
     "description": "USB-001"
    },
    "iproduct": {
     "type": "string",
     "description": "The iProduct string; the product's name (USB-005)"
    },
    "sysex_id": {
     "type": "string",
     "description": "The maker's MIDI System Exclusive manufacturer ID, hex bytes; never 7D (USB-006)"
    },
    "units": {
     "type": "boolean",
     "description": "Serves ctrl-units-v1 (USB-012)"
    },
    "role": {
     "type": "string",
     "enum": [
      "device",
      "host"
     ],
     "description": "A CTRL-USB device, or a case host (clause 8.1)"
    },
    "host": {
     "type": "object",
     "description": "A case host's ports (USB-013) and computer link (USB-017)",
     "required": [
      "ports",
      "port_limit_a"
     ],
     "properties": {
      "ports": {
       "type": "integer",
       "minimum": 1
      },
      "port_limit_a": {
       "type": "number",
       "exclusiveMinimum": 0,
       "maximum": 0.5,
       "description": "USB-013"
      },
      "bridge": {
       "type": "boolean",
       "description": "Offers a computer link: 8.2 (USB-017)"
      }
     }
    }
   }
  }
 },
 "$defs": {
  "rails_a": {
   "type": "object",
   "required": [
    "plus12_a",
    "minus12_a"
   ],
   "properties": {
    "plus12_a": {
     "type": "number",
     "minimum": 0
    },
    "minus12_a": {
     "type": "number",
     "minimum": 0
    },
    "plus5_a": {
     "type": "number",
     "minimum": 0
    }
   }
  },
  "ripple_mvpp": {
   "type": "object",
   "description": "Ripple and noise, mV peak-to-peak per rail, measured per clause 6.2 (SUP-001)",
   "required": [
    "plus12",
    "minus12"
   ],
   "properties": {
    "plus12": {
     "type": "number",
     "exclusiveMinimum": 0
    },
    "minus12": {
     "type": "number",
     "exclusiveMinimum": 0
    },
    "plus5": {
     "type": "number",
     "exclusiveMinimum": 0
    }
   }
  },
  "port": {
   "type": "object",
   "required": [
    "name",
    "class"
   ],
   "properties": {
    "name": {
     "type": "string"
    },
    "class": {
     "type": "string",
     "description": "A class from data/signals.json (a patch class, or an Annex I class such as VID-CVBS for a coaxial picture port), or unclassified"
    },
    "direction": {
     "type": "string",
     "enum": [
      "in",
      "out",
      "in_out"
     ]
    },
    "formats": {
     "type": "array",
     "items": {
      "type": "string"
     },
     "description": "EIS format IDs from data/video_timings.json for a picture port (informative; a patch jack lists none, SIG-015)"
    },
    "note": {
     "type": "string"
    },
    "range": {
     "type": "string",
     "enum": [
      "B1",
      "U1",
      "B5",
      "U5",
      "B10",
      "U10"
     ],
     "description": "The range the port claims (7.2 Ranges, SIG-014); the class default applies when omitted"
    },
    "bandwidth_mhz": {
     "type": "number",
     "exclusiveMinimum": 0,
     "description": "−3 dB bandwidth of a MOD-VIDEO path, input jack to this output jack, into 100 kΩ (7.2, recommended)"
    },
    "delay_ns": {
     "type": "number",
     "minimum": 0,
     "description": "Delay from the input jack to this output jack, in ns (7.2, recommended)"
    },
    "phase_ns": {
     "type": "number",
     "description": "Output offset after the video reference, horizontal, in ns (7.3, recommended)"
    },
    "jack": {
     "type": "string",
     "enum": [
      "RCA",
      "BNC",
      "SMA"
     ],
     "description": "The jack of a coaxial picture port"
    }
   }
  },
  "module": {
   "type": "object",
   "required": [
    "height_u",
    "width_hp",
    "depth_mm",
    "ports"
   ],
   "properties": {
    "height_u": {
     "type": "integer",
     "enum": [
      1,
      3
     ]
    },
    "width_hp": {
     "type": "integer",
     "minimum": 1
    },
    "depth_mm": {
     "type": "number",
     "minimum": 0,
     "description": "Behind the panel's back face, to the deepest point (PANEL-003)"
    },
    "current_a": {
     "$ref": "#/$defs/rails_a",
     "description": "Earlier claim files; read for this edition and converted to power"
    },
    "power_headers": {
     "type": "integer",
     "minimum": 0,
     "default": 1,
     "description": "Earlier claim files; read for this edition and converted to power"
    },
    "ports": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/port"
     }
    },
    "other_power_entry": {
     "type": "string",
     "description": "A power entry outside the EIS domains, named for the reader; such a module claims no power domain and lists no EIS entry, and may still claim Core and the other features"
    }
   }
  },
  "enclosure": {
   "type": "object",
   "required": [
    "rows",
    "screw_length_mm"
   ],
   "properties": {
    "rack_mount": {
     "type": "boolean"
    },
    "rows": {
     "type": "array",
     "minItems": 1,
     "items": {
      "type": "object",
      "required": [
       "id",
       "height_u",
       "width_hp",
       "clear_depth_mm"
      ],
      "properties": {
       "id": {
        "type": "string"
       },
       "height_u": {
        "type": "integer",
        "enum": [
         1,
         3
        ]
       },
       "width_hp": {
        "type": "integer",
        "minimum": 1
       },
       "clear_depth_mm": {
        "type": "number",
        "exclusiveMinimum": 0
       }
      }
     }
    },
    "screw_length_mm": {
     "type": "number",
     "enum": [
      6,
      8,
      10
     ],
     "description": "RAIL-011; M3"
    },
    "built_in_supply": {
     "$ref": "#/$defs/power_supply"
    },
    "built_in_bus_board": {
     "$ref": "#/$defs/bus_board"
    }
   }
  },
  "bus_board": {
   "type": "object",
   "required": [],
   "properties": {
    "header_count": {
     "type": "integer",
     "minimum": 1,
     "description": "Earlier claim files; read for this edition and converted to power"
    },
    "totals_a": {
     "$ref": "#/$defs/rails_a",
     "description": "Earlier claim files; read for this edition and converted to power"
    },
    "per_header_a": {
     "type": "number",
     "exclusiveMinimum": 0,
     "maximum": 2,
     "description": "Earlier claim files; read for this edition and converted to power"
    },
    "power": {
     "$ref": "#/$defs/power"
    }
   }
  },
  "power_supply": {
   "type": "object",
   "required": [],
   "properties": {
    "rating_a": {
     "$ref": "#/$defs/rails_a",
     "description": "Earlier claim files; read for this edition and converted to power"
    },
    "ripple_mvpp": {
     "$ref": "#/$defs/ripple_mvpp",
     "description": "Earlier claim files; read for this edition and converted to power"
    },
    "zero_v_to_earth": {
     "type": "string",
     "description": "Earlier claim files; read for this edition and converted to power"
    },
    "power": {
     "$ref": "#/$defs/power"
    }
   }
  },
  "cable": {
   "type": "object",
   "required": [],
   "properties": {
    "mates": {
     "type": "string",
     "enum": [
      "PWR-BUS",
      "VID-75",
      "PWR-DC12",
      "PWR-A6",
      "PWR-A15",
      "CTRL-USB"
     ],
     "description": "The interface the cable mates: PWR-BUS for a power ribbon, VID-75 for a coaxial cable, PWR-DC12, PWR-A6, PWR-A15, or CTRL-USB; the claim line names it in the parentheses"
    },
    "length_mm": {
     "type": "number",
     "exclusiveMinimum": 0
    },
    "conductor_awg": {
     "type": "integer"
    }
   }
  },
  "video_75": {
   "type": "object",
   "required": [
    "ports"
   ],
   "properties": {
    "ports": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "name",
       "mode"
      ],
      "properties": {
       "name": {
        "type": "string"
       },
       "mode": {
        "type": "string",
        "enum": [
         "COAX-IN",
         "COAX-OUT",
         "COAX-PASSTHRU",
         "COAX-LOOPTHRU"
        ]
       },
       "jack": {
        "type": "string",
        "enum": [
         "RCA",
         "BNC",
         "SMA"
        ]
       },
       "formats": {
        "type": "array",
        "items": {
         "type": "string"
        },
        "description": "EIS format IDs from data/video_timings.json on a VID-REF-IN or VID-REF-OUT port (VID-001)"
       },
       "note": {
        "type": "string"
       }
      }
     }
    }
   },
   "description": "The video reference ports behind the panel (clause 7.4); a coaxial picture port on the front is in module.ports with an Annex I class"
  },
  "dc_12": {
   "type": "object",
   "required": [
    "entry",
    "max_current_a",
    "input_v"
   ],
   "properties": {
    "entry": {
     "type": "string",
     "enum": [
      "DC-BAR21",
      "DC-BAR25",
      "DC-VH2",
      "DC-DIN4",
      "DC-MF6",
      "DC-MF8"
     ]
    },
    "max_current_a": {
     "type": "number",
     "exclusiveMinimum": 0,
     "description": "PWR-001"
    },
    "input_v": {
     "type": "object",
     "required": [
      "min",
      "max"
     ],
     "properties": {
      "min": {
       "type": "number"
      },
      "max": {
       "type": "number"
      }
     },
     "description": "DC-002"
    },
    "outputs": {
     "type": "array",
     "minItems": 1,
     "items": {
      "type": "string",
      "enum": [
       "DC-BAR21",
       "DC-VH2"
      ]
     },
     "description": "A DC distribution product's output connectors to modules (EIS-DC-009)"
    }
   },
   "description": "Earlier claim files; read for this edition and converted to power"
  },
  "rail_currents": {
   "type": "object",
   "description": "Current per rail in A, keyed by the rail names of data/power_domains.json: plus12, minus12, plus5 on the bus; v12 on PWR-DC12",
   "additionalProperties": {
    "type": "number",
    "minimum": 0
   }
  },
  "power_entry": {
   "type": "object",
   "required": [
    "domain",
    "connector",
    "current_a"
   ],
   "properties": {
    "domain": {
     "type": "string",
     "description": "A domain id from data/power_domains.json"
    },
    "connector": {
     "type": "string",
     "description": "bus: 10-pin or 16-pin; PWR-DC12: a DC entry variant"
    },
    "count": {
     "type": "integer",
     "minimum": 1,
     "default": 1
    },
    "current_a": {
     "$ref": "#/$defs/rail_currents",
     "description": "Maximum current taken on each rail at nominal voltage, 0 for a rail not drawn (PWR-001)"
    },
    "input_v": {
     "type": "object",
     "required": [
      "min",
      "max"
     ],
     "properties": {
      "min": {
       "type": "number"
      },
      "max": {
       "type": "number"
      }
     },
     "description": "PWR-DC12: the DC input range (DC-002)"
    }
   }
  },
  "power_outlet": {
   "type": "object",
   "required": [
    "domain",
    "connector",
    "each_a"
   ],
   "properties": {
    "domain": {
     "type": "string"
    },
    "connector": {
     "type": "string",
     "description": "bus: terminals, 10-pin, or 16-pin; PWR-DC12: DC-BAR21 or DC-VH2 to modules (DC-009)"
    },
    "count": {
     "type": "integer",
     "minimum": 1,
     "default": 1
    },
    "each_a": {
     "oneOf": [
      {
       "type": "number",
       "exclusiveMinimum": 0
      },
      {
       "$ref": "#/$defs/rail_currents"
      }
     ],
     "description": "Maximum current at each outlet of the group, per rail; one number when it is the same on every rail (PWR-002; a bus board header at most 2 A, BUS-012)"
    },
    "ripple_mvpp": {
     "type": "object",
     "additionalProperties": {
      "type": "number",
      "exclusiveMinimum": 0
     },
     "description": "A power supply's ripple and noise per rail, mV peak-to-peak, measured per clause 6.2 (SUP-001), below its domain's limit (SUP-007)"
    }
   }
  },
  "power": {
   "type": "object",
   "description": "Power entries and outlets by domain (clause 6.1)",
   "properties": {
    "entries": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/power_entry"
     }
    },
    "outlets": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/power_outlet"
     }
    },
    "total_a": {
     "type": "object",
     "additionalProperties": {
      "$ref": "#/$defs/rail_currents"
     },
     "description": "Per domain, the maximum delivered in total on each rail, when it has more than one outlet (PWR-002)"
    },
    "zero_v_to_earth": {
     "type": "string",
     "description": "A power supply: floating, or where 0 V is bonded to protective earth (GND-003)"
    }
   }
  }
 }
}
