Commit a0e412f1 authored by Adam Wujek's avatar Adam Wujek 💬

Merge branch "www"

parents 607129b7 77170df3
......@@ -24,7 +24,8 @@ TEX=$(SRC:.md=.tex)
DOC=$(SRC:.md=.doc)
## Pandoc arguments
OPTIONS=-f markdown --toc --number-sections --smart
EXTENSIONS=+definition_lists
OPTIONS=-f markdown$(EXTENSIONS) --toc --number-sections --smart
TEMPLATE=pandoc.latex
......
......@@ -55,6 +55,10 @@
%% Generic
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
$if(url)$
\usepackage{url}
$endif$
......
......@@ -83,6 +83,9 @@ conditions
1.3 05/08/2014 Benoit Rat\ Updating for v4.2 release
[Seven Solutions]
1.4 15/05/2017 Benoit Rat\ Updating for v5.0.1 release
[Seven Solutions]
------------------------------------------------------------------------
\clearpage
......@@ -92,32 +95,46 @@ conditions
DHCP
: The Dynamic Host Configuration Protocol to obtain network configuration.
FMC
: FPGA Mezzanine Card, an ANSI standard for mezzanine card form factor.
: FPGA Mezzanine Card, an ANSI standard for mezzanine card form factor.
HDL
: Hardware description language.
: Hardware description language.
LM32
: LatticeMico32 is a 32-bit microprocessor soft core optimized for field-programmable gate arrays (FPGAs).
: LatticeMico32 is a 32-bit microprocessor soft core optimized for field-programmable gate arrays (FPGAs).
NAND
: NAND Flash Memory, a type of reprogrammable non-volatile computer memory.
: NAND Flash Memory, a type of reprogrammable non-volatile computer memory.
PCIe
: Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard.
: Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard.
PTP
: Precise Time Protocol, a time synchronization protocol.
: Precise Time Protocol, a time synchronization protocol.
SMC
: SubMiniature version C, coaxial connector used in radio-frequency circuits.
: SubMiniature version C, coaxial connector used in radio-frequency circuits.
SFP
: Small form-factor pluggable transceiver, a hot-pluggable transceiver for optical fiber.
: Small form-factor pluggable transceiver, a hot-pluggable transceiver for optical fiber.
SPEC
: Simple PCIe FMC carrier.
: Simple PCIe FMC carrier.
SVEC
: Simple VME FMC carrier.
: Simple VME FMC carrier.
UART
: Universal Asynchronous Receiver/Transmitter.
: Universal Asynchronous Receiver/Transmitter.
WR
: White Rabbit.
: White Rabbit.
WRS
: White Rabbit Switch.
: White Rabbit Switch.
WMI
: Web Management Interface
......@@ -514,6 +531,21 @@ wait until the WRS has reboot.
> **Notes**: A NTP server should be provided for the grandmaster switch
so that we can distribute the current TAI seconds to the whole WR network
### Using menuconfig
Another way to modify the parameters to configure the [WRS] in Grandmaster is by
[opening an SSH terminal](#login-via-ssh) and then run the command:
make -C /wr/etc/ menuconfig
You will get a menu to directly modify the `dot-config` but with a more friendly[^termdisplay] interface.
Then just go to `Timing Mode`, select `Grand-Master`, `Save`, `Exit`.
Your WRS is now ready to be in GM mode at next reboot.
[^termdisplay]: With some small terminal size, or while using minicom the ncurse interface does not behave well,
and the menuconfig is not properly displayed.
### By editing the dot-config file in a terminal
If you prefer to configure the [WRS] using a terminal you should open the `dot-config` file
......@@ -541,7 +573,6 @@ CONFIG_TIME_GM=y
and finally you need to `reboot` the switch.
Non-DHCP user
---------------
......@@ -742,6 +773,16 @@ Specification
| **DAC** | 2xAD5662BRJ (16bit; 2.7-5.54V) |
+--------------------+-------------------------------------------------+
+--------------------+-------------------------------------------------+
| ***SMC I/O *** | |
+====================+=================================================+
| **PPS input** | TTL Level (2-5V High); 0.4mA (50Ohm disabled |
| | by default) / 4.4mA (when 50Ohm enabled) |
+--------------------+-------------------------------------------------+
| **10MHz input** | 250mV (rms) @ 50Ohm -> ~1dB |
+--------------------+-------------------------------------------------+
+--------------------+-------------------------------------------------+
| ***Others*** | |
+====================+=================================================+
......@@ -809,8 +850,7 @@ executing the following command:
~~~~~{.bash}
#On the WRS
wrs_version > /tmp/bug_report.txt
rtu_stat >> /tmp/bug_report.txt
wrs_version -t > /tmp/bug_report.txt
dmesg >> /tmp/bug_report.txt
#Obtain the IP of the switch
......@@ -830,7 +870,7 @@ Contact-Us
To contact Seven Solutions company please use:
* <info@sevensols.com>
* <support@sevensols.com>
* (+34) 958 285 024
* <http://www.sevensols.com>
......@@ -861,15 +901,15 @@ Please be responsible and protect our environment.
References
==============
* [wrs-3/18.pdf]: Datasheet for the White Rabbit Switch v3 - 18 SFPs
* [wrs-user-manual.pdf]: User manual documentation of the tools.
* [wr_external_reference.pdf]: Connect the [WRS] in GrandMaster mode.
* [whiterabbitsolution]: White Rabbit as a complete timing solutions
* [WRS Wiki]: White Rabbit Switch Wiki on ohwr.org
* [WRS FAQ]: WR-Switch Frequently Added Questions
* [wr-switch-testing]: Project for testing the switch itself
* [SFPs Wiki]: Type of SFP supported by the [WRS]
* [latest stable release]: http://www.sevensols.com/dl/wr-switch-sw/bin/latest_stable.tar.gz
* [wrs-3/18.pdf] : Datasheet for the White Rabbit Switch v3 - 18 SFPs
* [wrs-user-manual.pdf] : User manual documentation of the tools.
* [wr_external_reference.pdf] : Connect the [WRS] in GrandMaster mode.
* [whiterabbitsolution] : White Rabbit as a complete timing solutions
* [WRS Wiki] : White Rabbit Switch Wiki on ohwr.org
* [WRS FAQ] : WR-Switch Frequently Added Questions
* [wr-switch-testing] : Project for testing the switch itself
* [SFPs Wiki] : Type of SFP supported by the [WRS]
* [latest stable release] : `http://www.sevensols.com/dl/wr-switch-sw/bin/latest_stable.tar.gz`
<!-- List of links -->
......
......@@ -308,6 +308,11 @@ table.altrowstablesmall input {
font-size: 100%;
}
#endpointconfig table.altrowstablesmall input {
width: 45px;
font-size: 100%;
}
table.altrowstabledash {
font-family: verdana,arial,sans-serif;
font-size: 11px;
......@@ -467,7 +472,12 @@ element.style {
}
.center {
margin-left:auto;
margin-right:auto;
text-align:center;
margin-left:auto;
margin-right:auto;
text-align:center;
}
table.fiberstable td {
width: auto !important;
}
......@@ -19,12 +19,16 @@ if(empty($_SESSION["KCONFIG"])){
load_kconfig();
}
if(empty($_SESSION["WRSVERSION"])){
$_SESSION["WRSVERSION"] = shell_exec("/wr/bin/wrs_version -g");
}
// Forms are firstly generated by default, but can be modified by users.
$WRS_TABLE_INFO = Array (
'DASHBOARD' => Array(
'DASHBOARD_00' => Array(
'name' => 'HOSTNAME',
'name' => 'Hostname',
'value' => $_SESSION["WRS_INFO"][HOSTNAME],
),
'DASHBOARD_02' => Array(
......@@ -32,89 +36,89 @@ $WRS_TABLE_INFO = Array (
'value' => $_SESSION["WRS_INFO"][IPADDRESS],
),
'DASHBOARD_03' => Array(
'name' => 'MACADDRESS',
'name' => 'MAC Address',
'value' => $_SESSION["WRS_INFO"][MACADDRESS],
),
'DASHBOARD_04' => Array(
'name' => 'KERNEL',
'name' => 'Kernel Version',
'value' => $_SESSION["WRS_INFO"][KERNEL],
),
'DASHBOARD_05' => Array(
'name' => 'FIRMWARE',
'name' => 'Firmware Version',
'value' => $_SESSION["WRS_INFO"][FIRMWARE],
),
'DASHBOARD_06' => Array(
'name' => 'HARDWARE',
'name' => 'Hardware Version',
'value' => $_SESSION["WRS_INFO"][HARDWARE],
),
'DASHBOARD_07' => Array(
'name' => 'FPGA',
'name' => 'FPGA type',
'value' => $_SESSION["WRS_INFO"][FPGA],
),
'DASHBOARD_08' => Array(
'name' => 'MANUFACTURER',
'name' => 'Manufacturer',
'value' => $_SESSION["WRS_INFO"][MANUFACTURER],
),
'DASHBOARD_09' => Array(
'name' => 'SERIALNUMBER',
'name' => 'Serial Number',
'value' => $_SESSION["WRS_INFO"][SERIALNUMBER],
),
'DASHBOARD_10' => Array(
'name' => 'KERNELCOMPILEDDATE',
'name' => 'Kernel Compiled Date',
'value' => $_SESSION["WRS_INFO"][KERNELCOMPILEDDATE],
),
),
'CONTACT' => Array (
'CONTACT_00' => Array(
'name' => 'FIRMWARE',
'name' => 'Firmware Version',
'value' => $_SESSION["WRS_INFO"][FIRMWARE],
),
'CONTACT_01' => Array(
'name' => 'KERNEL',
'name' => 'Kernel Version',
'value' => $_SESSION["WRS_INFO"][KERNEL],
),
'CONTACT_02' => Array(
'name' => 'COMPILEDBY',
'name' => 'Compiled By',
'value' => $_SESSION["WRS_INFO"][COMPILEDBY],
),
'CONTACT_03' => Array(
'name' => 'KERNELCOMPILEDDATE',
'name' => 'Kernel Compiled Date',
'value' => $_SESSION["WRS_INFO"][KERNELCOMPILEDDATE],
),
'CONTACT_04' => Array(
'name' => 'HARDWARE',
'name' => 'Hardware Version',
'value' => $_SESSION["WRS_INFO"][HARDWARE],
),
'CONTACT_05' => Array(
'name' => 'FPGA',
'name' => 'FPGA Version',
'value' => $_SESSION["WRS_INFO"][FPGA],
),
'CONTACT_06' => Array(
'name' => 'MANUFACTURER',
'name' => 'Manufacturer',
'value' => $_SESSION["WRS_INFO"][MANUFACTURER],
),
'CONTACT_07' => Array(
'name' => 'SERIALNUMBER',
'name' => 'Serial Number',
'value' => $_SESSION["WRS_INFO"][SERIALNUMBER],
),
'CONTACT_08' => Array(
'name' => 'GATEWARE',
'name' => 'Gateware Version',
'value' => $_SESSION["WRS_INFO"][GATEWARE],
),
'CONTACT_09' => Array(
'name' => 'GATEWAREBUILD',
'name' => 'Gateware Build',
'value' => $_SESSION["WRS_INFO"][GATEWAREBUILD],
),
'CONTACT_10' => Array(
'name' => 'WRSHDLCOMMIT',
'name' => 'WR Switch HDL Commit',
'value' => $_SESSION["WRS_INFO"][WRSHDLCOMMIT],
),
'CONTACT_11' => Array(
'name' => 'GCORESCOMMIT',
'name' => 'General Cores Commit',
'value' => $_SESSION["WRS_INFO"][GCORESCOMMIT],
),
'CONTACT_12' => Array(
'name' => 'WRCORESCOMMIT',
'name' => 'WR Cores Commit',
'value' => $_SESSION["WRS_INFO"][WRCORESCOMMIT],
),
),
......@@ -139,35 +143,63 @@ $WRS_FORMS = Array(
'SYSTEM_LOGS' => Array(
'SYSTEM_LOGS_00' => Array(
'key' => "CONFIG_WRS_LOG_HAL",
'name' => "HAL log",
'name' => "Logging directions for the WR HAL",
'value' => $_SESSION["KCONFIG"]["CONFIG_WRS_LOG_HAL"],
'vname' => "loghal",
),
'SYSTEM_LOGS_01' => Array(
'key' => "CONFIG_WRS_LOG_LEVEL_HAL",
'name' => "Logging verbosity level for the WR HAL",
'value' => $_SESSION["KCONFIG"]["CONFIG_WRS_LOG_LEVEL_HAL"],
'vname' => "loglevelhal",
),
'SYSTEM_LOGS_02' => Array(
'key' => "CONFIG_WRS_LOG_RTU",
'name' => "RTU log",
'name' => "Logging directions for the RTU daemon",
'value' => $_SESSION["KCONFIG"]["CONFIG_WRS_LOG_RTU"],
'vname' => "logrtu",
),
'SYSTEM_LOGS_02' => Array(
'SYSTEM_LOGS_03' => Array(
'key' => "CONFIG_WRS_LOG_LEVEL_RTU",
'name' => "Logging verbosity level for the RTU daemon",
'value' => $_SESSION["KCONFIG"]["CONFIG_WRS_LOG_LEVEL_RTU"],
'vname' => "loglevelrtu",
),
'SYSTEM_LOGS_04' => Array(
'key' => "CONFIG_WRS_LOG_PTP",
'name' => "PTP log",
'name' => "Logging directions for the PTP daemon",
'value' => $_SESSION["KCONFIG"]["CONFIG_WRS_LOG_PTP"],
'vname' => "logptp",
),
'SYSTEM_LOGS_03' => Array(
'SYSTEM_LOGS_05' => Array(
'key' => "CONFIG_WRS_LOG_LEVEL_PTP",
'name' => "Logging verbosity level for the PTP daemon",
'value' => $_SESSION["KCONFIG"]["CONFIG_WRS_LOG_LEVEL_PTP"],
'vname' => "loglevelptp",
),
'SYSTEM_LOGS_06' => Array(
'key' => "CONFIG_WRS_LOG_OTHER",
'name' => "other applications log",
'name' => "Logging directions for other programs",
'value' => $_SESSION["KCONFIG"]["CONFIG_WRS_LOG_OTHER"],
'vname' => "logother",
),
'SYSTEM_LOGS_04' => Array(
'SYSTEM_LOGS_07' => Array(
'key' => "CONFIG_WRS_LOG_LEVEL_OTHER",
'name' => "Logging verbosity level for other programs",
'value' => $_SESSION["KCONFIG"]["CONFIG_WRS_LOG_LEVEL_OTHER"],
'vname' => "loglevelother",
),
'SYSTEM_LOGS_08' => Array(
'key' => "CONFIG_WRS_LOG_MONIT",
'name' => "Monitor log",
'name' => "Monit log",
'value' => $_SESSION["KCONFIG"]["CONFIG_WRS_LOG_MONIT"],
'vname' => "logmonit",
),
'SYSTEM_LOGS_05' => Array(
'SYSTEM_LOGS_09' => Array(
'key' => "CONFIG_WRS_LOG_SNMPD",
'name' => "SNMPd log",
'value' => $_SESSION["KCONFIG"]["CONFIG_WRS_LOG_SNMPD"],
......
......@@ -12,6 +12,17 @@
*
*/
#Save info to temp file so we dont have to execute command at each call
if(empty($_SESSION["WRSVERSIONTMP"])){
$file_version = "/tmp/www_wrs_version.txt";
if (!file_exists($file_version)) {
$_SESSION["WRSVERSIONTMP"] = shell_exec("/wr/bin/wrs_version -t | tee > ".$file_version);
} else {
$_SESSION["WRSVERSIONTMP"] = shell_exec("cat ".$file_version);
}
}
$outputfilename = "/var/www/data/wrs-info.php";
......@@ -27,20 +38,19 @@ $options = Array (
Array ("HOSTNAME","Hostname","uname -n","y"),
Array ("KERNEL","Kernel Version","uname -r","y"),
Array ("KERNELCOMPILEDDATE","Kernel Compiled Date","uname -v","y"),
Array ("FIRMWARE","Firmware Version","/wr/bin/wrs_version | awk '{print $4}'","y"),
Array ("HARDWARE","Hardware Version","/wr/bin/wrs_version -t | grep 'scb\|back' | sort -r | sed 's/back/ back/' | sed 's/-version: /: v/'","y"),
Array ("FPGA","FPGA Version","/wr/bin/wrs_version -f","y"),
Array ("COMPILEDBY","Compiled By",'/wr/bin/wrs_version -v | cut -d " " -f 2-',"y"),
Array ("MANUFACTURER","Manufacturer","/wr/bin/wrs_version -t | grep 'manufacturer' | sed 's/[^:]*: //'","y"),
Array ("SERIALNUMBER","Serial Number","/wr/bin/wrs_version -t | grep 'serial' | sed 's/[^:]*: //'","y"),
Array ("GATEWARE","Gateware Version","/wr/bin/wrs_version -t | grep 'gateware-version' | sed 's/[^:]*: //'","y"),
Array ("GATEWAREBUILD","Gateware Build","/wr/bin/wrs_version -t | grep 'gateware-build' | sed 's/[^:]*: //'","y"),
Array ("WRSHDLCOMMIT","WR Switch HDL Commit","/wr/bin/wrs_version -t | grep 'wr_switch_hdl-commit' | sed 's/[^:]*: //'","y"),
Array ("GCORESCOMMIT","General Cores Commit","/wr/bin/wrs_version -t | grep 'general-cores-commit' | sed 's/[^:]*: //'","y"),
Array ("WRCORESCOMMIT","WR Cores Commit","/wr/bin/wrs_version -t | grep 'wr-cores-commit' | sed 's/[^:]*: //'","y"),
Array ("FIRMWARE","Firmware Version","/wr/bin/wrs_version | awk '{print $4}'","y"),
Array ("HARDWARE","Hardware Version","cat /tmp/www_wrs_version.txt | grep 'scb\|back' | sort -r | sed 's/back/ back/' | sed 's/-version: /: v/'","y"),
Array ("FPGA","FPGA Version","cat /tmp/www_wrs_version.txt | grep 'fpga-type' | sed 's/[^:]*: //'","y"),
Array ("COMPILEDBY","Compiled By","cat /tmp/www_wrs_version.txt | grep 'bult-by' | sed 's/[^:]*: //'","y"),
Array ("MANUFACTURER","Manufacturer","cat /tmp/www_wrs_version.txt | grep 'manufacturer' | sed 's/[^:]*: //'","y"),
Array ("SERIALNUMBER","Serial Number","cat /tmp/www_wrs_version.txt | grep 'serial' | sed 's/[^:]*: //'","y"),
Array ("GATEWARE","Gateware Version","cat /tmp/www_wrs_version.txt | grep 'gateware-version' | sed 's/[^:]*: //'","y"),
Array ("GATEWAREBUILD","Gateware Build","cat /tmp/www_wrs_version.txt | grep 'gateware-build' | sed 's/[^:]*: //'","y"),
Array ("WRSHDLCOMMIT","WR Switch HDL Commit","cat /tmp/www_wrs_version.txt | grep 'wr_switch_hdl-commit' | sed 's/[^:]*: //'","y"),
Array ("GCORESCOMMIT","General Cores Commit","cat /tmp/www_wrs_version.txt | grep 'general-cores-commit' | sed 's/[^:]*: //'","y"),
Array ("WRCORESCOMMIT","WR Cores Commit","cat /tmp/www_wrs_version.txt | grep 'wr-cores-commit' | sed 's/[^:]*: //'","y"),
);
// Code for wrs-info.php generation.
$output = '<?php
......
......@@ -28,7 +28,7 @@
save_kconfig();
apply_kconfig();
header ('Location: sfpcalibration.php');
header ('Location: sfpconfiguration.php');
?>
</div>
......
......@@ -3,6 +3,7 @@
<div class="main">
<div class="page">
<div class="header" >
<script type="text/javascript" src="js/func.js"></script>
<!--<h1>White-Rabbit Switch Tool</h1>-->
<div class="header-ports" ><?php wrs_header_ports(); ?></div>
<div class="topmenu">
......@@ -16,7 +17,7 @@
</div>
<div class="rightpanel">
<div class="rightbody">
<h1 class="title">Endpoint Calibration<a href='http://www.ohwr.org/projects/white-rabbit/wiki/Calibration' target='_blank'><img align=right src="./img/question.png"></a></h1>
<h1 class="title">Endpoint Configuration<a href='http://www.ohwr.org/projects/white-rabbit/wiki/Calibration' target='_blank'><img align=right src="./img/question.png"></a></h1>
<br>
<?php session_is_started() ?>
......@@ -28,16 +29,20 @@
<center>NOTE: If you do not know how to calibrate endpoints
please click on <a href='http://www.ohwr.org/projects/white-rabbit/wiki/Calibration'
target='_blank'> here </a>*<hr><br>";
$formatID = "alternatecolor";
$formatID = "alternatecolor1";
$class = "altrowstablesmall firstcol";
$infoname = "Endpoint Configuration";
//$size = "6";
if (strpos($_SESSION["KCONFIG"]["CONFIG_PORT01_PARAMS"],'proto=') !== false)
$header = array ("WR port","Protocol","Tx","Rx","Mode","Fiber");
if (strpos($_SESSION["KCONFIG"]["CONFIG_PORT01_PARAMS"],'monitor=') !== false)
$header = array (key=>"key",name=>"WR port",proto=>"Protocol",tx=>"&#916 Tx",rx=>"&#916 Rx",role=>"Mode",fiber=>"Fiber", monitor=>"Monitor", ext=>"Extension", dm=>"Delay Mechanism");
else if (strpos($_SESSION["KCONFIG"]["CONFIG_PORT01_PARAMS"],'proto=') !== false)
$header = array (key=>"key",name=>"WR port",proto=>"Protocol",tx=>"&#916 Tx",rx=>"&#916 Rx",role=>"Mode",fiber=>"Fiber");
else
$header = array ("WR port","Tx","Rx","Mode","Fiber");
$header = array (key=>"key",name=>"WR port",tx=>"&#916 Tx",rx=>"&#916 Rx",role=>"Mode",fiber=>"Fiber");
$matrix = array ("key=CONFIG_PORT01_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_PORT01_PARAMS"],
"key=CONFIG_PORT02_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_PORT02_PARAMS"],
"key=CONFIG_PORT03_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_PORT03_PARAMS"],
......@@ -57,28 +62,14 @@
"key=CONFIG_PORT17_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_PORT17_PARAMS"],
"key=CONFIG_PORT18_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_PORT18_PARAMS"],
);
print_multi_form($matrix, $header, $formatID, $class, $infoname, $size);
print_dynamic_multi_form($matrix, $header, $formatID, $class, $infoname, $size);
if(process_multi_form($matrix)){
save_kconfig();
apply_kconfig();
header ('Location: endpointcalibration.php');
}
$formatID = "alternatecolor1";
$class = "altrowstablesmall firstcol";
$infoname = "Available Fibers";
$size = "10";
$header = array ("#","Alpha");
$matrix = array ("id=0,key=CONFIG_FIBER00_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_FIBER00_PARAMS"],
"id=1,key=CONFIG_FIBER01_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_FIBER01_PARAMS"],
"id=2,key=CONFIG_FIBER02_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_FIBER02_PARAMS"],
"id=3,key=CONFIG_FIBER03_PARAMS,".$_SESSION["KCONFIG"]["CONFIG_FIBER03_PARAMS"]);
save_kconfig();
apply_kconfig();
print_multi_form($matrix, $header, $formatID, $class, $infoname, $size);
header ('Location: endpointconfiguration.php');
}
?>
</div>
......
......@@ -3,6 +3,7 @@
<div class="main">
<div class="page">
<div class="header" >
<script type="text/javascript" src="js/dropmodes.js"></script>
<!--<h1>White-Rabbit Switch Tool</h1>-->
<div class="header-ports" ><?php wrs_header_ports(); ?></div>
<div class="topmenu">
......@@ -25,20 +26,49 @@
//Load all
$modes = parse_endpoint_modes();
$names = array("slave", "auto", "non_wr", "none", "master");
echo '<table class="altrowstable" id="alternatecolor" style="width:100%;text-align:center">';
for($i = 0; $i < 9; $i++){
echo '<tr>';
echo '<th>wri'.($i+1).'</td>';
echo '<td><a href="modifymode.php?wri='.($i+1).'&mode='.$modes[$i].'">'.$modes[$i].'</a></th>';
echo '<th>wri' .($i+1). '</th>';
$tmp = $i+1;
echo '<td><select name="selected" id="selected-'.$tmp.'" class="drop">';
for ($j=0; $j<sizeof($names);$j++){
if($modes[$i] == $names[$j]){
echo '<option selected="selected" ">'.$modes[$i].'</option>';
}
else{
echo '<option value='. $names[$j] .'>'. $names[$j] .'</option>';
}
}
echo '</select></td>';
echo '<th>wri'.($i+10).'</th>';
echo '<td><a href="modifymode.php?wri='.($i+10).'&mode='.$modes[$i+9].'">'.$modes[$i+9].'</a></td>';
$tmp2 = $i+10;
echo '<td><select name="selected" id="selected-'.$tmp2.'" class="drop">';
for ($j=0; $j<sizeof($names);$j++){
if($modes[$i+9] == $names[$j]){
echo '<option selected="selected" ">'.$modes[$i+9].'</option>';
}
else{
echo '<option value='. $names[$j] .'>'. $names[$j] .'</option>';
}
}
echo '</select></td>';
echo '</tr>';
}
echo '</table>';
echo '<br>';
echo '<p align="right">Go to <a href="endpointcalibration.php">advanced mode</a></p>';
echo '<p align="right">Go to <a href="endpointconfiguration.php">advanced mode</a></p>';
?>
......
<?php include 'functions.php'; include 'head.php'; ?>
<body id="epcalib">
<div class="main">
<div class="page">
<div class="header" >
<script type="text/javascript" src="js/func.js"></script>
<!--<h1>White-Rabbit Switch Tool</h1>-->
<div class="header-ports" ><?php wrs_header_ports(); ?></div>
<div class="topmenu">
<?php include 'topmenu.php' ?>
</div>
</div>
<div class="content">
<div class="leftpanel">
<h2>Main Menu</h2>
<?php include 'menu.php' ?>
</div>
<div class="rightpanel">
<div class="rightbody">
<h1 class="title">Fiber Configuration<a href='http://www.ohwr.org/projects/white-rabbit/wiki/Calibration' target='_blank'><img align=right src="./img/question.png"></a></h1>
<br>
<?php session_is_started() ?>
<?php
// Warning message
echo "<hr>
<center>NOTE: If you do not know how to calibrate endpoints
please click on <a href='http://www.ohwr.org/projects/white-rabbit/wiki/Calibration'
target='_blank'> here </a>*<hr><br>";
$formatID = "alternatecolor1";
$class = "altrowstablesmall firstcol fiberstable";
$infoname = "Available Fibers";
$size = "3";
$header = array ("#","&#955tx", "&#955rx","Value");
$matrix = array ("key=CONFIG_FIBER00_PARAMS, id=0,".$_SESSION["KCONFIG"]["CONFIG_FIBER00_PARAMS"],
"key=CONFIG_FIBER01_PARAMS, id=1,".$_SESSION["KCONFIG"]["CONFIG_FIBER01_PARAMS"],
"key=CONFIG_FIBER02_PARAMS,id=2,".$_SESSION["KCONFIG"]["CONFIG_FIBER02_PARAMS"],
"key=CONFIG_FIBER03_PARAMS, id=3,".$_SESSION["KCONFIG"]["CONFIG_FIBER03_PARAMS"]);
//change string to match drawing function
$length = count($matrix);
for ($i = 0; $i < $length; $i++) {
$matrix[$i] = str_replace("alpha_", "tx=", $matrix[$i]);
$matrix[$i] = lreplace("_", ",rx=", $matrix[$i]);
$matrix[$i] = lreplace("=", ",val=", $matrix[$i]);
}
print_multi_form($matrix, $header, $formatID, $class, $infoname, $size);
if(process_multi_form($matrix)){
save_kconfig();
apply_kconfig();
header ('Location: fiberconfiguration.php');
}
?>
</div>
</div>
</div>
<div class="footer">
<?php include 'footer.php' ?>
</div>
</div>
</div>
</body>
</html>
......@@ -2,5 +2,9 @@
<a href='http://www.ohwr.org/projects/wr-switch-sw' target="_blank"><IMG SRC='img/ohr.png' align=left , vspace=7, hspace=5, width=35 , hight=100 , border=0 , alt='OHR'></a>
<p>White Rabbit Project - Open Hardware and Source Project <a class="footer-link" target="_blank"
href="http://www.ohwr.org/projects/white-rabbit/wiki">White-Rabbit OHR</a>
<a href='sysinfo.php' target="_blank"><IMG SRC='img/light_php.png' align=right , vspace=7, hspace=5, width=100 , hight=100 , border=0 , alt='PHP Info'></a>
<?php
if(isset($_SESSION['myusername'])) echo "<a href='sysinfo.php' target='_blank'>";
echo "<IMG SRC='img/light_php.png' align=right , vspace=7, hspace=5, width=100 , hight=100 , border=0 , alt='PHP Info'>";
if(isset($_SESSION['myusername'])) echo "</a>";
?>
</p>