All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 42c467ae authored by Mac Newbold's avatar Mac Newbold

Minor fixes. Renamed reboot to cycle.

parent 0fd45560
...@@ -16,7 +16,7 @@ my @machines=(); ...@@ -16,7 +16,7 @@ my @machines=();
#set up main #set up main
my $main = MainWindow->new(); my $main = MainWindow->new();
$main->title("Power"); $main->title("vpower - Visual Power");
#$main->minsize( qw(200 100) ); #$main->minsize( qw(200 100) );
$main->configure(-background => $main_bg ); $main->configure(-background => $main_bg );
...@@ -47,43 +47,43 @@ my @mach; ...@@ -47,43 +47,43 @@ my @mach;
my @machvals; my @machvals;
$mach[1] = $mach[1] =
$frm1->Checkbutton(-variable=>\$machvals[1], -text=>"test1", $frm1->Checkbutton(-variable=>\$machvals[1], -text=>"tbpc01",
-background=>$main_bg, -width=>'6',-anchor=>'nw' -background=>$main_bg, -width=>'6',-anchor=>'nw'
)->pack(-side=>'top',-fill=>'x', -anchor=>'w'); )->pack(-side=>'top',-fill=>'x', -anchor=>'w');
$mach[2] = $mach[2] =
$frm1->Checkbutton(-variable=>\$machvals[2], -text=>"test2", $frm1->Checkbutton(-variable=>\$machvals[2], -text=>"tbpc02",
-background=>$main_bg, -width=>'6',-anchor=>'nw' -background=>$main_bg, -width=>'6',-anchor=>'nw'
)->pack(-side=>'top',-fill=>'x', -anchor=>'w'); )->pack(-side=>'top',-fill=>'x', -anchor=>'w');
$mach[3] = $mach[3] =
$frm1->Checkbutton(-variable=>\$machvals[3], -text=>"test3", $frm1->Checkbutton(-variable=>\$machvals[3], -text=>"tbpc03",
-background=>$main_bg, -width=>'6',-anchor=>'nw' -background=>$main_bg, -width=>'6',-anchor=>'nw'
)->pack(-side=>'top',-fill=>'x', -anchor=>'w'); )->pack(-side=>'top',-fill=>'x', -anchor=>'w');
$mach[4] = $mach[4] =
$frm1->Checkbutton(-variable=>\$machvals[4], -text=>"test4", $frm1->Checkbutton(-variable=>\$machvals[4], -text=>"tbpc04",
-background=>$main_bg, -width=>'6',-anchor=>'nw' -background=>$main_bg, -width=>'6',-anchor=>'nw'
)->pack(-side=>'top',-fill=>'x', -anchor=>'w'); )->pack(-side=>'top',-fill=>'x', -anchor=>'w');
$mach[5] = $mach[5] =
$frm1->Checkbutton(-variable=>\$machvals[5], -text=>"test5", $frm1->Checkbutton(-variable=>\$machvals[5], -text=>"tbpc05",
-background=>$main_bg, -width=>'6',-anchor=>'nw' -background=>$main_bg, -width=>'6',-anchor=>'nw'
)->pack(-side=>'top',-fill=>'x', -anchor=>'w'); )->pack(-side=>'top',-fill=>'x', -anchor=>'w');
$mach[6] = $mach[6] =
$frm2->Checkbutton(-variable=>\$machvals[6], -text=>"test6", $frm2->Checkbutton(-variable=>\$machvals[6], -text=>"tbpc06",
-background=>$main_bg, -width=>'6',-anchor=>'nw' -background=>$main_bg, -width=>'6',-anchor=>'nw'
)->pack(-side=>'top',-fill=>'x', -anchor=>'w'); )->pack(-side=>'top',-fill=>'x', -anchor=>'w');
$mach[7] = $mach[7] =
$frm2->Checkbutton(-variable=>\$machvals[7], -text=>"test7", $frm2->Checkbutton(-variable=>\$machvals[7], -text=>"tbpc07",
-background=>$main_bg, -width=>'6',-anchor=>'nw' -background=>$main_bg, -width=>'6',-anchor=>'nw'
)->pack(-side=>'top',-fill=>'x', -anchor=>'w'); )->pack(-side=>'top',-fill=>'x', -anchor=>'w');
$mach[8] = $mach[8] =
$frm2->Checkbutton(-variable=>\$machvals[8], -text=>"test8", $frm2->Checkbutton(-variable=>\$machvals[8], -text=>"tbpc08",
-background=>$main_bg, -width=>'6',-anchor=>'nw' -background=>$main_bg, -width=>'6',-anchor=>'nw'
)->pack(-side=>'top',-fill=>'x', -anchor=>'w'); )->pack(-side=>'top',-fill=>'x', -anchor=>'w');
$mach[9] = $mach[9] =
$frm2->Checkbutton(-variable=>\$machvals[9], -text=>"test9", $frm2->Checkbutton(-variable=>\$machvals[9], -text=>"tbpc09",
-background=>$main_bg, -width=>'6',-anchor=>'nw' -background=>$main_bg, -width=>'6',-anchor=>'nw'
)->pack(-side=>'top',-fill=>'x', -anchor=>'w'); )->pack(-side=>'top',-fill=>'x', -anchor=>'w');
$mach[10] = $mach[10] =
$frm2->Checkbutton(-variable=>\$machvals[10], -text=>"test10", $frm2->Checkbutton(-variable=>\$machvals[10], -text=>"tbpc10",
-background=>$main_bg, -width=>'6',-anchor=>'nw' -background=>$main_bg, -width=>'6',-anchor=>'nw'
)->pack(-side=>'top',-fill=>'x', -anchor=>'w'); )->pack(-side=>'top',-fill=>'x', -anchor=>'w');
$mach[11] = $mach[11] =
...@@ -123,7 +123,7 @@ my $op_off = ...@@ -123,7 +123,7 @@ my $op_off =
my $op_cyc = my $op_cyc =
$frm3-> $frm3->
Radiobutton( -variable=> \$op, -text => 'Reboot',-background=>$main_bg, Radiobutton( -variable=> \$op, -text => 'Cycle',-background=>$main_bg,
-value=>'cycle', -width=>'6', -anchor=>'nw' -value=>'cycle', -width=>'6', -anchor=>'nw'
)->pack(-side=>'top',-fill=>'x', -anchor=>'w'); )->pack(-side=>'top',-fill=>'x', -anchor=>'w');
...@@ -137,7 +137,8 @@ my $go = ...@@ -137,7 +137,8 @@ my $go =
@machines=(); @machines=();
while ($n <= $#machvals ) { while ($n <= $#machvals ) {
if (defined($machvals[$n])&&$machvals[$n]==1) { if (defined($machvals[$n])&&$machvals[$n]==1) {
push(@machines,"test$n") if ($n <= 10); push(@machines,"tbpc0$n") if ($n < 10);
push(@machines,"tbpc$n") if ($n == 10);
push(@machines,"alpha") if ($n==11); push(@machines,"alpha") if ($n==11);
push(@machines,"beta") if ($n==12); push(@machines,"beta") if ($n==12);
push(@machines,"gamma") if ($n==13); push(@machines,"gamma") if ($n==13);
...@@ -145,23 +146,28 @@ my $go = ...@@ -145,23 +146,28 @@ my $go =
} }
$n++; $n++;
} }
if ($#machines<0) { if ($#machines<0) {
&message &message
($msg_area, ($msg_area,
"Please select at least one machine."); "Please select at least one machine.");
} elsif (!$op) { } elsif (!$op) {
&message ($msg_area, &message ($msg_area,
"Please select an operation."); "Please select an operation.");
} else { } else {
my @output=(); my @output=();
open(PWR,"power $op @machines |"); open(PWR,"power $op @machines |");
while (<PWR>) { while (<PWR>) {
chop; chop;
push (@output,$_); push (@output,$_);
} }
&message ($msg_area, &message ($msg_area,
join ("\n",@output)); join ("\n",@output));
} my $n=0;
while ($n <= $#machvals ) {
$machvals[$n]=0;
$n++;
}
}
}) })
->pack(-side=>'left',-anchor=>'s',-fill=>'x', ->pack(-side=>'left',-anchor=>'s',-fill=>'x',
-padx=>'2',-pady=>'2'); -padx=>'2',-pady=>'2');
...@@ -171,7 +177,7 @@ my $help_btn= ...@@ -171,7 +177,7 @@ my $help_btn=
-anchor=>'center', -relief=>'raised',-command=>sub { -anchor=>'center', -relief=>'raised',-command=>sub {
&message( $msg_area, &message( $msg_area,
"Select machine(s) to update\n", "Select machine(s) to update\n",
"Select on, off, or reboot\n", "Select on, off, or cycle\n",
"Press the Go! button"); } ) "Press the Go! button"); } )
->pack(-side=>'left',-anchor=>'s',-fill=>'x', ->pack(-side=>'left',-anchor=>'s',-fill=>'x',
-padx=>'2',-pady=>'2'); -padx=>'2',-pady=>'2');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment