acanicio
June 16, 2010, 22:15:30
Dear support forum,
After 6 months without touching a single line of code, I'm back trying to get everything working with ICImagingcontrol and Delphi.
I've stopped using the ActiveX properties and started using the VCDSimpleproperties instead.
I'm trying to read the properties of a TIS 41AG02.AS camera (color) and have an issue with the VCDID_WhiteBalance property
Even though the VCDProp.Available method says that the property is available, when I try to read it (for example, trying to get the min range value) I get the following error message.
This happens when stepping into the GetVCDPropertyRange procedure, GetRangeMin method and finally fetchCheckedRangeItf function.
Rangeproperty
{284C0E0D-010B-45BF-8291-09D90A459B28]:{B57D3000-0AC6-4819-A609-272A33140ACA}:{99B44940-BFE1-4083-ADA1-BE703F4B8E03} not found
Of course, it is a custom message, but I don't understand why the available method returns "true" and then the range property is not found...
Does the VCDID_WhiteBalance property have to be used/read in a particular way ?
Here are the bits of code used.
(TRB_WhiteBalance is a TTrackbar component)
(Enabled is a boolean property of TRB_Whitebalance)
declarations :
TmpVCDProp : TVCDSimpleProperty;
Main part
With Form.TRB_Whitebalance do
Begin
Enabled := TmpVCDProp.Available(VCDID_WhiteBalance);
If Enabled then
GetVCDPropertyRange(Form.ICImagingControl,TmpVCDPr op,VCDID_WhiteBalance,MinValue,MaxValue,Value,Auto );
Form.LBL_WhiteBalance.Enabled := Enabled;
Form.EDT_WhiteBalance.Enabled := Enabled;
Form.UPD_WhiteBalance.Enabled := Enabled;
Min := Round(MinValue);
ASCamera.CameraProperty[ASVideoProcamp_Whitebalance].MinValue := Min;
Position := Min;
Max := Round(MaxValue);
ASCamera.CameraProperty[ASVideoProcamp_Whitebalance].MaxValue := Max;
Position := Round(Value);
ASCamera.CameraProperty[ASVideoProcamp_Whitebalance].Value := Position;
End;
GetVCDPropertyRange procedure
Procedure GetVCDPropertyRange(Control : TICImagingControl;VCDProp : TVCDSimpleProperty;
const ItemID : WideString;
Var Min,Max,Value : Double;
Var Auto : Boolean);
Begin
if Control.DeviceValid = True then
begin
Min := VCDProp.GetRangeMin(ItemID);
Max := VCDProp.GetRangeMax(ItemID);
Value := VCDProp.GetRangeValue(ItemID);
Auto := VCDProp.AutoAvailable(ItemID);
end;
End;
GetrangeMin description
Function TVCDSimpleProperty.GetRangeMin(id : WideString) : Longint;
Var RangeProp : VCDRangeProperty;
Begin
RangeProp := fetchCheckedRangeItf(id, internalTree);
RangeMin := RangeProp.RangeMin Div RangeProp.Delta;
Result := RangeMin;
End;
Function fetchCheckedRangeItf(itemId : WideString; props : VCDPropertyItems) : VCDRangeProperty;
Var
irange : VCDRangeProperty;
itf : VCDPropertyInterface;
id : WideString;
Begin
If itemId = VCDElement_WhiteBalanceBlue Then
id := VCDID_WhiteBalance + ':' + VCDElement_WhiteBalanceBlue
Else
If itemId = VCDElement_WhiteBalanceRed Then
id := VCDID_WhiteBalance + ':' + VCDElement_WhiteBalanceRed
Else
If itemId = VCDElement_GPIOIn Then
id := VCDID_GPIO + ':' + VCDElement_GPIOIn
Else
If itemId = VCDElement_GPIOOut Then
id := VCDID_GPIO + ':' + VCDElement_GPIOOut
Else
If itemId = VCDElement_StrobeDelay Then
id := VCDID_Strobe + ':' + VCDElement_StrobeDelay
Else
If itemId = VCDElement_StrobeDuration Then
id := VCDID_Strobe + ':' + VCDElement_StrobeDuration
Else
id := itemId + ':' + VCDElement_Value;
id := id + ':' + VCDInterface_Range;
Try
irange := VCDRangeProperty(props.FindInterface(id));
If irange <> nil Then
result := irange
Else
ShowMessage('RangeProperty '+ id + ' not found');
Except
ShowMessage('RangeProperty '+ id + ' not found');
End;
End;
The other VCDID_xxxxxx properties work perfectly, I have the issue only with this VCDID_WhiteBalance property.
Thank you for any idea.
Best regards
Axel Canicio
After 6 months without touching a single line of code, I'm back trying to get everything working with ICImagingcontrol and Delphi.
I've stopped using the ActiveX properties and started using the VCDSimpleproperties instead.
I'm trying to read the properties of a TIS 41AG02.AS camera (color) and have an issue with the VCDID_WhiteBalance property
Even though the VCDProp.Available method says that the property is available, when I try to read it (for example, trying to get the min range value) I get the following error message.
This happens when stepping into the GetVCDPropertyRange procedure, GetRangeMin method and finally fetchCheckedRangeItf function.
Rangeproperty
{284C0E0D-010B-45BF-8291-09D90A459B28]:{B57D3000-0AC6-4819-A609-272A33140ACA}:{99B44940-BFE1-4083-ADA1-BE703F4B8E03} not found
Of course, it is a custom message, but I don't understand why the available method returns "true" and then the range property is not found...
Does the VCDID_WhiteBalance property have to be used/read in a particular way ?
Here are the bits of code used.
(TRB_WhiteBalance is a TTrackbar component)
(Enabled is a boolean property of TRB_Whitebalance)
declarations :
TmpVCDProp : TVCDSimpleProperty;
Main part
With Form.TRB_Whitebalance do
Begin
Enabled := TmpVCDProp.Available(VCDID_WhiteBalance);
If Enabled then
GetVCDPropertyRange(Form.ICImagingControl,TmpVCDPr op,VCDID_WhiteBalance,MinValue,MaxValue,Value,Auto );
Form.LBL_WhiteBalance.Enabled := Enabled;
Form.EDT_WhiteBalance.Enabled := Enabled;
Form.UPD_WhiteBalance.Enabled := Enabled;
Min := Round(MinValue);
ASCamera.CameraProperty[ASVideoProcamp_Whitebalance].MinValue := Min;
Position := Min;
Max := Round(MaxValue);
ASCamera.CameraProperty[ASVideoProcamp_Whitebalance].MaxValue := Max;
Position := Round(Value);
ASCamera.CameraProperty[ASVideoProcamp_Whitebalance].Value := Position;
End;
GetVCDPropertyRange procedure
Procedure GetVCDPropertyRange(Control : TICImagingControl;VCDProp : TVCDSimpleProperty;
const ItemID : WideString;
Var Min,Max,Value : Double;
Var Auto : Boolean);
Begin
if Control.DeviceValid = True then
begin
Min := VCDProp.GetRangeMin(ItemID);
Max := VCDProp.GetRangeMax(ItemID);
Value := VCDProp.GetRangeValue(ItemID);
Auto := VCDProp.AutoAvailable(ItemID);
end;
End;
GetrangeMin description
Function TVCDSimpleProperty.GetRangeMin(id : WideString) : Longint;
Var RangeProp : VCDRangeProperty;
Begin
RangeProp := fetchCheckedRangeItf(id, internalTree);
RangeMin := RangeProp.RangeMin Div RangeProp.Delta;
Result := RangeMin;
End;
Function fetchCheckedRangeItf(itemId : WideString; props : VCDPropertyItems) : VCDRangeProperty;
Var
irange : VCDRangeProperty;
itf : VCDPropertyInterface;
id : WideString;
Begin
If itemId = VCDElement_WhiteBalanceBlue Then
id := VCDID_WhiteBalance + ':' + VCDElement_WhiteBalanceBlue
Else
If itemId = VCDElement_WhiteBalanceRed Then
id := VCDID_WhiteBalance + ':' + VCDElement_WhiteBalanceRed
Else
If itemId = VCDElement_GPIOIn Then
id := VCDID_GPIO + ':' + VCDElement_GPIOIn
Else
If itemId = VCDElement_GPIOOut Then
id := VCDID_GPIO + ':' + VCDElement_GPIOOut
Else
If itemId = VCDElement_StrobeDelay Then
id := VCDID_Strobe + ':' + VCDElement_StrobeDelay
Else
If itemId = VCDElement_StrobeDuration Then
id := VCDID_Strobe + ':' + VCDElement_StrobeDuration
Else
id := itemId + ':' + VCDElement_Value;
id := id + ':' + VCDInterface_Range;
Try
irange := VCDRangeProperty(props.FindInterface(id));
If irange <> nil Then
result := irange
Else
ShowMessage('RangeProperty '+ id + ' not found');
Except
ShowMessage('RangeProperty '+ id + ' not found');
End;
End;
The other VCDID_xxxxxx properties work perfectly, I have the issue only with this VCDID_WhiteBalance property.
Thank you for any idea.
Best regards
Axel Canicio