Update of /cvsroot/playerstage/code/player/server/drivers/mixed/sr3000
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13774/server/drivers/mixed/sr3000
Modified Files:
sr3000.cc
Log Message:
build fixes for sr3000 driver relating to properties
Index: sr3000.cc
===================================================================
RCS file:
/cvsroot/playerstage/code/player/server/drivers/mixed/sr3000/sr3000.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** sr3000.cc 15 Feb 2008 09:39:21 -0000 1.6
--- sr3000.cc 16 Feb 2008 02:22:30 -0000 1.7
***************
*** 127,131 ****
//ModulationFrq modulation_freq;
size_t buffer_size, buffer_points_size;
! void *buffer;
float *buffer_points, *xp, *yp, *zp;
--- 127,131 ----
//ModulationFrq modulation_freq;
size_t buffer_size, buffer_points_size;
! uint8_t *buffer;
float *buffer_points, *xp, *yp, *zp;
***************
*** 262,266 ****
// ---[ Alloc memory for the buffer ]---
! buffer = malloc (buffer_size);
memset (buffer, 0, buffer_size);
--- 262,266 ----
// ---[ Alloc memory for the buffer ]---
! buffer = (uint8_t*)malloc (buffer_size);
memset (buffer, 0, buffer_size);
***************
*** 308,312 ****
{
int res;
! Property *property = NULL;
// Check for properties
--- 308,312 ----
{
int res;
! //Property *property = NULL;
// Check for properties
***************
*** 314,323 ****
{
player_intprop_req_t req = *reinterpret_cast<player_intprop_req_t*>
(data);
! if ((property = propertyBag.GetProperty (req.key)) == NULL)
! return (-1);
! if (property->KeyIsEqual ("auto_illumination"))
{
// ---[ Set Autoillumination
! if (req->value == 1)
res = SR_SetAutoIllumination (srCam, 5, 255, 10, 45);
else
--- 314,323 ----
{
player_intprop_req_t req = *reinterpret_cast<player_intprop_req_t*>
(data);
! // if ((property = propertyBag.GetProperty (req.key)) == NULL)
! // return (-1);
! if (auto_illumination.KeyIsEqual (req.key))
{
// ---[ Set Autoillumination
! if (req.value == 1)
res = SR_SetAutoIllumination (srCam, 5, 255, 10, 45);
else
***************
*** 327,331 ****
if (res == 0)
{
! property->SetValueFromMessage (reinterpret_cast<void*> (&req));
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_INTPROP_REQ, NULL, 0, NULL);
}
--- 327,331 ----
if (res == 0)
{
! auto_illumination = req.value;
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_INTPROP_REQ, NULL, 0, NULL);
}
***************
*** 336,348 ****
return (0);
}
! else if (property->KeyIsEqual ("integration_time")
{
// ---[ Set integration time
! res = SR_SetIntegrationTime (srCam, req->value);
// Check the error code
if (res == 0)
{
! property->SetValueFromMessage (reinterpret_cast<void*> (&req));
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_INTPROP_REQ, NULL, 0, NULL);
}
--- 336,349 ----
return (0);
}
! else if (integration_time.KeyIsEqual (req.key))
{
// ---[ Set integration time
! res = SR_SetIntegrationTime (srCam, req.value);
// Check the error code
if (res == 0)
{
! //property->SetValueFromMessage (reinterpret_cast<void*> (&req));
! integration_time = req.value;
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_INTPROP_REQ, NULL, 0, NULL);
}
***************
*** 353,365 ****
return (0);
}
! else if (property->KeyIsEqual ("modulation_freq")
{
// ---[ Set modulation frequency
! res = SR_SetModulationFrequency (srCam, (ModulationFrq)req->value);
// Check the error code
if (res == 0)
{
! property->SetValueFromMessage (reinterpret_cast<void*> (&req));
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_INTPROP_REQ, NULL, 0, NULL);
}
--- 354,367 ----
return (0);
}
! else if (modulation_freq.KeyIsEqual (req.key))
{
// ---[ Set modulation frequency
! res = SR_SetModulationFrequency (srCam, (ModulationFrq)req.value);
// Check the error code
if (res == 0)
{
! //property->SetValueFromMessage (reinterpret_cast<void*> (&req));
! modulation_freq = req.value;
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_INTPROP_REQ, NULL, 0, NULL);
}
***************
*** 370,383 ****
return (0);
}
! else if (property->KeyIsEqual ("sat_threshold")
{
// ---[ Set saturation threshold
! res = SR_SetSaturationThreshold (srCam, req->value);
// Check the error code
if (res == 0)
{
! property->SetValueFromMessage (reinterpret_cast<void*> (&req));
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_INTPROP_REQ, NULL, 0, NULL);
}
else
--- 372,387 ----
return (0);
}
! else if (sat_threshold.KeyIsEqual (req.key))
{
// ---[ Set saturation threshold
! res = SR_SetSaturationThreshold (srCam, req.value);
// Check the error code
if (res == 0)
{
! //property->SetValueFromMessage (reinterpret_cast<void*> (&req));
! sat_threshold = req.value;
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_INTPROP_REQ, NULL, 0, NULL);
+
}
else
***************
*** 387,399 ****
return (0);
}
! else if (property->KeyIsEqual ("amp_threshold")
{
// ---[ Set amplitude threshold
! res = SR_SetAmplitudeThreshold (srCam, req->value);
// Check the error code
if (res == 0)
{
! property->SetValueFromMessage (reinterpret_cast<void*> (&req));
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_INTPROP_REQ, NULL, 0, NULL);
}
--- 391,404 ----
return (0);
}
! else if (amp_threshold.KeyIsEqual (req.key))
{
// ---[ Set amplitude threshold
! res = SR_SetAmplitudeThreshold (srCam, req.value);
// Check the error code
if (res == 0)
{
! //property->SetValueFromMessage (reinterpret_cast<void*> (&req));
! amp_threshold = req.value;
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_INTPROP_REQ, NULL, 0, NULL);
}
***************
*** 409,427 ****
{
player_intprop_req_t req = *reinterpret_cast<player_intprop_req_t*>
(data);
! if ((property = propertyBag.GetProperty (req.key)) == NULL)
! return (-1);
! if (property->KeyIsEqual ("modulation_freq"))
{
// ---[ Get modulation frequency
! reinterpret_cast<IntProperty*> (property)->SetValue
(SR_GetModulationFrequency (srCam));
! property->GetValueToMessage (reinterpret_cast<void*> (&req));
Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_GET_INTPROP_REQ, reinterpret_cast<void*> (&req),
sizeof(player_intprop_req_t), NULL);
return (0);
}
! else if (property->KeyIsEqual ("integration_time"))
{
// ---[ Get integration time
! reinterpret_cast<IntProperty*> (property)->SetValue
(SR_GetIntegrationTime (srCam));
! property->GetValueToMessage (reinterpret_cast<void*> (&req));
Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_GET_INTPROP_REQ, reinterpret_cast<void*> (&req),
sizeof(player_intprop_req_t), NULL);
return (0);
--- 414,432 ----
{
player_intprop_req_t req = *reinterpret_cast<player_intprop_req_t*>
(data);
! /* if ((property = propertyBag.GetProperty (req.key)) == NULL)
! return (-1);*/
! if (modulation_freq.KeyIsEqual (req.key))
{
// ---[ Get modulation frequency
! modulation_freq.SetValue (SR_GetModulationFrequency (srCam));
! modulation_freq.GetValueToMessage (reinterpret_cast<void*> (&req));
Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_GET_INTPROP_REQ, reinterpret_cast<void*> (&req),
sizeof(player_intprop_req_t), NULL);
return (0);
}
! else if (integration_time.KeyIsEqual (req.key))
{
// ---[ Get integration time
! integration_time.SetValue (SR_GetIntegrationTime (srCam));
! integration_time.GetValueToMessage (reinterpret_cast<void*> (&req));
Publish(device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_GET_INTPROP_REQ, reinterpret_cast<void*> (&req),
sizeof(player_intprop_req_t), NULL);
return (0);
***************
*** 432,447 ****
{
player_dblprop_req_t req = *reinterpret_cast<player_dblprop_req_t*>
(data);
! if ((property = propertyBag.GetProperty (req.key)) == NULL)
! return (-1);
! if (property->KeyIsEqual ("static_delay"))
{
// ---[ Set IIR static delay
! DoubleProperty *dynamic_delay = propertyBag.GetProperty
("dynamic_delay");
! res = SR_SetTemporalIIR (srCam, req->value, dynamic_delay);
// Check the error code
if (res == 0)
{
! property->SetValueFromMessage (reinterpret_cast<void*> (&req));
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_DBLPROP_REQ, NULL, 0, NULL);
}
--- 437,452 ----
{
player_dblprop_req_t req = *reinterpret_cast<player_dblprop_req_t*>
(data);
! /* if ((property = propertyBag.GetProperty (req.key)) == NULL)
! return (-1);*/
! if (static_delay.KeyIsEqual (req.key))
{
// ---[ Set IIR static delay
! //DoubleProperty *dynamic_delay = propertyBag.GetProperty
("dynamic_delay");
! res = SR_SetTemporalIIR (srCam, req.value, dynamic_delay);
// Check the error code
if (res == 0)
{
! static_delay.SetValueFromMessage (reinterpret_cast<void*> (&req));
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_DBLPROP_REQ, NULL, 0, NULL);
}
***************
*** 452,465 ****
return (0);
}
! else if (property->KeyIsEqual ("dynamic_delay"))
{
// ---[ Set IIR dynamic delay
! DoubleProperty *static_delay = propertyBag.GetProperty ("static_delay");
! res = SR_SetTemporalIIR (srCam, static_delay, req->value);
// Check the error code
if (res == 0)
{
! property->SetValueFromMessage (reinterpret_cast<void*> (&req));
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_DBLPROP_REQ, NULL, 0, NULL);
}
--- 457,470 ----
return (0);
}
! else if (dynamic_delay.KeyIsEqual (req.key))
{
// ---[ Set IIR dynamic delay
! //DoubleProperty *static_delay = propertyBag.GetProperty
("static_delay");
! res = SR_SetTemporalIIR (srCam, static_delay, req.value);
// Check the error code
if (res == 0)
{
! dynamic_delay.SetValueFromMessage (reinterpret_cast<void*> (&req));
Publish(cam_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK,
PLAYER_SET_DBLPROP_REQ, NULL, 0, NULL);
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit