ictdesigntools.cabling.splices¶
Fiber splices: which strand meets which, in which tray, and the splice diagram.
A FiberCable has its fibers in buffer tubes, numbered and coloured by the TIA-598 code
(strand gives a fiber's tube, colours and stripe). A SplicePlan joins fibers of cables
on the A side to fibers of cables on the B side, in splice trays; check finds fibers used
twice, fibers a cable doesn't have and trays over capacity; schedule lists every splice as
a row for a table or CSV; and splice_diagram draws a sheet to the Splice.me proposal for a
splice diagram standard: a title block, A cables in a column on the left and B cables on the
right (splitters too, as Splitter), and nothing between them but the splices, computed from
the plan instead of placed by hand; bedsheet puts a network's sheets on a grid of pages.
Each splice is a group with a Meta (kind splice) for to_svg(interactive=True), so
hovering one lights up the whole path from fiber to fiber.
>>> a, b = FiberCable("F1", 24), FiberCable("D1", 12)
>>> plan = SplicePlan([a], [b], tray_capacity=12)
>>> plan.join(a, 1, b, 1, count=12)
>>> [row[0] for row in schedule(plan)][:2], check(plan)
([1, 1], [])
>>> strand(a, 14)
Strand(fiber=14, tube=2, tube_color='Orange', color='Orange', stripe='', port='')
Splitter
dataclass
¶
A passive optical splitter as equipment on a splice sheet: inputs and outputs
pigtails, numbered as ports with the inputs first (input(k) and output(k) give a
port's number for SplicePlan.join). Pigtails take the colour code in each group.
SplicePlan
dataclass
¶
SplicePlan(
a: list[Item],
b: list[Item],
splices: list[Splice] = list(),
tray_capacity: int = 12,
name: str = "",
)
Cables and equipment (splitters) in a closure or panel on the A and B sides, and the splices between them. Every splice joins an A-side fiber to a B-side fiber, so a splitter goes on the side opposite both its feeder and the cables its outputs serve.
join ¶
join(
a: Item | str,
a_fiber: int,
b: Item | str,
b_fiber: int,
count: int = 1,
tray: int | None = None,
kind: str = "fusion",
) -> None
Splice count fibers in order, from a_fiber of a to b_fiber of b,
into the next free slots (filling each tray before the next unless tray is given).
Source code in src/ictdesigntools/cabling/splices.py
colors
cached
¶
The twelve colours as (name, abbreviation, hex), in TIA-598 order.
Source code in src/ictdesigntools/cabling/splices.py
color_of ¶
(colour, stripe) for a position in the sequence, from 1: 14 is ("Orange", "Black").
Source code in src/ictdesigntools/cabling/splices.py
strand ¶
strand(cable: Item, fiber: int) -> Strand
Fiber fiber of cable: its tube and colours (for a splitter, its port: tube 1
holds the inputs and tube 2 the outputs).
Source code in src/ictdesigntools/cabling/splices.py
check ¶
check(plan: SplicePlan) -> list[str]
Problems with a plan: unknown cables, fibers out of range or used twice, trays and slots over capacity or used twice.
Source code in src/ictdesigntools/cabling/splices.py
schedule ¶
schedule(plan: SplicePlan) -> list[tuple]
One row per splice, by tray and slot (see SCHEDULE_HEADER).
Source code in src/ictdesigntools/cabling/splices.py
splice_diagram ¶
splice_diagram(
plan: SplicePlan,
all_fibers: bool = False,
id_prefix: str = "",
) -> Drawing
The plan as a splice diagram sheet, in mm. Only spliced fibers are listed unless
all_fibers; spare fibers are then listed on their face with no splice. Splitters are
drawn in their column like cables (rule 4.4), their inputs and outputs in place of tubes.
id_prefix goes before each splice's Meta id, to keep ids apart on a bedsheet.
Source code in src/ictdesigntools/cabling/splices.py
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | |
bedsheet ¶
bedsheet(
sheets: list[SplicePlan | Drawing],
columns: int | None = None,
page: str = "A4",
margin: float = 10.0,
gap: float = 10.0,
title: str = "",
) -> Drawing
Every sheet of a network on one drawing (rules 5.1 to 5.4): each sheet on a portrait
page (A4 or Letter, or larger where a sheet doesn't fit, the same for every cell),
pages on a grid read left to right and top to bottom from the top-left, so the network's
central unit goes first, with gap between pages for room to breathe. Plans are drawn
with splice_diagram and their splice ids prefixed with the sheet number.