Просмотр исходного кода

More splits.

I love the subscription model
Zachary Kotlarek 13 лет назад
Родитель
Сommit
1f1f472036
4 измененных файлов с 25 добавлено и 11 удалено
  1. 8 5
      dmx/bias.pl
  2. 6 2
      dmx/leds.pl
  3. 6 3
      dmx/overhead.pl
  4. 5 1
      dmx/rope.pl

+ 8 - 5
dmx/bias.pl

@@ -14,13 +14,13 @@ my %DIM = (
 		# Handled by rope.pl
 	],
 	'PLAY'   => [
-		{ 'channel' => 12, 'value' => 255, 'time' => 0    }
+		{ 'channel' => 12, 'value' => 255, 'time' => 0 }
 	],
 	'PAUSE'   => [
-		{ 'channel' => 12, 'value' => 0,  'time' => 15000 }
+		{ 'channel' => 12, 'value' => 0,  'time' => 0, 'delay' => 8000 }
 	],
 	'MOTION'  => [
-		{ 'channel' => 12, 'value' => 0,  'time' => 0    }
+		{ 'channel' => 12, 'value' => 0,  'time' => 0 }
 	],
 );
 
@@ -165,9 +165,12 @@ while (1) {
 	# Update the fan state
 	if ($forceUpdate || $stateLast ne $state) {
 		if ($DEBUG) {
-			print STDERR 'State: ' . $stateLast . ' => ' . $state . "\n";
 			foreach my $data (@{ $DIM{$state} }) {
-				print STDERR "\t" . $data->{'channel'} . ' => ' . $data->{'value'} . ' @ ' . $data->{'time'} . "\n";
+				my $delay = '';
+				if ($data->{'delay'}) {
+					$delay = ' (Delay: ' . $data->{'delay'} . ')';
+				}
+				print STDERR "\t" . $data->{'channel'} . ' => ' . $data->{'value'} . ' @ ' . $data->{'time'} . $delay . "\n";
 			}
 		}
 

+ 6 - 2
dmx/leds.pl

@@ -289,9 +289,13 @@ while (1) {
 		if ($DEBUG) {
 			my $sum = 0;
 			print STDERR 'State: ' . $stateLast . ' => ' . $state . ' (Color: ' . scalar(@COLOR) . ")\n";
-			foreach my $data (@data_set) {
+			foreach my $data (@{ $DIM{$state} }) {
 				$sum += $data->{'value'};
-				print STDERR "\t" . $data->{'channel'} . ' => ' . $data->{'value'} . ' @ ' . $data->{'time'} . "\n";
+				my $delay = '';
+				if ($data->{'delay'}) {
+					$delay = ' (Delay: ' . $data->{'delay'} . ')';
+				}
+				print STDERR "\t" . $data->{'channel'} . ' => ' . $data->{'value'} . ' @ ' . $data->{'time'} . $delay . "\n";
 			}
 			print STDERR "\tTotal: " . $sum . "\n";
 		}

+ 6 - 3
dmx/overhead.pl

@@ -93,7 +93,7 @@ my $pushLast  = 0;
 my $pullLast  = time();
 
 # Always force lights out at launch
-dim({ 'channel' => 9, 'value' => 0, 'time' => 0 });
+dim({ 'channel' => 4, 'value' => 0, 'time' => 0 });
 
 # Loop forever
 while (1) {
@@ -177,9 +177,12 @@ while (1) {
 	# Update the fan state
 	if ($forceUpdate || $stateLast ne $state) {
 		if ($DEBUG) {
-			print STDERR 'State: ' . $stateLast . ' => ' . $state . "\n";
 			foreach my $data (@{ $DIM{$state} }) {
-				print STDERR "\t" . $data->{'channel'} . ' => ' . $data->{'value'} . ' @ ' . $data->{'time'} . "\n";
+				my $delay = '';
+				if ($data->{'delay'}) {
+					$delay = ' (Delay: ' . $data->{'delay'} . ')';
+				}
+				print STDERR "\t" . $data->{'channel'} . ' => ' . $data->{'value'} . ' @ ' . $data->{'time'} . $delay . "\n";
 			}
 		}
 

+ 5 - 1
dmx/rope.pl

@@ -207,7 +207,11 @@ while (1) {
 		if ($DEBUG) {
 			print STDERR 'State: ' . $stateLast . ' => ' . $state . "\n";
 			foreach my $data (@{ $DIM{$state} }) {
-				print STDERR "\t" . $data->{'channel'} . ' => ' . $data->{'value'} . ' @ ' . $data->{'time'} . "\n";
+				my $delay = '';
+				if ($data->{'delay'}) {
+					$delay = ' (Delay: ' . $data->{'delay'} . ')';
+				}
+				print STDERR "\t" . $data->{'channel'} . ' => ' . $data->{'value'} . ' @ ' . $data->{'time'} . $delay . "\n";
 			}
 		}