PSC1200 MkII
Futurelight
Ingo Koinzer
Scanner
unit PSC1200;
interface
procedure InitDevice(Device: String);
procedure FormShow;
procedure FormRefresh(channel:Integer);
procedure FormClose;
procedure PositionXYChange(Top, Left: Integer);
procedure SPEEDBoxchange;
procedure SPEEDchange;
procedure ColorBoxChange;
procedure Color1Rainbow;
procedure ColorBoxChange2;
procedure Color2Rainbow;
procedure GOBO1change;
procedure Gobo1ShakeChange;
procedure GOBO2change;
procedure Gobo2ShakeChange;
procedure Gobo2RotCheck;
procedure Gobo2IndCheck;
procedure GOBO2ROTchange;
procedure PRISMABoxchange;
procedure PrismaRotCheck;
procedure PrismaIndCheck;
procedure PRISMAROTchange;
procedure ZOOMchange;
procedure FOCUSchange;
procedure IRISchange;
procedure SHUTTERBoxchange;
procedure SHUTTERchange;
procedure DIMMERchange;
procedure FROSTchange;
procedure SPECIALBoxchange;
implementation
var
DontRefresh:boolean;
procedure InitDevice(Device: String);
begin
end;
procedure FormShow;
begin
end;
procedure FormRefresh(channel:Integer);
var
Value:integer;
r,phi,temp:Double;
begin
if not DontRefresh then
case channel of
0:
begin
if usemhcontrol.checked then
begin
// Moving-Head-Steuerung
temp:=get_channel('tilt')+(get_channel('tiltfine')/256);
case round(temp) of
0..127: r:=((127-temp)/127);
128..255: r:=((temp-128)/127);
end;
phi:=(get_channel('pan')+(get_channel('panfine')/256))/255*6.283185307179586476925286766559; //(X/255)*PI
PositionXY.Left:=round(r*sin(phi)*(Fadenkreuz.Width/2)+(Fadenkreuz.Width/2)-(PositionXY.Width div 2));
PositionXY.Top:=round(r*cos(phi)*(Fadenkreuz.Height/2)+(Fadenkreuz.Height/2)-(PositionXY.Width div 2));
end else
begin
// Scanner-Steuerung
PositionXY.Left:=round(Fadenkreuz.Width * (get_channel('pan')+get_channel('panfine')/256)/255)-(PositionXY.Width div 2);
PositionXY.Top:=round(Fadenkreuz.Height * (get_channel('tilt')+get_channel('tiltfine')/256)/255)-(PositionXY.Height div 2);
end;
end;
1:
begin
if usemhcontrol.checked then
begin
// Moving-Head-Steuerung
temp:=get_channel('tilt')+(get_channel('tiltfine')/256);
case round(temp) of
0..127: r:=((127-temp)/127);
128..255: r:=((temp-128)/127);
end;
phi:=(get_channel('pan')+(get_channel('panfine')/256))/255*6.283185307179586476925286766559; //(X/255)*PI
PositionXY.Left:=round(r*sin(phi)*(Fadenkreuz.Width/2)+(Fadenkreuz.Width/2)-(PositionXY.Width div 2));
PositionXY.Top:=round(r*cos(phi)*(Fadenkreuz.Height/2)+(Fadenkreuz.Height/2)-(PositionXY.Width div 2));
end else
begin
// Scanner-Steuerung
PositionXY.Left:=round(Fadenkreuz.Width * (get_channel('pan')+get_channel('panfine')/256)/255)-(PositionXY.Width div 2);
PositionXY.Top:=round(Fadenkreuz.Height * (get_channel('tilt')+get_channel('tiltfine')/256)/255)-(PositionXY.Height div 2);
end;
end;
2:
begin
value := get_channel('SPEED');
case value of
0.. 14: SpeedBox.ItemIndex := 0;
15..225: SpeedBox.ItemIndex := 1;
226..235: SpeedBox.ItemIndex := 2;
236..245: SpeedBox.ItemIndex := 3;
end;
SPEEDslider2.Enabled := SpeedBox.ItemIndex = 1;
if (SPEEDslider2.Enabled) then
SPEEDslider2.position := value;
end;
3:
begin
value:=get_channel('color1');
case value of
0.. 13: ColorBox.ItemIndex := 0;
14.. 27: ColorBox.ItemIndex := 1;
28.. 41: ColorBox.ItemIndex := 2;
42.. 55: ColorBox.ItemIndex := 3;
56.. 69: ColorBox.ItemIndex := 4;
70.. 83: ColorBox.ItemIndex := 5;
84.. 97: ColorBox.ItemIndex := 6;
98..111: ColorBox.ItemIndex := 7;
112..127: ColorBox.ItemIndex := 8;
128..255: begin
ColorBox.ItemIndex := 9;
Color1RainBow.Position := value;
end;
end;
Color1RainBow.Enabled := value > 127;
end;
4:
begin
value:=get_channel('color2');
case value of
0.. 13: ColorBox2.ItemIndex := 0;
14.. 27: ColorBox2.ItemIndex := 1;
28.. 41: ColorBox2.ItemIndex := 2;
42.. 55: ColorBox2.ItemIndex := 3;
56.. 69: ColorBox2.ItemIndex := 4;
70.. 83: ColorBox2.ItemIndex := 5;
84.. 97: ColorBox2.ItemIndex := 6;
98..111: ColorBox2.ItemIndex := 7;
112..127: ColorBox2.ItemIndex := 8;
128..255: begin
ColorBox2.ItemIndex := 9;
Color2RainBow.Position := value;
end;
end;
Color2RainBow.Enabled := value > 127;
end;
5:
begin
value:=get_channel('gobo1');
case value of
0.. 14: GoboBox1.ItemIndex := 0;
15.. 29: GoboBox1.ItemIndex := 1;
30.. 44: GoboBox1.ItemIndex := 2;
45.. 59: GoboBox1.ItemIndex := 3;
60.. 74: GoboBox1.ItemIndex := 4;
75.. 89: GoboBox1.ItemIndex := 5;
90..113: GoboBox1.ItemIndex := 1;
114..137: GoboBox1.ItemIndex := 2;
138..161: GoboBox1.ItemIndex := 3;
162..185: GoboBox1.ItemIndex := 4;
186..209: GoboBox1.ItemIndex := 5;
210..255: GoboBox1.ItemIndex := 6;
end;
case value of
0..209: Gobo1Shake.Max := 23;
210..255: Gobo1Shake.Max := 45;
end;
case value of
90..209: Gobo1Shake.Position := (value - 90) mod 24;
210..255: Gobo1Shake.Position := value - 210;
end;
Gobo1Shake.Enabled := value > 89;
end;
6:
begin
value:=get_channel('gobo2');
case value of
0.. 14: GoboBox2.ItemIndex := 0;
15.. 29: GoboBox2.ItemIndex := 1;
30.. 44: GoboBox2.ItemIndex := 2;
45.. 59: GoboBox2.ItemIndex := 3;
60.. 74: GoboBox2.ItemIndex := 4;
75..106: GoboBox2.ItemIndex := 1;
107..138: GoboBox2.ItemIndex := 2;
139..170: GoboBox2.ItemIndex := 3;
171..202: GoboBox2.ItemIndex := 4;
203..255: GoboBox2.ItemIndex := 5;
end;
case value of
0..202: Gobo2Shake.Max := 31;
203..255: Gobo2Shake.Max := 52;
end;
case value of
75..202: Gobo2Shake.Position := (value - 75) mod 31;
203..255: Gobo2Shake.Position := value - 203;
end;
Gobo2Shake.Enabled := value > 89;
end;
7:
begin
value := get_channel('GOBO2ROT');
Gobo2Ind.Checked := not (value > 128);
Gobo2Rot.Checked := value >= 128;
GOBO2ROTslider7.position := value mod 128;
end;
8:
begin
value:=get_channel('PRISMA');
case value of
0.. 25: PrismaBox.ItemIndex := 0;
26.. 51: PrismaBox.ItemIndex := 1;
52.. 77: PrismaBox.ItemIndex := 2;
78..103: PrismaBox.ItemIndex := 3;
104..127: PrismaBox.ItemIndex := 4;
128..135: PrismaBox.ItemIndex := 5;
136..143: PrismaBox.ItemIndex := 6;
144..151: PrismaBox.ItemIndex := 7;
152..159: PrismaBox.ItemIndex := 8;
160..167: PrismaBox.ItemIndex := 9;
168..175: PrismaBox.ItemIndex := 10;
176..183: PrismaBox.ItemIndex := 11;
184..191: PrismaBox.ItemIndex := 12;
192..199: PrismaBox.ItemIndex := 13;
200..207: PrismaBox.ItemIndex := 14;
208..215: PrismaBox.ItemIndex := 15;
216..223: PrismaBox.ItemIndex := 16;
224..231: PrismaBox.ItemIndex := 17;
232..239: PrismaBox.ItemIndex := 18;
240..247: PrismaBox.ItemIndex := 19;
248..255: PrismaBox.ItemIndex := 20;
end;
end;
9:
begin
value := get_channel('PRISMAROT');
PrismaInd.Checked := not (value > 128);
PrismaRot.Checked := value >= 128;
PRISMAROTslider9.position := value mod 128;
end;
10:
begin
ZOOMslider10.position:=get_channel('ZOOM');
end;
11:
begin
FOCUSslider11.position:=get_channel('FOCUS');
end;
12:
begin
IRISslider12.position:=get_channel('IRIS');
end;
13:
begin
value := get_channel('SHUTTER');
case value of
0.. 31: ShutterBox.ItemIndex := 0;
32.. 63: ShutterBox.ItemIndex := 1;
64.. 95: ShutterBox.ItemIndex := 2;
128..159: ShutterBox.ItemIndex := 3;
192..223: ShutterBox.ItemIndex := 4;
224..255: ShutterBox.ItemIndex := 5;
end;
r := -1;
case value of
64.. 95: r := 64;
192..223: r := 192;
end;
if r > -1 then
SHUTTERslider13.position := value - r;
SHUTTERslider13.Enabled := r > -1;
end;
14:
begin
DIMMERslider14.position:=get_channel('DIMMER');
end;
15:
begin
FROSTslider15.position:=get_channel('FROST');
end;
16:
begin
value := get_channel('SPECIAL1');
case value of
0.. 15: SpecialBox.ItemIndex := 0;
16.. 31: SpecialBox.ItemIndex := 1;
32.. 47: SpecialBox.ItemIndex := 2;
48.. 63: SpecialBox.ItemIndex := 3;
64.. 79: SpecialBox.ItemIndex := 4;
80.. 95: SpecialBox.ItemIndex := 5;
96..111: SpecialBox.ItemIndex := 6;
112..127: SpecialBox.ItemIndex := 7;
128..143: SpecialBox.ItemIndex := 8;
144..159: SpecialBox.ItemIndex := 9;
160..175: SpecialBox.ItemIndex := 10;
176..191: SpecialBox.ItemIndex := 11;
192..207: SpecialBox.ItemIndex := 12;
208..223: SpecialBox.ItemIndex := 13;
224..239: SpecialBox.ItemIndex := 14;
240..255: SpecialBox.ItemIndex := 15;
end;
end;
end;
DontRefresh := false;
end;
procedure FormClose;
begin
end;
procedure PositionXYChange(Top, Left: Integer);
var
phi,r,x,y:Double;
pan, tilt, panfine, tiltfine:Double;
begin
if usemhcontrol.checked then
begin
// Moving-Head-Steuerung (Polarkoordinaten)
x:=((PositionXY.Left+(PositionXY.Width div 2)-(fadenkreuz.Width/2))/fadenkreuz.Width)*2; //-1..0..1
y:=((PositionXY.Top+(PositionXY.Height div 2)-(fadenkreuz.Width/2))/fadenkreuz.Height)*2; //-1..0..1
r:=sqrt(x*x+y*y);
if (r>0) then
begin
if (y>=0) then
phi:=arccos(x/r)
else
phi:=6.283185307179586476925286766559-arccos(x/r);
end else
phi:=64;
r:=128-((r/2)*255);
phi:=(phi/6.283185307179586476925286766559)*255;
if 64>=phi then
phi:=phi+191
else
phi:=phi-64;
pan:=255-phi;
tilt:=255-r;
end else
begin
// Scannersteuerung (Kartesische Koordinaten)
pan:=((PositionXY.Left+(PositionXY.Width div 2))/fadenkreuz.Width)*255;
tilt:=((PositionXY.Top+(PositionXY.Height div 2))/fadenkreuz.Height)*255;
end;
// Ausgabe
if panmirror.checked then
begin
dontrefresh:=true;
set_channel('pan',trunc(255-pan),trunc(255-pan),0);
dontrefresh:=true;
set_channel('panfine',trunc(frac(255-pan)*255),trunc(frac(255-pan)*255),0);
end else
begin
dontrefresh:=true;
set_channel('pan',trunc(pan),trunc(pan),0);
dontrefresh:=true;
set_channel('panfine',trunc(frac(pan)*255),trunc(frac(pan)*255),0);
end;
if tiltmirror.checked then
begin
dontrefresh:=true;
set_channel('tilt',trunc(255-tilt),trunc(255-tilt),0);
dontrefresh:=true;
set_channel('tiltfine',trunc(frac(255-tilt)*255),trunc(frac(255-tilt)*255),0);
end else
begin
dontrefresh:=true;
set_channel('tilt',trunc(tilt),trunc(tilt),0);
dontrefresh:=true;
set_channel('tiltfine',trunc(frac(tilt)*255),trunc(frac(tilt)*255),0);
end;
end;
procedure SPEEDBoxchange;
var value: Integer;
begin
case colorbox.itemindex of
0: value := 0;
1: value := 15;
2: value := 226;
3: value := 236;
4: value := 255;
end;
SPEEDslider2.Enabled := SpeedBox.ItemIndex = 1;
if (SPEEDslider2.Enabled) then
SPEEDslider2.position := 15;
DontRefresh:=true;
set_channel('SPEED',-1,value,0);
end;
procedure SPEEDchange;
begin
DontRefresh:=true;
set_channel('SPEED',-1,SPEEDslider2.position,0);
end;
procedure ColorBoxChange;
var value: Integer;
begin
case colorbox.itemindex of
0: value := 0;
1: value := 14;
2: value := 28;
3: value := 42;
4: value := 56;
5: value := 70;
6: value := 84;
7: value := 98;
8: value := 112;
9: value := 188;
end;
Color1RainBow.Enabled := value = 188;
Color1RainBow.Position := 64;
DontRefresh:=true;
set_channel('COLOR1',-1,value,0);
end;
procedure Color1Rainbow;
begin
DontRefresh:=true;
set_channel('COLOR1',-1,Color1RainBow.Position,0);
end;
procedure ColorBoxChange2;
var value: Integer;
begin
case colorbox2.itemindex of
0: value := 0;
1: value := 14;
2: value := 28;
3: value := 42;
4: value := 56;
5: value := 70;
6: value := 84;
7: value := 98;
8: value := 112;
9: value := 188;
end;
Color1RainBow.Enabled := value = 188;
Color1RainBow.Position := 64;
DontRefresh:=true;
set_channel('COLOR2',-1,value,0);
end;
procedure Color2Rainbow;
begin
DontRefresh:=true;
set_channel('COLOR2',-1,Color2RainBow.Position,0);
end;
procedure GOBO1change;
var value: Integer;
begin
case gobobox1.itemindex of
0: value := 0;
1: value := 15;
2: value := 30;
3: value := 45;
4: value := 60;
5: value := 75;
6: value := 210;
end;
Gobo1Shake.Enabled := value > 14;
Gobo1Shake.Position := 0;
case value of
0..5: Gobo1Shake.Max := 23;
6: Gobo1Shake.Max := 45;
end;
DontRefresh:=true;
set_channel('GOBO1',-1,value,0);
end;
procedure Gobo1ShakeChange;
var value: Integer;
begin
case gobobox1.itemindex of
1..5:
begin
if Gobo1Shake.Position = 0 then
value := (gobobox1.itemindex)*15 else
value := (gobobox1.itemindex - 1)*24 + 90 + Gobo1Shake.Position;
end;
6: value := 210 + Gobo1Shake.Position;
end;
set_channel('GOBO1',-1,value,0);
end;
procedure GOBO2change;
var value: Integer;
begin
case gobobox2.itemindex of
0: value := 0;
1: value := 15;
2: value := 30;
3: value := 45;
4: value := 60;
5: value := 203;
end;
Gobo2Shake.Enabled := value > 14;
Gobo2Shake.Position := 0;
case value of
0..4: Gobo2Shake.Max := 31;
5: Gobo2Shake.Max := 52;
end;
DontRefresh:=true;
set_channel('GOBO2',-1,value,0);
end;
procedure Gobo2ShakeChange;
var value: Integer;
begin
case gobobox2.itemindex of
1..4:
begin
if Gobo2Shake.Position = 0 then
value := (gobobox2.itemindex)*15 else
value := (gobobox2.itemindex - 1)*32 + 75 + Gobo2Shake.Position;
end;
5: value := 203 + Gobo2Shake.Position;
end;
set_channel('GOBO2',-1,value,0);
end;
procedure Gobo2RotCheck;
begin
Gobo2Ind.Checked := not Gobo2Rot.Checked;
if DontRefresh then exit;
Gobo2RotChange;
end;
procedure Gobo2IndCheck;
begin
Gobo2Rot.Checked := not Gobo2Ind.Checked;
if DontRefresh then exit;
Gobo2RotChange;
end;
procedure GOBO2ROTchange;
begin
DontRefresh:=true;
if Gobo2Ind.Checked then
set_channel('GOBO2ROT',-1,GOBO2ROTslider7.position,0);
if Gobo2Rot.Checked then
set_channel('GOBO2ROT',-1,GOBO2ROTslider7.position + 128,0);
end;
procedure PRISMABoxchange;
var value: Integer;
begin
case PrismaBox.ItemIndex of
0: value := 0;
1: value := 26;
2: value := 52;
3: value := 78;
4: value := 104;
5: value := 128;
6: value := 136;
7: value := 144;
8: value := 152;
9: value := 160;
10: value := 168;
11: value := 176;
12: value := 184;
13: value := 192;
14: value := 200;
15: value := 208;
16: value := 216;
17: value := 224;
18: value := 232;
19: value := 240;
20: value := 248;
end;
DontRefresh:=true;
set_channel('PRISMA',-1,value,0);
end;
procedure PrismaRotCheck;
begin
if DontRefresh then exit;
PrismaInd.Checked := not PrismaRot.Checked;
PrismaRotChange;
end;
procedure PrismaIndCheck;
begin
if DontRefresh then exit;
PrismaRot.Checked := not PrismaInd.Checked;
PrismaRotChange;
end;
procedure PRISMAROTchange;
begin
DontRefresh:=true;
if PrismaInd.Checked then
set_channel('PRISMAROT',-1,PRISMAROTslider9.position,0);
if PrismaRot.Checked then
set_channel('PRISMAROT',-1,PRISMAROTslider9.position + 128,0);
end;
procedure ZOOMchange;
begin
DontRefresh:=true;
set_channel('ZOOM',-1,ZOOMslider10.position,0);
end;
procedure FOCUSchange;
begin
DontRefresh:=true;
set_channel('FOCUS',-1,FOCUSslider11.position,0);
end;
procedure IRISchange;
begin
DontRefresh:=true;
set_channel('IRIS',-1,IRISslider12.position,0);
end;
procedure SHUTTERBoxchange;
var value, r: Integer;
begin
DontRefresh:=true;
case ShutterBox.ItemIndex of
0: value := 0;
1: value := 32;
2: value := 64;
3: value := 128;
4: value := 192;
5: value := 224;
end;
r := -1;
case value of
64.. 95: r := 64;
192..223: r := 192;
end;
if r > -1 then
SHUTTERslider13.position := value - r;
SHUTTERslider13.Enabled := r > -1;
set_channel('SHUTTER',-1,value,0);
end;
procedure SHUTTERchange;
begin
DontRefresh:=true;
case ShutterBox.ItemIndex of
2: set_channel('SHUTTER',-1,SHUTTERslider13.position + 64,0);
4: set_channel('SHUTTER',-1,SHUTTERslider13.position + 192,0);
end;
end;
procedure DIMMERchange;
begin
DontRefresh:=true;
set_channel('DIMMER',-1,DIMMERslider14.position,0);
end;
procedure FROSTchange;
begin
DontRefresh:=true;
set_channel('FROST',-1,FROSTslider15.position,0);
end;
procedure SPECIALBoxchange;
var value: Integer;
begin
value := SpecialBox.ItemIndex * 16;
DontRefresh:=true;
set_channel('SPECIAL1',-1,value,0);
end;
end.