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 SPEEDchange;
procedure ColorBoxChange;
procedure ColorBoxChange2;
procedure GOBO1change;
procedure GOBO2change;
procedure GOBO2ROTchange;
procedure PRISMAchange;
procedure PRISMAROTchange;
procedure ZOOMchange;
procedure FOCUSchange;
procedure IRISchange;
procedure SHUTTERchange;
procedure DIMMERchange;
procedure FROSTchange;
procedure SPECIAL1change;
procedure LampeEin;
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
SPEEDslider2.position:=get_channel('SPEED');
end;
3:
begin
value:=get_channel('color1');
case value of
end;
end;
4:
begin
value:=get_channel('color2');
case value of
end;
end;
5:
begin
value:=get_channel('gobo1');
case value of
end;
end;
6:
begin
value:=get_channel('gobo2');
case value of
end;
end;
7:
begin
GOBO2ROTslider7.position:=get_channel('GOBO2ROT');
end;
8:
begin
PRISMAslider8.position:=get_channel('PRISMA');
end;
9:
begin
PRISMAROTslider9.position:=get_channel('PRISMAROT');
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
SHUTTERslider13.position:=get_channel('SHUTTER');
end;
14:
begin
DIMMERslider14.position:=get_channel('DIMMER');
end;
15:
begin
FROSTslider15.position:=get_channel('FROST');
end;
16:
begin
SPECIAL1slider16.position:=get_channel('SPECIAL1');
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 SPEEDchange;
begin
DontRefresh:=true;
set_channel('SPEED',-1,SPEEDslider2.position,0);
end;
procedure ColorBoxChange;
begin
case colorbox.itemindex of
end;
end;
procedure ColorBoxChange2;
begin
case colorbox2.itemindex of
end;
end;
procedure GOBO1change;
begin
case gobobox1.itemindex of
end;
end;
procedure GOBO2change;
begin
case gobobox2.itemindex of
end;
end;
procedure GOBO2ROTchange;
begin
DontRefresh:=true;
set_channel('GOBO2ROT',-1,GOBO2ROTslider7.position,0);
end;
procedure PRISMAchange;
begin
DontRefresh:=true;
set_channel('PRISMA',-1,PRISMAslider8.position,0);
end;
procedure PRISMAROTchange;
begin
DontRefresh:=true;
set_channel('PRISMAROT',-1,PRISMAROTslider9.position,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 SHUTTERchange;
begin
DontRefresh:=true;
set_channel('SHUTTER',-1,SHUTTERslider13.position,0);
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 SPECIAL1change;
begin
DontRefresh:=true;
set_channel('SPECIAL1',-1,SPECIAL1slider16.position,0);
end;
procedure LampeEin;
begin
DontRefresh:=true;
set_channel('SPECIAL1',-1,64,0);
SPECIAL1slider16.position:=get_channel('SPECIAL1');
end;
end.