Exemplo n.º 1
0
function OpticalFiberJoin_replaceCableLine($oldCableLine, $newCableLine, $NetworkNode, $tmpT = FALSE)
{
    $ofj = getNodeFibers($NetworkNode, -1, $oldCableLine, $tmpT);
    if (isset($ofj['error'])) {
        return $ofj;
    }
    foreach ($ofj['rows'] as $row) {
        $fiber = OpticalFiber_SELECT(0, array('CableLine' => $newCableLine, 'fiber' => $row['fiber']), $tmpT);
        OpticalFiberJoin_UPDATE(array('OpticalFiber' => $fiber['rows'][0]['id']), array('id' => $row['OFJ_id']), $tmpT);
    }
    return $ofj;
}
Exemplo n.º 2
0
     $ComboBox_CableLinePoint_Text[] = $cl_array['rows'][$i]['name'];
 }
 $smarty->assign("ComboBox_CableLines_values", $ComboBox_CableLinePoint_Values);
 $smarty->assign("ComboBox_CableLines_text", $ComboBox_CableLinePoint_Text);
 $cable1 = $cl_array['rows'][$res['CableLines'][$cableLineId1]]['name'];
 $smarty->assign("cable1", $cable1);
 $cableLineId2 = $_GET['mode'] == 'change' ? $_GET['clid2'] : $res['cl_array']['rows'][0]['clid'];
 $smarty->assign("ComboBox_CableLines_selected", $cableLineId2);
 $fibers = getFibers($networkNodeId, $cableLineId2, $fiber);
 $smarty->assign("Combobox_Fibers_selected", isset($_GET['fiber2']) ? $_GET['fiber2'] : '');
 $smarty->assign("ComboBox_Fibers_values", $fibers);
 $smarty->assign("ComboBox_Fibers_text", $fibers);
 if ($_GET['mode'] == 'change') {
     $OFJ_id = $_GET['spliceid'];
     $smarty->assign("SpliceId", $OFJ_id);
     $res = getNodeFibers($networkNodeId, $OFJ_id);
     $fso = $res['rows'][0]['FiberSpliceOrganizer'];
     $smarty->assign("attenuation", $res['rows'][0]['attenuation']);
     $smarty->assign("note", $res['rows'][0]['note']);
 } else {
     $smarty->assign("attenuation", '');
     $smarty->assign("note", '');
     $smarty->assign("SpliceId", '');
     $fso = '';
 }
 $res = getFiberSpliceOrganizerInfo(-1, -1, $networkNodeId);
 $ComboBox_FibersSpliceOrganizer_Values = array();
 $ComboBox_FibersSpliceOrganizer_Text = array();
 for ($i = 0; $i < $res['count']; $i++) {
     $ComboBox_FibersSpliceOrganizer_Values[] = $res['rows'][$i]['id'];
     $ComboBox_FibersSpliceOrganizer_Text[] = $res['rows'][$i]['id'] . " (" . $res['rows'][$i]['FiberSpliceOrganizationTypeMarking'] . ")";
Exemplo n.º 3
0
function getFiberTable($nodeID)
{
    $cl_array = getCableLineInfo($nodeID);
    $i = 0;
    $maxfiber = 0;
    if ($cl_array['count'] == 0) {
        // TODO: exit and return zero table
        return;
    }
    // Array of cableline points
    foreach ($cl_array['rows'] as $elem) {
        if ($maxfiber < $elem['fiber']) {
            $maxfiber = $elem['fiber'];
        }
        $CableLines[$elem['clid']] = $i++;
    }
    // Buiding array of fiber splices
    $fs_array = getNodeFibers($nodeID);
    $spliceArray = array();
    if ($fs_array['count'] > 0) {
        $rows = $fs_array['rows'];
        $i = 0;
        while ($i < count($rows) - 1) {
            if ($rows[$i]['OpticalFiberSplice'] == $rows[$i + 1]['OpticalFiberSplice']) {
                $ClA = condAssign($CableLines, $rows[$i]['CableLine'], -1);
                $ClB = condAssign($CableLines, $rows[$i + 1]['CableLine'], -1);
                $fA = $rows[$i]['fiber'];
                $fB = $rows[$i + 1]['fiber'];
                $FSO = $rows[$i]['FiberSpliceOrganizer'];
                $spliceId = $rows[$i]['OpticalFiberSplice'];
                $spliceArray[$ClA][$fA] = array($ClB, $fB, $rows[$i + 1]['OFJ_id'], $FSO, $spliceId);
                $spliceArray[$ClB][$fB] = array($ClA, $fA, $rows[$i]['OFJ_id'], $FSO, $spliceId);
                $i = $i + 2;
            } else {
                $i++;
            }
        }
    } else {
        $spliceArray = array();
    }
    $res['maxfiber'] = $maxfiber;
    $res['CableLines'] = $CableLines;
    $res['SpliceArray'] = $spliceArray;
    $res['cl_array'] = $cl_array;
    return $res;
}