Zachary Kotlarek %!s(int64=13) %!d(string=hai) anos
pai
achega
ef5a721963
Modificáronse 4 ficheiros con 20 adicións e 19 borrados
  1. 1 1
      dmx/fan.pl
  2. 10 10
      dmx/leds.pl
  3. 7 7
      dmx/rope.pl
  4. 2 1
      dmx/state.pl

+ 1 - 1
dmx/fan.pl

@@ -176,7 +176,7 @@ while (1) {
 		print $fh 'State: ' . $state . "\n" . join("\n", @values) . "\n";
 		print $fh 'State: ' . $state . "\n" . join("\n", @values) . "\n";
 		close($fh);
 		close($fh);
 		rename($tmp, $DATA_DIR . 'FAN');
 		rename($tmp, $DATA_DIR . 'FAN');
-		
+
 		# Update the push time
 		# Update the push time
 		$pushLast = time();
 		$pushLast = time();
 	}
 	}

+ 10 - 10
dmx/leds.pl

@@ -94,11 +94,11 @@ shutdown($sub_fh, 2);
 undef($sub_fh);
 undef($sub_fh);
 
 
 # State
 # State
-my $state      = 'INIT';
-my $stateLast  = $state;
-my %exists     = ();
-my $pushLast   = 0;
-my $pullLast   = time();
+my $state     = 'INIT';
+my $stateLast = $state;
+my %exists    = ();
+my $pushLast  = 0;
+my $pullLast  = time();
 
 
 # Always force lights out at launch
 # Always force lights out at launch
 dim({ 'channel' => 13, 'value' => 0, 'time' => 0 });
 dim({ 'channel' => 13, 'value' => 0, 'time' => 0 });
@@ -107,7 +107,7 @@ dim({ 'channel' => 15, 'value' => 0, 'time' => 0 });
 
 
 # Loop forever
 # Loop forever
 while (1) {
 while (1) {
-	
+
 	# Set anywhere to force an update this cycle
 	# Set anywhere to force an update this cycle
 	my $forceUpdate = 0;
 	my $forceUpdate = 0;
 
 
@@ -122,12 +122,12 @@ while (1) {
 		my $text = undef();
 		my $text = undef();
 		$fh->recv($text, $MAX_CMD_LEN);
 		$fh->recv($text, $MAX_CMD_LEN);
 
 
-		# Parse the string   
+		# Parse the string
 		%exists = ();
 		%exists = ();
 		my ($cmdState, $exists_text) = $text =~ /^(\w+)\s+\(([^\)]+)\)/;
 		my ($cmdState, $exists_text) = $text =~ /^(\w+)\s+\(([^\)]+)\)/;
 		if (!defined($cmdState) || !defined($exists_text)) {
 		if (!defined($cmdState) || !defined($exists_text)) {
 			print STDERR 'State parse error: ' . $text . "\n";
 			print STDERR 'State parse error: ' . $text . "\n";
-			next;    
+			next;
 		}
 		}
 		foreach my $exists (split(/\s*,\s*/, $exists_text)) {
 		foreach my $exists (split(/\s*,\s*/, $exists_text)) {
 			my ($name, $value) = $exists =~ /(\w+)\:(0|1)/;
 			my ($name, $value) = $exists =~ /(\w+)\:(0|1)/;
@@ -173,7 +173,7 @@ while (1) {
 		}
 		}
 	}
 	}
 	$state = $newState;
 	$state = $newState;
-	
+
 	# Force updates on a periodic basis
 	# Force updates on a periodic basis
 	if (time() - $pullLast > $PUSH_TIMEOUT) {
 	if (time() - $pullLast > $PUSH_TIMEOUT) {
 		$forceUpdate = 1;
 		$forceUpdate = 1;
@@ -205,7 +205,7 @@ while (1) {
 		print $fh 'State: ' . $state . "\n" . join("\n", @values) . "\n";
 		print $fh 'State: ' . $state . "\n" . join("\n", @values) . "\n";
 		close($fh);
 		close($fh);
 		rename($tmp, $DATA_DIR . 'LED');
 		rename($tmp, $DATA_DIR . 'LED');
-		
+
 		# Update the push time
 		# Update the push time
 		$pushLast = time();
 		$pushLast = time();
 	}
 	}

+ 7 - 7
dmx/rope.pl

@@ -122,18 +122,18 @@ shutdown($sub_fh, 2);
 undef($sub_fh);
 undef($sub_fh);
 
 
 # State
 # State
-my $state      = 'INIT';
-my $stateLast  = $state;
-my %exists     = ();
-my $pushLast   = 0;
-my $pullLast   = time();
+my $state     = 'INIT';
+my $stateLast = $state;
+my %exists    = ();
+my $pushLast  = 0;
+my $pullLast  = time();
 
 
 # Always force lights out at launch
 # Always force lights out at launch
 dim({ 'channel' => 0, 'value' => 0, 'time' => 0 });
 dim({ 'channel' => 0, 'value' => 0, 'time' => 0 });
 
 
 # Loop forever
 # Loop forever
 while (1) {
 while (1) {
-	
+
 	# Set anywhere to force an update this cycle
 	# Set anywhere to force an update this cycle
 	my $forceUpdate = 0;
 	my $forceUpdate = 0;
 
 
@@ -231,7 +231,7 @@ while (1) {
 		print $fh 'State: ' . $state . "\n" . join("\n", @values) . "\n";
 		print $fh 'State: ' . $state . "\n" . join("\n", @values) . "\n";
 		close($fh);
 		close($fh);
 		rename($tmp, $DATA_DIR . 'ROPE');
 		rename($tmp, $DATA_DIR . 'ROPE');
-		
+
 		# Update the push time
 		# Update the push time
 		$pushLast = time();
 		$pushLast = time();
 	}
 	}

+ 2 - 1
dmx/state.pl

@@ -20,7 +20,7 @@ my $CMD_FILE     = $DATA_DIR . 'STATE.socket';
 my $MAX_CMD_LEN  = 4096;
 my $MAX_CMD_LEN  = 4096;
 my $RESET_CMD    = $ENV{'HOME'} . '/bin/video/dmx/reset.sh';
 my $RESET_CMD    = $ENV{'HOME'} . '/bin/video/dmx/reset.sh';
 my $PUSH_TIMEOUT = 20;
 my $PUSH_TIMEOUT = 20;
-my %MON_FILES    = (
+my %MON_FILES = (
 	'PLAYING'     => 'MTIME',
 	'PLAYING'     => 'MTIME',
 	'GUI'         => 'MTIME',
 	'GUI'         => 'MTIME',
 	'MOTION'      => 'MTIME',
 	'MOTION'      => 'MTIME',
@@ -30,6 +30,7 @@ my %MON_FILES    = (
 	'FAN_CMD'     => 'EXISTS',
 	'FAN_CMD'     => 'EXISTS',
 );
 );
 
 
+
 # Debug
 # Debug
 my $DEBUG = 0;
 my $DEBUG = 0;
 if ($ENV{'DEBUG'}) {
 if ($ENV{'DEBUG'}) {