NewDeviceUnit wird nicht richtig erstellt

Alles was nicht direkt mit dem normalen Verhalten des PC_DIMMERs zu tun hat
Antworten
FJSpot90
Beiträge: 4
Registriert: 12.05.2018, 13:13

NewDeviceUnit wird nicht richtig erstellt

Beitrag von FJSpot90 » 15.05.2018, 17:20

Hallo nochmal,

nach meinen zwei Posts, auf die niemand geantwortet hat, hoffe ich auf ein drittes Mal.

Ich habe mittlerweile viele Stunden mit dem Code verbracht und konnte den Fehler weiter eingrenzen. Es ist jedoch immer noch so, es wird im NewDeviceUnit nicht die benötigten Teile erstellt. In der Gerätesteuerung kann ich somit mit nichts arbeiten. Da ich nun nicht die genauen Wortlaute der Programmierung kenne, bin ich so langsam aufgeschmissen.

Der Fehler ist also das die "procedure ...change" bei keiner Komponente funktioniert.


<?xml version="1.0" encoding="ISO-8859-1"?>
<device image="64 x 64\varyscanp6.png">
<information id="PC_DIMMER">
<name>Neu</name>
<vendor>LightmaXX</vendor>
<author>FJ</author>
<description>Spot Head</description>
</information>
<channels>
<function channel="0" minvalue="0" maxvalue="255" name="Pan" fade="yes" type="pan"/>
<function channel="1" minvalue="0" maxvalue="255" name="Pan-Fine" fade="yes" type="panfine"/>
<function channel="2" minvalue="0" maxvalue="255" name="Tilt" fade="yes" type="tilt"/>
<function channel="3" minvalue="0" maxvalue="255" name="Tilt-Fine" fade="yes" type="tiltfine"/>
<function channel="4" minvalue="0" maxvalue="255" name="XY-Speed" fade="yes" type="speed"/>
<function channel="5" minvalue="0" maxvalue="255" name="Dimmer" fade="yes" type="dimmer"/>
<function channel="6" minvalue="0" maxvalue="255" name="Stroboskop" fade="yes" type="shutter"/>
<function channel="7" minvalue="0" maxvalue="255" name="Farbrad" fade="no" type="color1"/>
<function channel="8" minvalue="0" maxvalue="255" name="Gobo-Rad 1" fade="no" type="gobo1"/>
<function channel="9" minvalue="0" maxvalue="255" name="Gobo-Rad 2" fade="no" type="gobo2"/>
<function channel="10" minvalue="0" maxvalue="255" name="Rotation" fade="yes" type="gobo2rot"/>
<function channel="11" minvalue="0" maxvalue="255" name="Fokus" fade="yes" type="focus"/>
<function channel="12" minvalue="0" maxvalue="255" name="Prisma" fade="yes" type="prisma"/>
<function channel="13" minvalue="0" maxvalue="255" name="Auto-Modus" fade="yes" type="a"/>
<function channel="14" minvalue="0" maxvalue="255" name="Auto-Run" fade="yes" type="position"/>
<function channel="15" minvalue="0" maxvalue="255" name="Reset" fade="yes" type="option"/>
</channels>
<amber UseAmberMixing="no" AmberMixingCompensateRG="no" AmberMixingCompensateBlue="no" AmberColorR="0"AmberColorG="0" />
<initvalues ch0="0" ch1="0" ch2="0" ch3="0" ch4="0" ch5="0" ch6="0" ch7="0" ch8="0" ch9="0" ch10="0" ch11="0" ch12="0" ch13="0" ch14="0" ch15="0" />
<colors>
<color name="Weiß (Offen)" value="0" valueend="4" r="255" g="255" b="255" />
<color name="Weiß/ Rot" value="5" valueend="13" r="64" g="0" b="64" />
<color name="Rot" value="14" valueend="22" r="255" g="0" b="0" />
<color name="Rot/ Orange" value="23" valueend="31" r="255" g="128" b="128" />
<color name="Orange" value="32" valueend="40" r="255" g="128" b="0" />
<color name="Orange/ Grün" value="41" valueend="49" r="64" g="128" b="128" />
<color name="Grün" value="50" valueend="58" r="0" g="255" b="0" />
<color name="Grün/ Dunkelblau" value="59" valueend="67" r="0" g="128" b="255" />
<color name="Dunkelblau" value="68" valueend="76" r="0" g="0" b="255" />
<color name="Dunkelblau/ Gelb" value="77" valueend="85" r="128" g="255" b="128" />
<color name="Gelb" value="86" valueend="94" r="255" g="255" b="0" />
<color name="Gelb/ Hellblau" value="95" valueend="103" r="0" g="255" b="255" />
<color name="Hellblau" value="104" valueend="112" r="0" g="255" b="255" />
<color name="Hellblau/ Lila" value="113" valueend="121" r="128" g="128" b="255" />
<color name="Lila" value="122" valueend="130" r="64" g="0" b="128" />
<color name="Offen (Weiß)" value="131" valueend="139" r="212" g="212" b="212" />
<color name="Vorwärts" value="140" valueend="195" r="128" g="128" b="128" />
<color name="Stop" value="195" valueend="199" r="0" g="0" b="0" />
<color name="Rückwärts" value="200" valueend="255" r="128" g="128" b="128" />
</colors>
<shutter OpenValue="255" CloseValue="0" ChannelName="shutter"/>
<strobe OffValue="0" MinValue="5" MaxValue="250" ChannelName="shutter"/>
<dimmer OffValue="0" MaxValue="255"/>
<fog OffValue="0" MaxValue="0"/>
<gobo1rot LeftMinValue="0" LeftMaxValue="0" OffValue="0" RightMinValue="0" RightMaxValue="0" ChannelName="gobo1rot"/>
<gobo2rot LeftMinValue="10" LeftMaxValue="129" OffValue="9" RightMinValue="135" RightMaxValue="255" ChannelName="gobo2rot"/>
<prismarot LeftMinValue="135" LeftMaxValue="255" OffValue="8" RightMinValue="0" RightMaxValue="0" ChannelName="prismarot"/>
<prisma SingleValue="0" TripleValue="0"/>
<iris OpenValue="0" CloseValue="0" MinValue="0" MaxValue="0"/>
<gobos>
<gobo name="Offen" value="0" valueend="5" filename="Offen.png" />
<gobo name="Zahnkranz" value="6" valueend="21" filename="Turbine7.png" />
<gobo name="Flamme" value="22" valueend="37" filename="Worms.png" />
<gobo name="Blume" value="38" valueend="53" filename="Freeze.png" />
<gobo name="Luftblasen" value="54" valueend="69" filename="R15010177.png" />
<gobo name="Wirbelzahn" value="70" valueend="85" filename="Clouds2.png" />
<gobo name="Virus" value="86" valueend="101" filename="Web.png" />
<gobo name="Dolch" value="102" valueend="117" filename="Burst.png" />
<gobo name="Stricheck" value="118" valueend="133" filename="Triangle.png" />
<gobo name="Vorwärts" value="134" valueend="194" filename="Pink.png" />
<gobo name="Rückwärts" value="195" valueend="255" filename="Pink-Green.png" />
</gobos>
<gobos2>
<gobo2 name="Offen" value="0" valueend="7" filename="Offen1.png" />
<gobo2 name="Punkte" value="8" valueend="28" filename="3beam3.png" />
<gobo2 name="Keimzelle" value="29" valueend="49" filename="Starscare.png" />
<gobo2 name="Wirbel" value="50" valueend="70" filename="Turbine4.png" />
<gobo2 name="Stern" value="71" valueend="91" filename="Star7.png" />
<gobo2 name="Bahnen" value="92" valueend="112" filename="Star3CP.png" />
<gobo2 name="Dreieck" value="113" valueend="133" filename="Triangle5.png" />
<gobo2 name="Vorwärts" value="134" valueend="194" filename="4Color.png" />
<gobo2 name="Rückwärts" value="195" valueend="255" filename="4Color2.png" />
</gobos2>
<form width="470" height="536">
<deviceimage top="8" left="8" width="64" height="64"/>
<devicename top="24" left="80"/>
<deviceadress top="8" left="80"/>
<devicedipswitch top="50" left="65"/>
<position top="8" left="233" height="226" width="226" />
<colorbox top="242" left="233" height="22" width="145" />
<dropdown name="GOBOBOX1" top="272" left="233" width="145" height="23" action="gobo1change">
<item caption="Offen" value="0" valueend="5" picture="Offen.bmp" />
<item caption="Zahnkranz" value="6" valueend="21" picture="Turbine7.bmp" />
<item caption="Flamme" value="22" valueend="37" picture="Worms.bmp" />
<item caption="Blume" value="38" valueend="53" picture="Freeze.bmp" />
<item caption="Luftblasen" value="54" valueend="69" picture="R15010177.bmp" />
<item caption="Wirbelzahn" value="70" valueend="85" picture="Clouds2.bmp" />
<item caption="Virus" value="86" valueend="101" picture="Web.bmp" />
<item caption="Dolch" value="102" valueend="117" picture="Burst.bmp" />
<item caption="Stricheck" value="118" valueend="133" picture="Triangle.bmp" />
<item caption="Vorwärts" value="134" valueend="194" picture="Pink.bmp" />
<item caption="Rückwärts" value="195" valueend="255" picture="Pink-Green.bmp" />
</dropdown>
<dropdown name="GOBOBOX2" top="302" left="233" width="145" height="23" action="gobo2change">
<item caption="Offen" value="0" valueend="7" picture="Offen1.bmp" />
<item caption="Punkte" value="8" valueend="28" picture="3beam3.bmp" />
<item caption="Keimzelle" value="29" valueend="49" picture="Starscare.bmp" />
<item caption="Wirbel" value="50" valueend="70" picture="Turbine4.bmp" />
<item caption="Stern" value="71" valueend="91" picture="Star7.bmp" />
<item caption="Bahnen" value="92" valueend="112" picture="Star3CP.bmp" />
<item caption="Dreieck" value="113" valueend="133" picture="Triangle5.bmp" />
<item caption="Vorwärts" value="134" valueend="194" picture="4Color.bmp" />
<item caption="Rückwärts" value="195" valueend="255" picture="4Color2.bmp" />
</dropdown>
<slider name="panfineslider1" top="96" left="8" width="217" height="17" action="panfinechange" startvalue="0" endvalue="255" default="0"/>
<slider name="tiltfineslider3" top="136" left="8" width="217" height="17" action="tiltfinechange" startvalue="0" endvalue="255" default="0"/>
<slider name="speedslider4" top="176" left="8" width="217" height="17" action="speedchange" startvalue="0" endvalue="255" default="0"/>
<slider name="dimmerslider5" top="216" left="8" width="217" height="17" action="dimmerchange" startvalue="0" endvalue="255" default="0"/>
<slider name="shutterslider6" top="256" left="8" width="217" height="17" action="shutterchange" startvalue="0" endvalue="255" default="0"/>
<slider name="gobo2rotslider10" top="296" left="8" width="217" height="17" action="gobo2rotchange" startvalue="0" endvalue="255" default="0"/>
<slider name="focusslider11" top="336" left="8" width="217" height="17" action="focuschange" startvalue="0" endvalue="255" default="0"/>
<slider name="prismaslider12" top="376" left="8" width="217" height="17" action="prismachange" startvalue="0" endvalue="255" default="0"/>
<slider name="aslider13" top="416" left="8" width="217" height="17" action="achange" startvalue="0" endvalue="255" default="0"/>
<slider name="positionslider14" top="456" left="8" width="217" height="17" action="positionchange" startvalue="0" endvalue="255" default="0"/>
<slider name="optionslider15" top="496" left="8" width="217" height="17" action="optionchange" startvalue="0" endvalue="255" default="0"/>
<label name="panfinelbl1" top="80" left="8" width="42" height="13" caption="Pan-Fine"/>
<label name="tiltfinelbl3" top="120" left="8" width="37" height="13" caption="Tilt-Fine"/>
<label name="speedlbl4" top="160" left="8" width="48" height="13" caption="XY-Speed"/>
<label name="dimmerlbl5" top="200" left="8" width="35" height="13" caption="Dimmer"/>
<label name="shutterlbl6" top="240" left="8" width="54" height="13" caption="Stroboskop"/>
<label name="gobo2rotlbl10" top="280" left="8" width="40" height="13" caption="Rotation"/>
<label name="focuslbl11" top="320" left="8" width="29" height="13" caption="Fokus"/>
<label name="prismalbl12" top="360" left="8" width="31" height="13" caption="Prisma"/>
<label name="albl13" top="400" left="8" width="57" height="13" caption="Auto-Modus"/>
<label name="positionlbl14" top="440" left="8" width="45" height="13" caption="Auto-Run"/>
<label name="optionlbl15" top="480" left="8" width="28" height="13" caption="Reset"/>
</form>
<code>
unit NewDeviceUnit;

