Zachary Kotlarek 12 лет назад
Родитель
Сommit
ff73b380dc
3 измененных файлов с 18 добавлено и 26 удалено
  1. 5 7
      dmx/amplifierPower.pl
  2. 5 7
      dmx/projectorPower.pl
  3. 8 12
      dmx/state.pl

+ 5 - 7
dmx/amplifierPower.pl

@@ -53,7 +53,7 @@ while (1) {
 
 	# State is calculated; use newState to gather data
 	my $newState = $state;
-	
+
 	# Avoid repeated calls to time()
 	my $now = time();
 
@@ -107,13 +107,11 @@ while (1) {
 	}
 
 	# Force updates when there is a physical state mistmatch
-	if (!$update) {
-		if (($state eq 'OFF' && $exists{'AMPLIFIER'}) || ($state eq 'ON' && !$exists{'AMPLIFIER'})) {
-			if ($DEBUG) {
-				print STDERR 'Physical state mismatch: ' . $state . ':' . $exists{'AMPLIFIER'} . "\n";
-			}
-			$update = 1;
+	if (!$update && (($state eq 'OFF' && $exists{'AMPLIFIER'}) || ($state eq 'ON' && !$exists{'AMPLIFIER'}))) {
+		if ($DEBUG) {
+			print STDERR 'Physical state mismatch: ' . $state . ':' . $exists{'AMPLIFIER'} . "\n";
 		}
+		$update = 1;
 	}
 
 	# Set the channel mode as needed

+ 5 - 7
dmx/projectorPower.pl

@@ -89,7 +89,7 @@ while (1) {
 
 	# State is calculated; use newState to gather data
 	my $newState = $state;
-	
+
 	# Avoid repeated calls to time()
 	my $now = time();
 
@@ -236,13 +236,11 @@ while (1) {
 	}
 
 	# Force updates when there is a physical state mistmatch
-	if (!$update) {
-		if ($state eq 'OFF' && $exists{'PROJECTOR'}) {
-			if ($DEBUG) {
-				print STDERR 'Physical state mismatch: ' . $state . ':' . $exists{'PROJECTOR'} . "\n";
-			}
-			$update = 1;
+	if (!$update && $state eq 'OFF' && $exists{'PROJECTOR'}) {
+		if ($DEBUG) {
+			print STDERR 'Physical state mismatch: ' . $state . ':' . $exists{'PROJECTOR'} . "\n";
 		}
+		$update = 1;
 	}
 
 	# Set the color mode as needed

+ 8 - 12
dmx/state.pl

@@ -623,23 +623,19 @@ while (1) {
 	}
 
 	# Update on a periodic basis, so we don't timeout
-	if (!$update) {
-		if ($now - $pushLast > $PUSH_TIMEOUT) {
-			if ($DEBUG) {
-				print STDERR "Periodic update\n";
-			}
-			$update = 1;
+	if (!$update && $now - $pushLast > $PUSH_TIMEOUT) {
+		if ($DEBUG) {
+			print STDERR "Periodic update\n";
 		}
+		$update = 1;
 	}
 
 	# Update on a master state change
-	if (!$update) {
-		if ($stateLast ne $state) {
-			if ($DEBUG) {
-				print STDERR 'State change: ' . $stateLast . ' => ' . $state . "\n";
-			}
-			$update = 1;
+	if (!$update && $stateLast ne $state) {
+		if ($DEBUG) {
+			print STDERR 'State change: ' . $stateLast . ' => ' . $state . "\n";
 		}
+		$update = 1;
 	}
 
 	# Update on any mtime change