method private port_to_positions port =
    let port = port + 1 in (* kludge to implement 0-based numbering... *)
    match lines, show_100_mbs, port <= (ports / 2) with
      1, false, _     -> [ port - 1, 0 ]
    | 2, falsetrue  -> [ port - 1, 0 ]
    | 2, falsefalse -> [ port - (ports / 2) - 1, 2 ]
    | 1, true, _      -> [ port - 1, 0; port - 1, 1 ]
    | 2, truetrue   -> [ port - 1, 0; port - 1, 1 ]
    | 2, truefalse  -> [ port - (ports / 2) - 1, 3; port - (ports / 2) - 1, 4 ]
    | _               -> assert false