Experiment ".
"$pid/".
"$eid\n";
echo "
\n";
SUBPAGESTART();
SUBMENUSTART("Experiment Options");
if ($expstate) {
if (TBExptLogFile($exp_pid, $exp_eid)) {
WRITESUBMENUBUTTON("View Activity Logfile",
"spewlogfile.php3?pid=$exp_pid&eid=$exp_eid");
}
if ($state == $TB_EXPTSTATE_ACTIVE) {
WRITESUBMENUBUTTON("Visualization, NS File, Mapping",
"shownsfile.php3?pid=$exp_pid&eid=$exp_eid");
}
else {
WRITESUBMENUBUTTON("Visualization and NS File",
"shownsfile.php3?pid=$exp_pid&eid=$exp_eid");
}
WRITESUBMENUBUTTON("Download NS File",
"spitnsdata.php3?pid=$exp_pid&eid=$exp_eid");
if (!$lockdown) {
# Swap option.
if ($isbatch) {
if ($expstate == $TB_EXPTSTATE_SWAPPED) {
WRITESUBMENUBUTTON("Queue Batch Experiment",
"swapexp.php3?inout=in&pid=$exp_pid&eid=$exp_eid");
}
elseif ($expstate == $TB_EXPTSTATE_ACTIVE ||
$expstate == $TB_EXPTSTATE_ACTIVATING) {
WRITESUBMENUBUTTON("Stop Batch Experiment",
"swapexp.php3?inout=out&pid=$exp_pid&eid=$exp_eid");
}
elseif ($expstate == $TB_EXPTSTATE_QUEUED) {
WRITESUBMENUBUTTON("Dequeue Batch Experiment",
"swapexp.php3?inout=pause&pid=$exp_pid&eid=$exp_eid");
}
}
else {
if ($expstate == $TB_EXPTSTATE_SWAPPED) {
WRITESUBMENUBUTTON("Swap Experiment In",
"swapexp.php3?inout=in&pid=$exp_pid&eid=$exp_eid");
}
elseif ($expstate == $TB_EXPTSTATE_ACTIVE ||
($expstate == $TB_EXPTSTATE_PANICED && $isadmin)) {
WRITESUBMENUBUTTON("Swap Experiment Out",
"swapexp.php3?inout=out&pid=$exp_pid&eid=$exp_eid");
}
elseif ($expstate == $TB_EXPTSTATE_ACTIVATING) {
WRITESUBMENUBUTTON("Cancel Experiment Swapin",
"swapexp.php3?inout=out".
"&pid=$exp_pid&eid=$exp_eid");
}
}
if ($expstate != $TB_EXPTSTATE_PANICED) {
WRITESUBMENUBUTTON("Terminate Experiment",
"endexp.php3?pid=$exp_pid&eid=$exp_eid");
}
# Batch experiments can be modifed only when paused.
if ($expstate == $TB_EXPTSTATE_SWAPPED ||
(!$isbatch && $expstate == $TB_EXPTSTATE_ACTIVE)) {
WRITESUBMENUBUTTON("Modify Experiment",
"modifyexp.php3?pid=$exp_pid&eid=$exp_eid");
}
}
if ($expstate == $TB_EXPTSTATE_ACTIVE) {
WRITESUBMENUBUTTON("Modify Traffic Shaping",
"delaycontrol.php3?pid=$exp_pid&eid=$exp_eid");
}
}
WRITESUBMENUBUTTON("Edit Experiment Metadata",
"editexp.php3?pid=$exp_pid&eid=$exp_eid");
#
# Admin and project/experiment leader get this option.
#
if ($expstate == $TB_EXPTSTATE_ACTIVE) {
if (TBExptAccessCheck($uid, $exp_pid, $exp_eid, $TB_EXPT_UPDATE)) {
WRITESUBMENUBUTTON("Update All Nodes",
"updateaccounts.php3?pid=$exp_pid&eid=$exp_eid");
}
# Reboot option
if (TBExptAccessCheck($uid, $exp_pid, $exp_eid, $TB_EXPT_MODIFY)) {
WRITESUBMENUBUTTON("Reboot All Nodes",
"boot.php3?pid=$exp_pid&eid=$exp_eid");
}
if (STUDLY()) {
WRITESUBMENUBUTTON(($linktest_running ?
"Stop LinkTest" : "Run LinkTest"),
"linktest.php3?pid=$exp_pid&eid=$exp_eid");
}
if (STUDLY() && $classes['pcvm']) {
WRITESUBMENUBUTTON("Record Feedback Data",
"feedback.php3?pid=$exp_pid&eid=$exp_eid&mode=record");
}
}
if (($expstate == $TB_EXPTSTATE_ACTIVE ||
$expstate == $TB_EXPTSTATE_SWAPPED) &&
STUDLY()) {
WRITESUBMENUBUTTON("Clear Feedback Data",
"feedback.php3?pid=$exp_pid&eid=$exp_eid&mode=clear");
if ($classes['pcvm']) {
WRITESUBMENUBUTTON("Remap Virtual Nodes",
"remapexp.php3?pid=$exp_pid&eid=$exp_eid");
}
}
# Wireless maps if experiment includes wireless lans.
if ($wireless) {
WRITESUBMENUBUTTON("Wireless Node Map",
"floormap.php3".
($expstate == $TB_EXPTSTATE_ACTIVE ?
"?pid=$exp_pid&eid=$exp_eid" : ""));
}
# History
WRITESUBMENUBUTTON("Show History",
"showstats.php3?showby=expt&which=$expindex");
if ($types['garcia']) {
WRITESUBMENUBUTTON("Robot Map",
"robotmap.php3".
($expstate == $TB_EXPTSTATE_ACTIVE ?
"?pid=$exp_pid&eid=$exp_eid" : ""));
}
# Blinky lights - but only if they have nodes of the correct type in their
# experiment
if ($classes['mote']) {
WRITESUBMENUBUTTON("Show Blinky Lights",
"moteleds.php3?pid=$exp_pid&eid=$exp_eid","moteleds");
}
if ($isadmin) {
if ($expstate == $TB_EXPTSTATE_ACTIVE) {
SUBMENUSECTION("Beta-Test Options");
WRITESUBMENUBUTTON("Restart Experiment",
"swapexp.php3?inout=restart&pid=$exp_pid".
"&eid=$exp_eid");
WRITESUBMENUBUTTON("Replay Events",
"replayexp.php3?&pid=$exp_pid&eid=$exp_eid");
SUBMENUSECTION("Admin Options");
WRITESUBMENUBUTTON("Send an Idle Info Request",
"request_idleinfo.php3?".
"&pid=$exp_pid&eid=$exp_eid");
WRITESUBMENUBUTTON("Send a Swap Request",
"request_swapexp.php3?".
"&pid=$exp_pid&eid=$exp_eid");
WRITESUBMENUBUTTON("Force Swap Out (Idle-Swap)",
"swapexp.php3?inout=out&force=1".
"&pid=$exp_pid&eid=$exp_eid");
SUBMENUSECTIONEND();
}
}
SUBMENUEND_2A();
echo "
";
SUBMENUEND_2B();
SHOWEXP($exp_pid, $exp_eid);
if (TBExptFirewall($exp_pid, $exp_eid) &&
($expstate == $TB_EXPTSTATE_ACTIVE ||
$expstate == $TB_EXPTSTATE_PANICED ||
$expstate == $TB_EXPTSTATE_ACTIVATING ||
$expstate == $TB_EXPTSTATE_SWAPPING)) {
echo "