| 275 |
* Device type values found in devmapr4.h |
* Device type values found in devmapr4.h |
| 276 |
*/ |
*/ |
| 277 |
LOGINFO("DialogicManager::getBoards() " << *auid |
LOGINFO("DialogicManager::getBoards() " << *auid |
| 278 |
<< "\t" << srlBoard->szDevName |
"\t" << srlBoard->szDevName << |
| 279 |
<< "\t" << srlChannel->szDevName |
"\t" << srlChannel->szDevName << |
| 280 |
<< "\t" << srlChannel->iDevType |
"\t" << srlChannel->iDevType << |
| 281 |
<< " (" << devType << ")"); |
" (" << devType << ")"); |
| 282 |
} |
} |
| 283 |
|
|
| 284 |
delete[] srlChannels; |
delete[] srlChannels; |
| 285 |
} |
} |
| 286 |
|
|
| 287 |
LOGINFO("DialogicManager::getBoards() Physical Board No:" << indxPhys << " has " |
LOGINFO("DialogicManager::getBoards() Physical Board No:" << |
| 288 |
<< voxBoards_.size () << " Vox channels, " |
indxPhys << " has " << |
| 289 |
<< dtiBoards_.size () << " DTI channels, " |
voxBoards_.size() << " Vox channels, " << |
| 290 |
<< ipmBoards_.size () << " IPM channels."); |
dtiBoards_.size() << " DTI channels, " << |
| 291 |
|
ipmBoards_.size() << " IPM channels."); |
| 292 |
delete[] srlBoards; |
delete[] srlBoards; |
| 293 |
} |
} |
| 294 |
|
|
| 296 |
return true; |
return true; |
| 297 |
} |
} |
| 298 |
|
|
| 299 |
|
|
| 300 |
|
/* |
| 301 |
|
* |
| 302 |
|
*/ |
| 303 |
bool DialogicManager::createDevices() |
bool DialogicManager::createDevices() |
| 304 |
{ |
{ |
|
// create the devices. |
|
| 305 |
std::string deviceName; |
std::string deviceName; |
| 306 |
|
std::vector<SRLDEVICEINFO*>::const_iterator i; |
| 307 |
|
|
| 308 |
GcIsdnDevice *gc; |
for ( i = dtiBoards_.begin(); i != dtiBoards_.end(); ++i ) |
|
int dtiChannels = dtiBoards_.size(); |
|
|
|
|
|
for ( int i = 0; i < dtiChannels; i++ ) |
|
| 309 |
{ |
{ |
| 310 |
deviceName.assign(dtiBoards_[i]->szDevName); |
deviceName = (*i)->szDevName; |
| 311 |
gc = new GcIsdnDevice(deviceName); |
GcIsdnDevice* gc = new GcIsdnDevice(deviceName); |
| 312 |
|
if ( gc->open() ) |
|
if (gc) |
|
| 313 |
{ |
{ |
|
gc->Open(); |
|
| 314 |
deviceMap_.insert(device_map_t::value_type (deviceName, gc)); |
deviceMap_.insert(device_map_t::value_type (deviceName, gc)); |
| 315 |
m_GcDeviceStack.push(gc); |
m_GcDeviceStack.push(gc); |
| 316 |
} |
} |
| 318 |
{ |
{ |
| 319 |
delete gc; |
delete gc; |
| 320 |
} |
} |
|
gc = NULL; |
|
| 321 |
} |
} |
| 322 |
|
|
| 323 |
VoxDevice *vd; |
for ( i = voxBoards_.begin(); i != voxBoards_.end(); ++i ) |
|
int voxChannels = voxBoards_.size(); |
|
|
for (int i = 0; i < voxChannels; i++) |
|
| 324 |
{ |
{ |
| 325 |
deviceName = voxBoards_[i]->szDevName; |
deviceName = (*i)->szDevName; |
| 326 |
vd = new VoxDevice (deviceName); |
VoxDevice* vd = new VoxDevice(deviceName); |
| 327 |
if (vd && vd->Open()) |
if ( vd->open() ) |
| 328 |
{ |
{ |
| 329 |
deviceMap_.insert(device_map_t::value_type (deviceName, vd)); |
deviceMap_.insert(device_map_t::value_type (deviceName, vd)); |
| 330 |
m_VoxDeviceStack.push(vd); |
m_VoxDeviceStack.push(vd); |
| 333 |
{ |
{ |
| 334 |
delete vd; |
delete vd; |
| 335 |
} |
} |
|
vd = NULL; |
|
| 336 |
} |
} |
| 337 |
|
|
| 338 |
IpmDevice *id; |
for ( i = ipmBoards_.begin(); i != ipmBoards_.end(); ++i ) |
| 339 |
int ipmChannels = ipmBoards_.size(); |
{ |
| 340 |
|
deviceName = (*i)->szDevName; |
| 341 |
for (int i = 0; i < ipmChannels; i++) { |
IpmDevice* id = new IpmDevice(deviceName); |
| 342 |
deviceName = ipmBoards_[i]->szDevName; |
if ( id->open() ) |
|
id = new IpmDevice (deviceName); |
|
|
if (id && id->Open()) |
|
| 343 |
{ |
{ |
| 344 |
deviceMap_.insert(device_map_t::value_type (deviceName, id)); |
deviceMap_.insert(device_map_t::value_type (deviceName, id)); |
| 345 |
m_IpmDeviceStack.push(id); |
m_IpmDeviceStack.push(id); |
| 348 |
{ |
{ |
| 349 |
delete id; |
delete id; |
| 350 |
} |
} |
|
id = NULL; |
|
| 351 |
} |
} |
| 352 |
|
|
| 353 |
//$$AM SetNumDevices (deviceMap_.size()); |
//$$AM SetNumDevices (deviceMap_.size()); |
| 354 |
return true; |
return true; |
|
|
|
| 355 |
} |
} |
| 356 |
|
|
| 357 |
|
|
| 358 |
|
/* |
| 359 |
|
* |
| 360 |
|
*/ |
| 361 |
void DialogicManager::openAllDevices() |
void DialogicManager::openAllDevices() |
| 362 |
{ |
{ |
| 363 |
device_map_t::iterator itr; |
device_map_t::iterator i; |
| 364 |
|
|
| 365 |
for (itr = deviceMap_.begin (); itr != deviceMap_.end (); ++itr) |
for ( i = deviceMap_.begin(); i != deviceMap_.end(); ++i ) |
| 366 |
{ |
{ |
| 367 |
LOGDEBUG ("DialogicManager::openAllDevices() Opening Device: " << itr->first); |
LOGDEBUG ("DialogicManager::openAllDevices() Opening Device: " << (*i).first); |
| 368 |
itr->second->Open (); |
(*i).second->open(); |
| 369 |
} |
} |
| 370 |
} |
} |
| 371 |
|
|
| 372 |
|
|
| 373 |
|
/* |
| 374 |
|
* |
| 375 |
|
*/ |
| 376 |
void DialogicManager::closeAllDevices() |
void DialogicManager::closeAllDevices() |
| 377 |
{ |
{ |
| 378 |
device_map_t::iterator itr; |
device_map_t::iterator i; |
| 379 |
|
|
| 380 |
for (itr = deviceMap_.begin (); itr != deviceMap_.end (); ++itr) |
for ( i = deviceMap_.begin(); i != deviceMap_.end(); ++i ) |
| 381 |
{ |
{ |
| 382 |
LOGDEBUG ("DialogicManager::closeAllDevices() Closing Device: " << itr->first); |
LOGDEBUG ("DialogicManager::closeAllDevices() Closing Device: " << (*i).first); |
| 383 |
itr->second->Close(); |
(*i).second->close(); |
| 384 |
} |
} |
| 385 |
} |
} |
| 386 |
|
|