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

Add a BRIGHT state to force all lights to full power

Zachary Kotlarek 13 лет назад
Родитель
Сommit
c1a1ceb959
5 измененных файлов с 48 добавлено и 24 удалено
  1. 12 7
      dmx/leds.pl
  2. 16 8
      dmx/overhead.pl
  3. 2 2
      dmx/projectorPower.pl
  4. 17 7
      dmx/rope.pl
  5. 1 0
      dmx/state.pl

+ 12 - 7
dmx/leds.pl

@@ -45,6 +45,11 @@ my %DIM            = (
 		{ 'channel' => 14, 'value' => 144, 'time' => 1000 },
 		{ 'channel' => 15, 'value' => 144, 'time' => 1000 },
 	],
+	'BRIGHT'    => [
+		{ 'channel' => 13, 'value' => 255, 'time' => 1000 },
+		{ 'channel' => 14, 'value' => 255, 'time' => 1000 },
+		{ 'channel' => 15, 'value' => 255, 'time' => 1000 },
+	],
 	'ERROR'    => [
 		{ 'channel' => 13, 'value' => 144, 'time' => 0 },
 		{ 'channel' => 14, 'value' => 255, 'time' => 0 },
@@ -127,15 +132,15 @@ while (1) {
 
 	# Calculate the new state
 	$stateLast = $state;
-	if ($exists{'LIGHTS'}) {
+	if ($exists{'BRIGHT'} || $exists{'LIGHTS'}) {
 		if ($newState eq 'PLAY') {
 			$newState = 'PLAY_HIGH';
-		} elsif ($newState eq 'OFF') {
-			$newState = 'MOTION';
-		}
-	} else {
-		if ($newState eq 'PLAY_HIGH') {
-			$newState = 'PLAY';
+		} else {
+			if ($exists{'BRIGHT'}) {
+				$newState = 'BRIGHT';
+			} else {
+				$newState = 'MOTION';
+			}
 		}
 	}
 	$state = $newState;

+ 16 - 8
dmx/overhead.pl

@@ -15,6 +15,7 @@ my %DIM = (
 	'PLAY_HIGH' => [ { 'channel' => 4, 'value' => 48,  'time' => 500 }, ],
 	'PAUSE'     => [ { 'channel' => 4, 'value' => 96,  'time' => 6000, 'delay' => 9000 }, ],
 	'MOTION'    => [ { 'channel' => 4, 'value' => 128, 'time' => 2500 }, ],
+	'BRIGHT'    => [ { 'channel' => 4, 'value' => 255, 'time' => 2500 }, ],
 	'ERROR'     => [ { 'channel' => 4, 'value' => 255, 'time' => 0 }, ],
 );
 
@@ -85,20 +86,27 @@ while (1) {
 
 	# Calculate the new state
 	$stateLast = $state;
-	if ($exists{'LIGHTS'}) {
+	if ($exists{'LIGHTS'} || $exists{'BRIGHT'}) {
 		if ($newState eq 'PLAY') {
 			$newState = 'PLAY_HIGH';
-		} elsif ($newState eq 'OFF') {
-			$newState = 'MOTION';
-		}
-	} else {
-		if ($newState eq 'PLAY_HIGH') {
-			$newState = 'PLAY';
+		} else {
+			if ($exists{'BRIGHT'}) {
+				$newState = 'BRIGHT';
+			} else {
+				$newState = 'MOTION';
+			}
 		}
 	}
 	$state = $newState;
 
-	# Speak when LIGHTS changes
+	# Speak when LIGHTS or BRIGHT changes
+	if (exists($exists{'BRIGHT'}) && exists($last{'BRIGHT'}) && $exists{'BRIGHT'} ne $last{'BRIGHT'}) {
+		if ($exists{'BRIGHT'}) {
+			DMX::say('Lights - Full power');
+		} else {
+			DMX::say('Lights - Nominal power');
+		}
+	}
 	if (exists($exists{'LIGHTS'}) && exists($last{'LIGHTS'}) && $exists{'LIGHTS'} ne $last{'LIGHTS'}) {
 		if ($exists{'LIGHTS'}) {
 			DMX::say('Lights up');

+ 2 - 2
dmx/projectorPower.pl

@@ -137,7 +137,7 @@ while (1) {
 
 	# Calculate the color mode
 	# PLAY for normal playback
-	# HIGH when playing and LIGHTS
+	# HIGH when playing and LIGHTS || BRIGHT
 	# LOW for audio, and when we're half way to the timeout (to save the bulb)
 	# HIGH when the GUI is up
 	# PLAY if we haven't figured out what else to do
@@ -156,7 +156,7 @@ while (1) {
 	# If playLights was set, choose the color mode based on the LIGHTS setting
 	if ($playLights) {
 		$color = $COLOR_PLAY;
-		if ($exists{'LIGHTS'}) {
+		if ($exists{'LIGHTS'} || $exists{'BRIGHT'}) {
 			$color = $COLOR_HIGH;
 		}
 	}

+ 17 - 7
dmx/rope.pl

@@ -60,6 +60,16 @@ my %DIM = (
 		{ 'channel' => 8,  'value' => 96,  'time' => 2000  },
 		{ 'channel' => 9,  'value' => 96,  'time' => 1500  },
 	],
+	'BRIGHT'    => [
+		{ 'channel' => 1,  'value' => 255, 'time' => 1000  },
+		{ 'channel' => 2,  'value' => 255, 'time' => 1000  },
+		{ 'channel' => 3,  'value' => 255, 'time' => 1000  },
+		{ 'channel' => 5,  'value' => 255, 'time' => 1000  },
+		{ 'channel' => 6,  'value' => 255, 'time' => 1000  },
+		{ 'channel' => 7,  'value' => 255, 'time' => 1000  },
+		{ 'channel' => 8,  'value' => 255,  'time' => 2000  },
+		{ 'channel' => 9,  'value' => 255,  'time' => 1500  },
+	],
 	'ERROR'    => [
 		{ 'channel' => 1,  'value' => 0,   'time' => 0  },
 		{ 'channel' => 2,  'value' => 0,   'time' => 0  },
@@ -137,15 +147,15 @@ while (1) {
 
 	# Calculate the new state
 	$stateLast = $state;
-	if ($exists{'LIGHTS'}) {
+	if ($exists{'LIGHTS'} || $exists{'BRIGHT'}) {
 		if ($newState eq 'PLAY') {
 			$newState = 'PLAY_HIGH';
-		} elsif ($newState eq 'OFF') {
-			$newState = 'MOTION';
-		}
-	} else {
-		if ($newState eq 'PLAY_HIGH') {
-			$newState = 'PLAY';
+		} else {
+			if ($exists{'BRIGHT'}) {
+				$newState = 'BRIGHT';
+			} else {
+				$newState = 'MOTION';
+			}
 		}
 	}
 	$state = $newState;

+ 1 - 0
dmx/state.pl

@@ -74,6 +74,7 @@ if ($HOST =~ /loki/i) {
 
 	# A/V Effects
 	$MON_FILES{'LIGHTS'} = 'EXISTS-TIMEOUT';
+	$MON_FILES{'BRIGHT'} = 'EXISTS-TIMEOUT';
 	$MON_FILES{'RAVE'}   = 'EXISTS';
 	$MON_FILES{'EFFECT'} = 'EXISTS';