interface

procedure FormShow;
procedure FormRefresh(channel:Integer);
procedure FormClose;
procedure PositionXYChange(Top, Left: Integer);
procedure panfinechange;
procedure tiltfinechange;
procedure speedchange;
procedure dimmerchange;
procedure shutterchange;
procedure ColorBoxChange;
procedure gobo1change;
procedure gobo2change;
procedure gobo2rotchange;
procedure focuschange;
procedure prismachange;
procedure achange;
procedure positionchange;
procedure optionchange;


implementation

var
DontRefresh:boolean;

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
panfineslider1.position:=get_channel('panfine');
end;
2:
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;
3:
begin
tiltfineslider3.position:=get_channel('tiltfine');
end;
4:
begin
speedslider4.position:=get_channel('speed');
end;
5:
begin
dimmerslider5.position:=get_channel('dimmer');
end;
6:
begin
shutterslider6.position:=get_channel('shutter');
end;
7:
begin
value:=get_channel('color1');
case value of
0..4: colorbox.itemindex:=0;
5..13: colorbox.itemindex:=1;
14..22: colorbox.itemindex:=2;
23..31: colorbox.itemindex:=3;
32..40: colorbox.itemindex:=4;
41..49: colorbox.itemindex:=5;
50..58: colorbox.itemindex:=6;
59..67: colorbox.itemindex:=7;
68..76: colorbox.itemindex:=8;
77..85: colorbox.itemindex:=9;
86..94: colorbox.itemindex:=10;
95..103: colorbox.itemindex:=11;
104..112: colorbox.itemindex:=12;
113..121: colorbox.itemindex:=13;
122..130: colorbox.itemindex:=14;
131..139: colorbox.itemindex:=15;
140..195: colorbox.itemindex:=16;
195..199: colorbox.itemindex:=17;
200..255: colorbox.itemindex:=18;
end;
end;
8:
begin
value:=get_channel('gobo1');
case value of
0..5: gobobox1.itemindex:=0;
6..21: gobobox1.itemindex:=1;
22..37: gobobox1.itemindex:=2;
38..53: gobobox1.itemindex:=3;
54..69: gobobox1.itemindex:=4;
70..85: gobobox1.itemindex:=5;
86..101: gobobox1.itemindex:=6;
102..117: gobobox1.itemindex:=7;
118..133: gobobox1.itemindex:=8;
134..194: gobobox1.itemindex:=9;
195..255: gobobox1.itemindex:=10;
end;
end;
9:
begin
value:=get_channel('gobo2');
case value of
0..7: gobobox2.itemindex:=0;
8..28: gobobox2.itemindex:=1;
29..49: gobobox2.itemindex:=2;
50..70: gobobox2.itemindex:=3;
71..91: gobobox2.itemindex:=4;
92..112: gobobox2.itemindex:=5;
113..133: gobobox2.itemindex:=6;
134..194: gobobox2.itemindex:=7;
195..255: gobobox2.itemindex:=8;
end;
end;
10:
begin
gobo2rotslider10.position:=get_channel('gobo2rot');
end;
11:
begin
focusslider11.position:=get_channel('focus');
end;
12:
begin
prismaslider12.position:=get_channel('prisma');
end;
13:
begin
aslider13.position:=get_channel('a');
end;
14:
begin
positionslider14.position:=get_channel('position');
end;
15:
begin
optionslider15.position:=get_channel('option');
end;
end;
DontRefresh:=false;
end;
procedure FormClose;
begin
end;
end.
</code>
</device>

Antworten