PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusWinProbeCommand.cxx
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2  Program: Plus
3  Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4  See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #include "PlusConfigure.h"
10 
11 #include "vtkPlusDataCollector.h"
12 
14 
15 namespace
16 {
17  static const std::string WINPROBE_CMD = "WinProbeCommand";
18 
19 }
20 
21 //----------------------------------------------------------------------------
23  : ResponseExpected(true)
24 {
25  this->SetName(WINPROBE_CMD);
26  this->RequestedParameters.clear();
27 }
28 
29 //----------------------------------------------------------------------------
31 {
32  this->RequestedParameters.clear();
33 }
34 
35 //----------------------------------------------------------------------------
36 void vtkPlusWinProbeCommand::PrintSelf(ostream& os, vtkIndent indent)
37 {
38  this->Superclass::PrintSelf(os, indent);
39 }
40 
41 //----------------------------------------------------------------------------
43 {
44  this->SetName(WINPROBE_CMD);
45 }
46 
47 //----------------------------------------------------------------------------
48 void vtkPlusWinProbeCommand::GetCommandNames(std::list<std::string>& cmdNames)
49 {
50  cmdNames.clear();
51  cmdNames.push_back(WINPROBE_CMD);
52 }
53 
54 //----------------------------------------------------------------------------
55 std::string vtkPlusWinProbeCommand::GetDescription(const std::string& commandName)
56 {
57  std::string desc;
58  if (commandName.empty() || igsioCommon::IsEqualInsensitive(commandName, WINPROBE_CMD))
59  {
60  desc += WINPROBE_CMD;
61  desc += ": Send text data to WinProbe device.";
62  }
63  return desc;
64 }
65 
66 //----------------------------------------------------------------------------
68 {
69  return this->DeviceId;
70 }
71 
72 //----------------------------------------------------------------------------
73 void vtkPlusWinProbeCommand::SetDeviceId(const std::string& deviceId)
74 {
75  this->DeviceId = deviceId;
76 }
77 
78 //----------------------------------------------------------------------------
80 {
81  return this->CommandName;
82 }
83 
84 //----------------------------------------------------------------------------
86 {
87  this->CommandName = text;
88 }
89 
90 //----------------------------------------------------------------------------
92 {
93  return this->CommandValue;
94 }
95 
96 //----------------------------------------------------------------------------
98 {
99  this->CommandValue = text;
100 }
101 
102 //----------------------------------------------------------------------------
104 {
105  return this->CommandIndex;
106 }
107 
108 //----------------------------------------------------------------------------
109 void vtkPlusWinProbeCommand::SetCommandIndex(const std::string& index)
110 {
111  this->CommandIndex = index;
112 }
113 
114 //----------------------------------------------------------------------------
116 {
117  this->RequestedParameters.clear();
119  {
120  return PLUS_FAIL;
121  }
122 
123  this->SetDeviceId(aConfig->GetAttribute("DeviceId"));
124  LOG_INFO(aConfig->GetNumberOfNestedElements());
125 
126  for(int elemIndex = 0; elemIndex < aConfig->GetNumberOfNestedElements(); ++elemIndex)
127  {
128  vtkXMLDataElement* currentElem = aConfig->GetNestedElement(elemIndex);
129  if (igsioCommon::IsEqualInsensitive(currentElem->GetName(), "Parameter"))
130  {
131  const char* parameterName = currentElem->GetAttribute("Name");
132  const char* parameterValue = currentElem->GetAttribute("Value");
133  const char* parameterIndex = currentElem->GetAttribute("Index");
134  if (!parameterName) // Index and Value arent always needed
135  {
136  LOG_ERROR("Unable to find required Name attribute in " << (currentElem->GetName() ? currentElem->GetName() : "(undefined)") << " element in SetUsParameter command");
137  continue;
138  }
139  LOG_INFO("Adding " << parameterName << " to execution list")
140 
141  std::map<std::string, std::string> param_values;
142  if (parameterValue)
143  {
144  param_values["Value"] = parameterValue;
145  }
146  if (parameterIndex)
147  {
148  param_values["Index"] = parameterIndex;
149  }
150  std::pair<std::string, std::map<std::string, std::string>> parameter;
151  parameter.first = parameterName;
152  parameter.second = param_values;
153  RequestedParameters.push_back(parameter);
154  }
155  }
156  return PLUS_SUCCESS;
157 }
158 
159 //----------------------------------------------------------------------------
161 {
163  {
164  return PLUS_FAIL;
165  }
166 
167  XML_WRITE_STRING_ATTRIBUTE_IF_NOT_EMPTY(DeviceId, aConfig);
168 
169  // Write parameters as nested elements
170  std::list<std::pair<std::string, std::map<std::string, std::string>>>::iterator paramIt;
171  for (paramIt = this->RequestedParameters.begin(); paramIt != this->RequestedParameters.end(); ++paramIt)
172  {
173  vtkSmartPointer<vtkXMLDataElement> paramElem = vtkSmartPointer<vtkXMLDataElement>::New();
174  paramElem->SetName("Parameter");
175  paramElem->SetAttribute("Name", paramIt->first.c_str());
176  std::map<std::string, std::string> param_attributes = paramIt->second;
177  std::map<std::string, std::string>::iterator attribIt;
178  for(attribIt = param_attributes.begin(); attribIt != param_attributes.end(); ++attribIt)
179  {
180  paramElem->SetAttribute(attribIt->first.c_str(), attribIt->second.c_str());
181  }
182  aConfig->AddNestedElement(paramElem);
183  }
184  return PLUS_SUCCESS;
185 }
186 
187 //----------------------------------------------------------------------------
189 {
190  LOG_DEBUG("vtkPlusWinProbeCommand::Execute: " << (!this->CommandName.empty() ? this->CommandName : "(undefined)")
191  << ", device: " << (this->DeviceId.empty() ? "(undefined)" : this->DeviceId)
192  << ", value: " << (this->CommandValue.empty() ? "(undefined)" : this->CommandValue)
193  << ", index: " << (this->CommandIndex.empty() ? "(undefined)" : this->CommandIndex));
194 
195  // Data Collector
196  vtkPlusDataCollector* dataCollector = GetDataCollector();
197  if (dataCollector == NULL)
198  {
199  this->QueueCommandResponse(PLUS_FAIL, "Command failed. See error message.", "Invalid data collector.");
200  return PLUS_FAIL;
201  }
202 
203  // Get device pointer
204  if (this->DeviceId.empty())
205  {
206  this->QueueCommandResponse(PLUS_FAIL, "Command failed. See error message.", "No DeviceId specified.");
207  return PLUS_FAIL;
208  }
209  vtkPlusDevice* usDevice = NULL;
210  if (dataCollector->GetDevice(usDevice, this->DeviceId) != PLUS_SUCCESS)
211  {
212  this->QueueCommandResponse(PLUS_FAIL, "Command failed. See error message.", std::string("Device ")
213  + (this->DeviceId.empty() ? "(undefined)" : this->DeviceId) + std::string(" is not found."));
214  return PLUS_FAIL;
215  }
216  vtkPlusWinProbeVideoSource* device = dynamic_cast<vtkPlusWinProbeVideoSource*>(usDevice);
217 
218  // CommandName
219  if (!igsioCommon::IsEqualInsensitive(this->Name, WINPROBE_CMD))
220  {
221  this->QueueCommandResponse(PLUS_FAIL, "Command failed. See error message.", "Unknown command name: " + this->Name + ".");
222  return PLUS_FAIL;
223  }
224 
225  std::map < std::string, std::pair<IANA_ENCODING_TYPE, std::string> > metaData;
226  std::string resultString = "<CommandReply>";
227  std::string error = "";
228  std::string res = "";
229  PlusStatus status = PLUS_SUCCESS;
230  bool hasFailure = false;
231 
232  std::list<std::pair<std::string, std::map<std::string, std::string>>>::iterator paramIt;
233  for (paramIt = this->RequestedParameters.begin(); paramIt != this->RequestedParameters.end(); ++paramIt)
234  {
235  std::string parameterName = paramIt->first;
236  // Map of command parameter and value to be returned via meta data.
237  // For Gets, this will return the value and for sets, this will return the success
238  // For example: "GetMDepth", "10" or "SetARFITxCycleCount", "SUCCESS"
239  std::map<std::string, std::string> attribs = paramIt->second;
240 
241  resultString += "<Parameter Name=\"" + parameterName + "\"";
242 
243  // Search for command
244  PlusStatus status;
245 
246  // Assign value and index
247  std::string value = attribs["Value"];
248  int index;
249  try { // try to cast index to number, but index may not always exist
250  index = std::stoi(attribs["Index"]);
251  }
252  catch (const std::invalid_argument& ia) {
253  index = -1;
254  }
255 
256  // Option 1: Get
257  if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_FREEZE)
258  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_TGC)
259  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_MULTIFOCAL_ZONE_COUNT)
260  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_FOCAL_DEPTH)
261  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_FOCAL_DEPTH)
262  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_FIRST_GAIN_VALUE)
263  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_TGC_OVERALL_GAIN)
264  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_SPATIAL_COMPOUND_ENABLED)
265  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_SPATIAL_COMPOUND_ANGLE)
266  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_SPATIAL_COMPOUND_COUNT)
267  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_MMODE_ENABLED)
268  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_M_REVOLVING_ENABLED)
269  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_RF_MODE_ENABLED)
270  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_MPR_FREQUENCY)
271  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_M_LINE_INDEX)
272  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_M_LINE_COUNT)
273  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_M_WIDTH)
274  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_M_DEPTH)
275  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_DECIMATION)
276  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_PRF)
277  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_FRAME_RATE_LIMIT)
278  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_HARMONIC_ENABLED)
279  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_BUBBLE_CONTRAST_ENABLED)
280  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_AMPLITUDE_MODULATION_ENABLED)
281  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_TRANSMIT_LOCKED)
282  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_TRANSMIT_CURRENT)
283  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_TRANSMIT_CYCLE_COUNT)
284  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_TRANSMIT_FNUMBER)
285  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_APODIZATION_FNUMBER)
286  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_BUBBLE_DESTRUCTION_ENABLED)
287  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_BUBBLE_DESTRUCTION_CYCLE_COUNT)
288  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_TX_FILTER_COEFFICIENT_SET)
289  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_TRANSDUCER_INTERNAL_ID)
290  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_ENABLED)
291  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_START_SAMPLE)
292  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_STOP_SAMPLE)
293  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_PRE_PUSH_LINE_REPEAT_COUNT)
294  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_POST_PUSH_LINE_REPEAT_COUNT)
295  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_INTER_SET_DELAY)
296  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_INTER_PUSH_DELAY)
297  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_LINE_TIMER)
298  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_TX_CYCLE_COUNT)
299  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_TX_CYCLE_WIDTH)
300  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_TX_TX_CYCLE_COUNT)
301  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_TX_TX_CYCLE_WIDTH)
302  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_PUSH_CONFIG)
303  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_FPGA_REV_DATE_STRING)
304  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_X8BF_ENABLED))
305  {
306  if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_FREEZE))
307  res = device->IsFrozen() ? "True" : "False";
308  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_TGC))
309  res = std::to_string(device->GetTimeGainCompensation(index));
310  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_MULTIFOCAL_ZONE_COUNT))
311  res = std::to_string(device->GetBMultiFocalZoneCount());
312  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_FOCAL_DEPTH))
313  res = std::to_string(device->GetFocalPointDepth(index));
314  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_FOCAL_DEPTH))
315  res = std::to_string(device->GetARFIFocalPointDepth(index));
316  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_FIRST_GAIN_VALUE))
317  res = std::to_string(device->GetFirstGainValue());
318  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_TGC_OVERALL_GAIN))
320  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_SPATIAL_COMPOUND_ENABLED))
321  res = device->GetSpatialCompoundEnabled() ? "True" : "False";
322  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_SPATIAL_COMPOUND_ANGLE))
323  res = std::to_string(device->GetSpatialCompoundAngle());
324  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_SPATIAL_COMPOUND_COUNT))
325  res = std::to_string(device->GetSpatialCompoundCount());
326  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_MMODE_ENABLED))
327  res = device->GetMModeEnabled() ? "True" : "False";
328  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_M_REVOLVING_ENABLED))
329  res = device->GetMRevolvingEnabled() ? "True" : "False";
330  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_RF_MODE_ENABLED))
331  res = device->GetBRFEnabled() ? "True" : "False";
332  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_MPR_FREQUENCY))
333  res = std::to_string(device->GetMPRFrequency());
334  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_M_LINE_INDEX))
335  res = std::to_string(device->GetMLineIndex());
336  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_M_LINE_COUNT))
337  res = std::to_string(device->GetMAcousticLineCount());
338  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_M_WIDTH))
339  res = std::to_string(device->GetMWidth());
340  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_M_DEPTH))
341  res = std::to_string(device->GetMDepth());
342  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_DECIMATION))
343  res = std::to_string(device->GetSSDecimation());
344  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_FRAME_RATE_LIMIT))
345  res = std::to_string(device->GetBFrameRateLimit());
346  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_PRF))
347  res = std::to_string(device->GetBPRF());
348  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_HARMONIC_ENABLED))
349  res = device->GetBHarmonicEnabled() ? "True" : "False";
350  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_BUBBLE_CONTRAST_ENABLED))
351  res = device->GetBBubbleContrastEnabled() ? "True" : "False";
352  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_AMPLITUDE_MODULATION_ENABLED))
353  res = device->GetBAmplitudeModulationEnabled() ? "True" : "False";
354  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_TRANSMIT_LOCKED))
355  res = device->GetBTransmitLocked() ? "True" : "False";
356  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_TRANSMIT_CURRENT))
357  res = std::to_string(device->GetBTransmitCurrent());
358  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_TRANSMIT_CYCLE_COUNT))
359  res = std::to_string(device->GetBTransmitCycleCount());
360  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_TRANSMIT_FNUMBER))
361  res = std::to_string(device->GetBTransmitFNumber());
362  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_APODIZATION_FNUMBER))
363  res = std::to_string(device->GetBApodizationFNumber());
364  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_BUBBLE_DESTRUCTION_ENABLED))
365  res = device->GetBBubbleDestructionEnabled() ? "True" : "False";
366  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_BUBBLE_DESTRUCTION_CYCLE_COUNT))
368  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_B_TX_FILTER_COEFFICIENT_SET))
370  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_TRANSDUCER_INTERNAL_ID))
371  res = std::to_string(device->GetTransducerInternalID());
372  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_ENABLED))
373  res = device->GetARFIEnabled() ? "True" : "False";
374  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_START_SAMPLE))
375  res = std::to_string(device->GetARFIStartSample());
376  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_STOP_SAMPLE))
377  res = std::to_string(device->GetARFIStopSample());
378  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_PRE_PUSH_LINE_REPEAT_COUNT))
380  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_POST_PUSH_LINE_REPEAT_COUNT))
382  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_INTER_SET_DELAY))
383  res = std::to_string(device->GetARFIInterSetDelay());
384  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_INTER_PUSH_DELAY))
385  res = std::to_string(device->GetARFIInterPushDelay());
386  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_LINE_TIMER))
387  res = std::to_string(device->GetARFILineTimer());
388  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_TX_CYCLE_COUNT))
389  res = std::to_string(device->GetARFITxCycleCount());
390  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_TX_CYCLE_WIDTH))
391  res = std::to_string(device->GetARFITxCycleWidth());
392  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_TX_TX_CYCLE_COUNT))
393  res = std::to_string(device->GetARFITxTxCycleCount());
394  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_TX_TX_CYCLE_WIDTH))
395  res = std::to_string(device->GetARFITxTxCycleWidth());
396  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_ARFI_PUSH_CONFIG))
397  res = device->GetARFIPushConfigurationString();
398  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_FPGA_REV_DATE_STRING))
399  res = device->GetFPGARevDateString();
400  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::GET_X8BF_ENABLED))
401  res = device->GetARFIIsX8BFEnabled() ? "True" : "False";
402 
403  if (res != "")
404  {
405  status = PLUS_SUCCESS;
406  resultString += " Success=\"true\"";
407  if (index != -1)
408  resultString += " Index=\"" + std::to_string(index) + "\"";
409  resultString += " Value=\"" + res + "\"";
410  metaData[parameterName] = std::make_pair(IANA_TYPE_US_ASCII, res);
411  }
412  else
413  {
414  status = PLUS_FAIL;
415  resultString += " Success=\"false\"";
416  }
417  }
418 
419  // Option 2: Set
420  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_FREEZE)
421  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_TGC)
422  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_MULTIFOCAL_ZONE_COUNT)
423  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_FOCAL_DEPTH)
424  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_FOCAL_DEPTH)
425  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_FIRST_GAIN_VALUE)
426  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_TGC_OVERALL_GAIN)
427  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_SPATIAL_COMPOUND_ENABLED)
428  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_SPATIAL_COMPOUND_COUNT)
429  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_MMODE_ENABLED)
430  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_M_REVOLVING_ENABLED)
431  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_RF_MODE_ENABLED)
432  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_MPR_FREQUENCY)
433  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_M_LINE_COUNT)
434  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_M_WIDTH)
435  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_M_DEPTH)
436  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_DECIMATION)
437  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_FRAME_RATE_LIMIT)
438  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_HARMONIC_ENABLED)
439  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_BUBBLE_CONTRAST_ENABLED)
440  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_AMPLITUDE_MODULATION_ENABLED)
441  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_TRANSMIT_LOCKED)
442  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_TRANSMIT_CURRENT)
443  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_TRANSMIT_CYCLE_COUNT)
444  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_TRANSMIT_FNUMBER)
445  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_APODIZATION_FNUMBER)
446  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_BUBBLE_DESTRUCTION_ENABLED)
447  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_BUBBLE_DESTRUCTION_CYCLE_COUNT)
448  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_TX_FILTER_COEFFICIENT_SET)
449  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_ENABLED)
450  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_START_SAMPLE)
451  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_STOP_SAMPLE)
452  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_PRE_PUSH_LINE_REPEAT_COUNT)
453  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_POST_PUSH_LINE_REPEAT_COUNT)
454  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_INTER_SET_DELAY)
455  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_INTER_PUSH_DELAY)
456  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_LINE_TIMER)
457  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_TX_CYCLE_COUNT)
458  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_TX_CYCLE_WIDTH)
459  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_TX_TX_CYCLE_COUNT)
460  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_TX_TX_CYCLE_WIDTH)
461  || igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_PUSH_CONFIG))
462  {
463  if (value == "")
464  {
465  status = PLUS_FAIL;
466  std::string success = "false";
467  std::string status_msg = "MISSING INFO";
468  error += "Insufficient information for \"" + parameterName + "\"\n";
469  resultString += " Success=\"" + success + "\"";
470  metaData[parameterName] = std::make_pair(IANA_TYPE_US_ASCII, status_msg);
471  continue;
472  }
473 
474  if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_FREEZE))
475  {
476  bool set = igsioCommon::IsEqualInsensitive(value, "true") ? true : false;
477  status = device->FreezeDevice(set);
478  }
479  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_TGC))
480  {
481  double tgc_value = stod(value);
482  status = device->SetTimeGainCompensation(index, tgc_value);
483  }
484  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_MULTIFOCAL_ZONE_COUNT))
485  {
486  int32_t count = stoi(value);
487  status = device->SetBMultiFocalZoneCount(count);
488  }
489  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_FOCAL_DEPTH))
490  {
491  float depth_value = stof(value);
492  status = device->SetFocalPointDepth(index, depth_value);
493  }
494  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_FOCAL_DEPTH))
495  {
496  float depth_value = stof(value);
497  status = device->SetARFIFocalPointDepth(index, depth_value);
498  }
499  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_FIRST_GAIN_VALUE))
500  {
501  double gain_value = stod(value);
502  status = device->SetFirstGainValue(gain_value);
503  }
504  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_TGC_OVERALL_GAIN))
505  {
506  double tgc_value = stod(value);
507  status = device->SetOverallTimeGainCompensation(tgc_value);
508  }
509  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_SPATIAL_COMPOUND_ENABLED))
510  {
511  bool set = igsioCommon::IsEqualInsensitive(value, "true") ? true : false;
513  status = PLUS_SUCCESS;
514  }
515  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_SPATIAL_COMPOUND_COUNT))
516  {
517  int32_t count = stoi(value);
519  status = PLUS_SUCCESS;
520  }
521  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_MMODE_ENABLED))
522  {
523  bool set = igsioCommon::IsEqualInsensitive(value, "true") ? true : false;
524  device->SetMModeEnabled(set);
525  status = PLUS_SUCCESS;
526  }
527  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_M_REVOLVING_ENABLED))
528  {
529  bool set = igsioCommon::IsEqualInsensitive(value, "true") ? true : false;
530  device->SetMRevolvingEnabled(set);
531  status = PLUS_SUCCESS;
532  }
533  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_RF_MODE_ENABLED))
534  {
535  bool set = igsioCommon::IsEqualInsensitive(value, "true") ? true : false;
536  device->SetBRFEnabled(set);
537  status = PLUS_SUCCESS;
538  }
539  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_MPR_FREQUENCY))
540  {
541  int32_t frequency = stoi(value);
542  device->SetMPRFrequency(frequency);
543  status = PLUS_SUCCESS;
544  }
545  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_M_LINE_COUNT))
546  {
547  int32_t count = stoi(value);
548  device->SetMAcousticLineCount(count);
549  status = PLUS_SUCCESS;
550  }
551  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_M_WIDTH))
552  {
553  int32_t width = stoi(value);
554  device->SetMWidth(width);
555  status = PLUS_SUCCESS;
556  }
557  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_M_DEPTH))
558  {
559  int32_t depth = stoi(value);
560  device->SetMDepth(depth);
561  status = PLUS_SUCCESS;
562  }
563  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_DECIMATION))
564  {
565  int32_t val = stoi(value);
566  status = device->SetSSDecimation(val);
567  status = PLUS_SUCCESS;
568  }
569  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_FRAME_RATE_LIMIT))
570  {
571  int32_t val = stoi(value);
572  device->SetBFrameRateLimit(val);
573  status = PLUS_SUCCESS;
574  }
575  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_HARMONIC_ENABLED))
576  {
577  bool set = igsioCommon::IsEqualInsensitive(value, "true") ? true : false;
578  device->SetBHarmonicEnabled(set);
579  status = PLUS_SUCCESS;
580  }
581  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_BUBBLE_CONTRAST_ENABLED))
582  {
583  bool set = igsioCommon::IsEqualInsensitive(value, "true") ? true : false;
585  status = PLUS_SUCCESS;
586  }
587  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_AMPLITUDE_MODULATION_ENABLED))
588  {
589  bool set = igsioCommon::IsEqualInsensitive(value, "true") ? true : false;
591  status = PLUS_SUCCESS;
592  }
593  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_TRANSMIT_LOCKED))
594  {
595  bool set = igsioCommon::IsEqualInsensitive(value, "true") ? true : false;
596  device->SetBTransmitLocked(set);
597  status = PLUS_SUCCESS;
598  }
599  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_TRANSMIT_CURRENT))
600  {
601  int val = stoi(value);
602  device->SetBTransmitCurrent(val);
603  status = PLUS_SUCCESS;
604  }
605  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_TRANSMIT_CYCLE_COUNT))
606  {
607  uint16_t val = stoi(value);
608  device->SetBTransmitCycleCount(val);
609  status = PLUS_SUCCESS;
610  }
611  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_TRANSMIT_FNUMBER))
612  {
613  double val = stod(value);
614  device->SetBTransmitFNumber(val);
615  status = PLUS_SUCCESS;
616  }
617  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_APODIZATION_FNUMBER))
618  {
619  double val = stod(value);
620  device->SetBApodizationFNumber(val);
621  status = PLUS_SUCCESS;
622  }
623  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_BUBBLE_DESTRUCTION_ENABLED))
624  {
625  bool set = igsioCommon::IsEqualInsensitive(value, "true") ? true : false;
627  status = PLUS_SUCCESS;
628  }
629  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_BUBBLE_DESTRUCTION_CYCLE_COUNT))
630  {
631  uint8_t val = stod(value);
632  device->SetBBubbleDestructionCycleCount(val);
633  status = PLUS_SUCCESS;
634  }
635  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_B_TX_FILTER_COEFFICIENT_SET))
636  {
637  int32_t val = stod(value);
638  device->SetBTXFilterCoefficientSet(val);
639  status = PLUS_SUCCESS;
640  }
641  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_ENABLED))
642  {
643  bool set = igsioCommon::IsEqualInsensitive(value, "true") ? true : false;
644  device->SetARFIEnabled(set);
645  status = PLUS_SUCCESS;
646  }
647  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_START_SAMPLE))
648  {
649  int32_t val = stoi(value);
650  device->SetARFIStartSample(val);
651  status = PLUS_SUCCESS;
652  }
653  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_STOP_SAMPLE))
654  {
655  int32_t val = stoi(value);
656  device->SetARFIStopSample(val);
657  status = PLUS_SUCCESS;
658  }
659  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_PRE_PUSH_LINE_REPEAT_COUNT))
660  {
661  int32_t val = stoi(value);
662  status = device->SetARFIPrePushLineRepeatCount(val);
663  }
664  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_POST_PUSH_LINE_REPEAT_COUNT))
665  {
666  int32_t val = stoi(value);
667  status = device->SetARFIPostPushLineRepeatCount(val);
668  }
669  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_INTER_SET_DELAY))
670  {
671  int32_t val = stoi(value);
672  status = device->SetARFIInterSetDelay(val);
673  }
674  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_INTER_PUSH_DELAY))
675  {
676  int32_t val = stoi(value);
677  status = device->SetARFIInterPushDelay(val);
678  }
679  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_LINE_TIMER))
680  {
681  int32_t val = stoi(value);
682  status = device->SetARFILineTimer(val);
683  }
684  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_TX_CYCLE_COUNT))
685  {
686  int32_t val = stoi(value);
687  status = device->SetARFITxCycleCount(val);
688  }
689  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_TX_CYCLE_WIDTH))
690  {
691  int32_t val = stoi(value);
692  status = device->SetARFITxCycleWidth(val);
693  }
694  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_TX_TX_CYCLE_COUNT))
695  {
696  int32_t val = stoi(value);
697  status = device->SetARFITxTxCycleCount(val);
698  }
699  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_TX_TX_CYCLE_WIDTH))
700  {
701  int32_t val = stoi(value);
702  status = device->SetARFITxTxCycleWidth(val);
703  }
704  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ARFI_PUSH_CONFIG))
705  {
707  status = PLUS_SUCCESS;
708  }
709 
710  if (status == PLUS_SUCCESS)
711  {
712  std::string success = "true";
713  std::string status_msg = "SUCCESS";
714  resultString += " Success=\"" + success + "\"";
715  metaData[parameterName] = std::make_pair(IANA_TYPE_US_ASCII, status_msg);
716  }
717  else
718  {
719  std::string success = "false";
720  std::string status_msg = "FAIL";
721  resultString += " Success=\"" + success + "\"";
722  metaData[parameterName] = std::make_pair(IANA_TYPE_US_ASCII, status_msg);
723  }
724  }
725 
726  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_M_LINE_INDEX))
727  {
728  device->SetMLineIndex(index);
729  status = PLUS_SUCCESS;
730 
731  std::string status_msg = "SUCCESS";
732  resultString += " Success=\"true\"";
733  metaData[parameterName] = std::make_pair(IANA_TYPE_US_ASCII, status_msg);
734  }
735 
736  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ALL_FOCAL_DEPTHS))
737  {
738  std::istringstream ss(value);
739  std::string val;
740  status = PLUS_SUCCESS;
741  for(int i = 0; i < 4; i++)
742  {
743  ss >> val;
744  status = status == PLUS_SUCCESS ? device->SetFocalPointDepth(i, stof(val)) : PLUS_FAIL;
745  if (status != PLUS_SUCCESS)
746  {
747  error += "Error setting Focal Depth " + std::to_string(i) + " to " + val + "\n";
748  break;
749  }
750  }
751 
752  std::string success = status == PLUS_SUCCESS ? "true" : "false";
753  std::string status_msg = status == PLUS_SUCCESS ? "SUCCESS" : "FAIL";
754  resultString += " Success=\"" + success + "\"";
755  metaData[parameterName] = std::make_pair(IANA_TYPE_US_ASCII, status_msg);
756  }
757  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::SET_ALL_ARFI_FOCAL_DEPTHS))
758  {
759  std::istringstream ss(value);
760  std::string val;
761  status = PLUS_SUCCESS;
762  for(int i = 0; i < 6; i++)
763  {
764  ss >> val;
765  status = status == PLUS_SUCCESS ? device->SetARFIFocalPointDepth(i, stof(val)) : PLUS_FAIL;
766  if (status != PLUS_SUCCESS)
767  {
768  error += "Error setting Focal Depth " + std::to_string(i) + " to " + val + "\n";
769  break;
770  }
771  }
772 
773  std::string success = status == PLUS_SUCCESS ? "true" : "false";
774  std::string status_msg = status == PLUS_SUCCESS ? "SUCCESS" : "FAIL";
775  resultString += " Success=\"" + success + "\"";
776  metaData[parameterName] = std::make_pair(IANA_TYPE_US_ASCII, status_msg);
777  }
778  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::IS_SCANNING))
779  {
780  res = device->IsScanning() ? "True" : "False";
781 
782  status = PLUS_SUCCESS;
783  resultString += " Success=\"true\"";
784  resultString += " Value=\"" + res + "\"";
785  metaData[parameterName] = std::make_pair(IANA_TYPE_US_ASCII, res);
786  }
787  else if (igsioCommon::IsEqualInsensitive(parameterName, vtkPlusWinProbeVideoSource::UV_SEND_COMMAND))
788  {
789  status = device->SendCommand(value.c_str());
790 
791  std::string success = status == PLUS_SUCCESS ? "true" : "false";
792  std::string status_msg = status == PLUS_SUCCESS ? "SUCCESS" : "FAIL";
793  resultString += " Success=\"" + success + "\"";
794  metaData[parameterName] = std::make_pair(IANA_TYPE_US_ASCII, success);
795  }
796  else
797  {
798  status = PLUS_FAIL;
799  resultString += " Success=\"false\"";
800  error += "No parameter named \"" + parameterName + "\"\n";
801  metaData[parameterName] = std::make_pair(IANA_TYPE_US_ASCII, "Unknown Parameter");
802  }
803  if (status != PLUS_SUCCESS)
804  hasFailure = true;
805  resultString += "/>\n";
806  }
807  resultString += "</CommandReply>";
808  if (hasFailure)
809  status = PLUS_FAIL;
810 
811  vtkSmartPointer<vtkPlusCommandRTSCommandResponse> commandResponse = vtkSmartPointer<vtkPlusCommandRTSCommandResponse>::New();
812  commandResponse->UseDefaultFormatOff();
813  commandResponse->SetClientId(this->ClientId);
814  commandResponse->SetOriginalId(this->Id);
815  commandResponse->SetDeviceName(this->DeviceName);
816  commandResponse->SetCommandName(this->GetName());
817  commandResponse->SetStatus(status);
818  commandResponse->SetRespondWithCommandMessage(this->RespondWithCommandMessage);
819  commandResponse->SetErrorString(error);
820  commandResponse->SetResultString(resultString);
821  commandResponse->SetParameters(metaData);
822  this->CommandResponseQueue.push_back(commandResponse);
823  return PLUS_SUCCESS;
824 
825 }
void SetARFIPushConfigurationString(std::string pushConfiguration)
static const char * SET_SPATIAL_COMPOUND_COUNT
static const char * GET_B_TRANSMIT_CURRENT
static const char * GET_B_BUBBLE_CONTRAST_ENABLED
static const char * SET_ARFI_TX_TX_CYCLE_WIDTH
virtual void PrintSelf(ostream &os, vtkIndent indent)
static const char * GET_ARFI_POST_PUSH_LINE_REPEAT_COUNT
static const char * SET_B_AMPLITUDE_MODULATION_ENABLED
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
virtual void PrintSelf(ostream &os, vtkIndent indent)
static const char * GET_SPATIAL_COMPOUND_ANGLE
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *aConfig)
PlusStatus SetARFITxTxCycleWidth(uint8_t propertyValue)
PlusStatus GetDevice(vtkPlusDevice *&aDevice, const std::string &aDeviceId) const
PlusStatus SetARFITxCycleCount(uint16_t propertyValue)
std::string Name
PlusStatus SendCommand(const char *command)
static const char * GET_SPATIAL_COMPOUND_COUNT
static const char * SET_B_TX_FILTER_COEFFICIENT_SET
static const char * GET_B_FRAME_RATE_LIMIT
void SetCommandName(const std::string &text)
void SetCommandValue(const std::string &text)
static const char * GET_B_HARMONIC_ENABLED
static const char * SET_ARFI_TX_TX_CYCLE_COUNT
igsioStatus PlusStatus
Definition: PlusCommon.h:40
static const char * GET_B_MULTIFOCAL_ZONE_COUNT
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *aConfig)
static const char * SET_SPATIAL_COMPOUND_ENABLED
PlusStatus SetFocalPointDepth(int index, float depth)
std::string to_string(ClariusAvailability avail)
PlusStatus SetTimeGainCompensation(int index, double value)
for i
static const char * SET_B_TRANSMIT_CURRENT
static const char * GET_B_BUBBLE_DESTRUCTION_ENABLED
static const char * GET_B_APODIZATION_FNUMBER
vtkStandardNewMacro(vtkPlusWinProbeCommand)
static const char * GET_ARFI_TX_TX_CYCLE_WIDTH
#define PLUS_FAIL
Definition: PlusCommon.h:43
static const char * GET_B_BUBBLE_DESTRUCTION_CYCLE_COUNT
static const char * GET_SPATIAL_COMPOUND_ENABLED
static const char * SET_ARFI_PRE_PUSH_LINE_REPEAT_COUNT
This command is for communicating with vtkPlusWinProbeDevices.This command is used for communicating ...
static const char * SET_B_BUBBLE_CONTRAST_ENABLED
void SetBBubbleDestructionCycleCount(int16_t value)
Class for acquiring ultrasound images from WinProbe ultrasound systems.
virtual std::string GetDeviceId() const
PhidgetLCD_Font int int const char * text
Definition: phidget22.h:4287
static const char * GET_ARFI_INTER_PUSH_DELAY
virtual std::string GetDescription(const std::string &commandName)
PlusStatus SetBMultiFocalZoneCount(int32_t count)
PlusStatus SetARFIPrePushLineRepeatCount(int32_t propertyValue)
Manages devices that record image or positional data.
#define PLUS_SUCCESS
Definition: PlusCommon.h:44
PlusStatus SetFirstGainValue(double value)
PlusStatus SetARFIPostPushLineRepeatCount(int32_t propertyValue)
static const char * GET_FPGA_REV_DATE_STRING
virtual void SetDeviceId(const std::string &deviceId)
PlusStatus SetARFITxTxCycleCount(uint16_t propertyValue)
bool RespondWithCommandMessage
static const char * GET_B_TRANSMIT_CYCLE_COUNT
PlusStatus SetARFIInterPushDelay(int32_t propertyValue)
PlusStatus SetSSDecimation(uint8_t value)
PlusStatus SetARFIFocalPointDepth(int index, float depth)
std::string GetCommandValue() const
PhidgetLCD_Font int * width
Definition: phidget22.h:4275
std::string GetCommandIndex() const
void QueueCommandResponse(PlusStatus status, const std::string &message, const std::string &error="", const igtl::MessageBase::MetaDataMap *metaData=nullptr)
virtual vtkPlusDataCollector * GetDataCollector()
static const char * SET_B_BUBBLE_DESTRUCTION_CYCLE_COUNT
std::string DeviceId
std::string DeviceName
const char const char * value
Definition: phidget22.h:5111
Phidget_ChannelClass uint32_t * count
Definition: phidget22.h:1321
PlusStatus SetARFIInterSetDelay(int32_t propertyValue)
static const char * SET_B_BUBBLE_DESTRUCTION_ENABLED
static const char * SET_B_MULTIFOCAL_ZONE_COUNT
PlusStatus SetARFITxCycleWidth(uint8_t propertyValue)
static const char * SET_ALL_ARFI_FOCAL_DEPTHS
static const char * GET_B_AMPLITUDE_MODULATION_ENABLED
static const char * GET_B_TRANSMIT_FNUMBER
static const char * SET_ARFI_INTER_SET_DELAY
static const char * GET_M_REVOLVING_ENABLED
static const char * SET_B_TRANSMIT_CYCLE_COUNT
set(gca, 'XTick', axisXRange(1):1:axisXRange(2))
void SetCommandIndex(const std::string &text)
PlusStatus SetOverallTimeGainCompensation(double value)
static const char * SET_ARFI_POST_PUSH_LINE_REPEAT_COUNT
static const char * SET_ARFI_INTER_PUSH_DELAY
static const char * GET_B_TX_FILTER_COEFFICIENT_SET
static const char * SET_B_HARMONIC_ENABLED
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *aConfig)
PlusCommandResponseList CommandResponseQueue
static const char * SET_B_FRAME_RATE_LIMIT
double frequency
Definition: phidget22.h:3246
std::string GetCommandName() const
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *aConfig)
static const char * SET_B_TRANSMIT_FNUMBER
PlusStatus SetARFILineTimer(uint16_t propertyValue)
static const char * GET_ARFI_PRE_PUSH_LINE_REPEAT_COUNT
static const char * SET_M_REVOLVING_ENABLED
static const char * GET_ARFI_INTER_SET_DELAY
static const char * GET_ARFI_TX_TX_CYCLE_COUNT
virtual void GetCommandNames(std::list< std::string > &cmdNames)
static const char * SET_B_APODIZATION_FNUMBER
static const char * GET_TRANSDUCER_INTERNAL_ID