---
# System prepended metadata

title: BlueStar Software

---

###  Example 8 Summary

**📄 File Modified:** `DeviceModel.cs`
**🔧 Function:** `DownloadFirmwarePackage()`
**📝 Change Description:**
Replaced the hardcoded version-specific firmware package name with a generic one.

**🔄 Before:**

```csharp
string packagesName = "FocusPxPackage-1.3";
```

**✅ After:**

```csharp
string packagesName = "FocusPxPackage";
```


Configration of FocusPX device
```xml
<?xml version="1.0"?>
<Device SerialNumber="QC-005405">
    <AcquisitionRate>20000.000000</AcquisitionRate>
    <PulseRepetitionFrequencyMode>Manual</PulseRepetitionFrequencyMode>
    <Technology Type="Ultrasound">
        <Encoders Quantity="6">
            <Encoder>
                <Enabled>False</Enabled>
                <Preset>0</Preset>
                <StepCount>1</StepCount>
                <PaceGeneration>Bidirectional</PaceGeneration>
                <Type>Quadrature</Type>
                <ResetOnCount>False</ResetOnCount>
                <DebounceFilter>0</DebounceFilter>
            </Encoder>
            <Encoder>
                <Enabled>False</Enabled>
                <Preset>0</Preset>
                <StepCount>1</StepCount>
                <PaceGeneration>Bidirectional</PaceGeneration>
                <Type>Quadrature</Type>
                <ResetOnCount>False</ResetOnCount>
                <DebounceFilter>0</DebounceFilter>
            </Encoder>
            <Encoder>
                <Enabled>False</Enabled>
                <Preset>0</Preset>
                <StepCount>0</StepCount>
                <PaceGeneration>Bidirectional</PaceGeneration>
                <Type>Dir</Type>
                <ResetOnCount>False</ResetOnCount>
                <DebounceFilter>0</DebounceFilter>
            </Encoder>
            <Encoder>
                <Enabled>False</Enabled>
                <Preset>0</Preset>
                <StepCount>0</StepCount>
                <PaceGeneration>Bidirectional</PaceGeneration>
                <Type>Dir</Type>
                <ResetOnCount>False</ResetOnCount>
                <DebounceFilter>0</DebounceFilter>
            </Encoder>
            <Encoder>
                <Enabled>False</Enabled>
                <Preset>0</Preset>
                <StepCount>0</StepCount>
                <PaceGeneration>Bidirectional</PaceGeneration>
                <Type>Dir</Type>
                <ResetOnCount>False</ResetOnCount>
                <DebounceFilter>0</DebounceFilter>
            </Encoder>
            <Encoder>
                <Enabled>False</Enabled>
                <Preset>0</Preset>
                <StepCount>0</StepCount>
                <PaceGeneration>Bidirectional</PaceGeneration>
                <Type>Dir</Type>
                <ResetOnCount>False</ResetOnCount>
                <DebounceFilter>0</DebounceFilter>
            </Encoder>
        </Encoders>
        <Beams Quantity="1">
            <Beam FiringOrder="0">
                <ConnectorType>MultiElement</ConnectorType>
                <PulseRepetitionFrequency>20080</PulseRepetitionFrequency>
                <AscanMode>Disabled</AscanMode>
                <AscanData>EightBits</AscanData>
                <AscanStart>0.000000</AscanStart>
                <AscanRange>5120.000000</AscanRange>
                <AscanPointQuantity>512</AscanPointQuantity>
                <AscanCompressionFactor>1</AscanCompressionFactor>
                <CompressionMode>Compression</CompressionMode>
                <CompressionType>Absolute</CompressionType>
                <DynamicAscanLength>PointQty</DynamicAscanLength>
                <AverageFactor>One</AverageFactor>
                <AscanSynchro>Absolute</AscanSynchro>
                <Rectification>None</Rectification>
                <PreDecimationFactor>1</PreDecimationFactor>
                <AmplitudeDataScaling>Linear</AmplitudeDataScaling>
                <InputGain>0.000000</InputGain>
                <Filters>
                    <Filter Type="BandPass">
                        <Id>0</Id>
                        <Type>0</Type>
                        <Characterization>
                            <Characteristic>None</Characteristic>
                        </Characterization>
                        <CenterFrequency>0.000000</CenterFrequency>
                        <LowCutOffFrequency>1000000.000000</LowCutOffFrequency>
                        <HighCutOffFrequency>17800000.000000</HighCutOffFrequency>
                    </Filter>
                    <Filter Type="Smoothing">
                        <Enabled>False</Enabled>
                        <Frequency>0.000000</Frequency>
                    </Filter>
                </Filters>
                <Gates Quantity="5">
                    <Gate>
                        <Enabled>False</Enabled>
                        <ThresholdType>Absolute</ThresholdType>
                        <Threshold>0</Threshold>
                        <Start>0.000000</Start>
                        <Length>320.000000</Length>
                    </Gate>
                    <Gate>
                        <Enabled>False</Enabled>
                        <ThresholdType>Absolute</ThresholdType>
                        <Threshold>0</Threshold>
                        <Start>0.000000</Start>
                        <Length>320.000000</Length>
                    </Gate>
                    <Gate>
                        <Enabled>False</Enabled>
                        <ThresholdType>Absolute</ThresholdType>
                        <Threshold>0</Threshold>
                        <Start>0.000000</Start>
                        <Length>320.000000</Length>
                    </Gate>
                    <Gate>
                        <Enabled>False</Enabled>
                        <ThresholdType>Absolute</ThresholdType>
                        <Threshold>0</Threshold>
                        <Start>0.000000</Start>
                        <Length>320.000000</Length>
                    </Gate>
                    <Gate>
                        <Enabled>False</Enabled>
                        <ThresholdType>Absolute</ThresholdType>
                        <Threshold>0</Threshold>
                        <Start>0.000000</Start>
                        <Length>320.000000</Length>
                    </Gate>
                </Gates>
                <VoltageCode>0</VoltageCode>
                <PAGainValue>0.000000</PAGainValue>
                <PAGainIsAuto>True</PAGainIsAuto>
                <Pulsers Quantity="0"/>
                <Receivers Quantity="0"/>
                <Tcg Type="Digital">
                    <Enabled>False</Enabled>
                </Tcg>
            </Beam>
        </Beams>
    </Technology>
</Device>
```


[Configration in the sampla application](https://workdrive.zoho.in/file/ekdik4028daf5bc2345d4927d576522a98ea2)

# Process Flow And Requirements.

Inpsection Steps
## Step1: Track Selection: 55kg or 60Kg
Once we select the Track system should shows Cross Sectional View and Side View
## Step2: Probe C Wedge Selection
Probe: 5l16-A10, Wedge: SA10-N55S-HIS


## Step3: 1. Main Setup 2. Web and Tail Verification

Angle: 36 to 76degree, Index Offset: 40 to 50mm for Main Setup
Angle: 36 to 76degree, Index Offset: 80 to 120mm for Web and tail verification
### Setup Phase

| Method | Description |
|--------|-------------|
| `deviceModel.InitiateAcquisition()` | Initializes the acquisition system — sets up hardware/driver for data collection. |
| `deviceModel.BindPAConnector()` | Connects software to the correct PA (Phased Array) port or probe channel. |
| `deviceModel.CreatPAFocusedBeamSet(…)` | Configures a focused beam pattern using delay laws (for signal focus). |
| `deviceModel.acquisition.ApplyConfiguration()` | Applies all settings like gain, length, delays, etc., to the hardware. |
| `deviceModel.acquisition.Start()` | Starts the continuous data acquisition from the device. |

### Live Data Fetching Phase

| Method | Description |
|--------|-------------|
| `acquisition.WaitForDataEx()` | Blocks and waits until a new cycle of data is available. |
| `result.cycleData` | Returns the acquired cycle data (snapshot of device readings). |
| `cycleData.GetAscanCollection()` | Retrieves all A-scan signals from the cycle. |
| `GetAscan(0)` | Gets the first A-scan (one channel’s waveform data). |
| `ascan.GetData()` | Returns a raw pointer (`IntPtr`) to the signal buffer (unmanaged memory). |

## Step 4: Configuration (UT) Setting

### Key UT Parameters:
1. **Range**
2. **Gain**
3. **Filter**
4. **Pulse Width**
5. **Voltage**

```cpp

void ConfigurePhasedArray(IPhasedArrayConfigurationPtr config)
{
constexpr const size_t BeamQty = 5;
constexpr const size_t ElementQty = 16;
constexpr const size_t FirstElement = 1;
constexpr const double BeamAngleStart = 45.;
double exitPoint[BeamQty]{28., 27.75, 27.5, 27.25, 27.}; //mm
double beamDelay[BeamQty]{19000., 19100., 19200., 19300., 19400.}; //ns
double digitizingDelay[BeamQty]{5400., 5450., 5500., 5550., 5600.}; //ns
double elementDelay[ElementQty]{374., 355., 336., 315., 294., 272., 249., 225., 200., 174., 148., 120., 91., 62., 31., 0.};

config->SetGain(25.);
config->SetVelocity(3235.);
config->SetReferenceAmplitude(80.);

auto pulsingSettings = config->GetPulsingSettings();
pulsingSettings->SetPulseWidth(100.);

auto digitizingSettings = config->GetDigitizingSettings();
digitizingSettings->GetAmplitudeSettings()->SetAscanDataSize(IAmplitudeSettings::AscanDataSize::EightBits);
digitizingSettings->GetAmplitudeSettings()->SetAscanRectification(IAmplitudeSettings::RectificationType::Full);

for (size_t beamIdx(0); beamIdx < BeamQty; ++beamIdx)
{
auto beam = config->AddBeam();

beam->SetBeamDelay(beamDelay[beamIdx]);
beam->SetGainOffset(2.2);
beam->SetDigitizingDelay(digitizingDelay[beamIdx]);
beam->SetDigitizingLength(2560.);
beam->SetExitPointPrimary(exitPoint[beamIdx]);
beam->SetRefractedAnglePrimary(BeamAngleStart + beamIdx);

auto beamFormation = beam->CreateBeamFormation(ElementQty, ElementQty);
auto pulserDelays = beamFormation->GetPulserDelayCollection();
auto receiverDelays = beamFormation->GetReceiverDelayCollection();
for (size_t elementIdx(0); elementIdx < ElementQty; ++elementIdx)
{
pulserDelays->GetElementDelay(elementIdx)->SetElementId(FirstElement + elementIdx);
pulserDelays->GetElementDelay(elementIdx)->SetDelay(elementDelay[elementIdx]);

receiverDelays->GetElementDelay(elementIdx)->SetElementId(FirstElement + elementIdx);
receiverDelays->GetElementDelay(elementIdx)->SetDelay(elementDelay[elementIdx]);
}

auto gateConfig = beam->GetGateConfigurations();

auto gateI = gateConfig->Add(GATE_I);
gateI->SetDelay(5500.);
gateI->SetLength(1500.);
gateI->SetThreshold(60);

auto gateA = gateConfig->Add(GATE_A);
gateA->SetDelay(6000.);
gateA->SetLength(2000.);
gateA->SetThreshold(35);
gateA->ReserveCscanBuffer(true);

auto gateB = gateConfig->Add(GATE_B);
gateB->SetDelay(9000.);
gateB->SetLength(2500.);
gateB->SetThreshold(45);
gateB->ReserveCscanBuffer(true);
}
}```cpp

```

## Constants and Parameter Initialization


```cpp
constexpr const size_t BeamQty = 5;
constexpr const size_t ElementQty = 16;
constexpr const size_t FirstElement = 1;
constexpr const double BeamAngleStart = 45.;

double exitPoint[BeamQty]{28., 27.75, 27.5, 27.25, 27.};          // mm
double beamDelay[BeamQty]{19000., 19100., 19200., 19300., 19400.}; // ns
double digitizingDelay[BeamQty]{5400., 5450., 5500., 5550., 5600.}; // ns
double elementDelay[ElementQty]{374., 355., 336., 315., 294., 272., 249., 225.,
                                200., 174., 148., 120., 91., 62., 31., 0.};


```
## Global Settings

```cpp
config->SetGain(25.);
config->SetVelocity(3235.);
config->SetReferenceAmplitude(80.);
```

---

## Pulsing Settings

```cpp
auto pulsingSettings = config->GetPulsingSettings();
pulsingSettings->SetPulseWidth(100.);
```

---

## Digitizing Settings

```cpp
auto digitizingSettings = config->GetDigitizingSettings();
digitizingSettings->GetAmplitudeSettings()->SetAscanDataSize(IAmplitudeSettings::AscanDataSize::EightBits);
digitizingSettings->GetAmplitudeSettings()->SetAscanRectification(IAmplitudeSettings::RectificationType::Full);
```

---

## Beam Configuration Loop

```cpp
for (size_t beamIdx(0); beamIdx < BeamQty; ++beamIdx)
{
    auto beam = config->AddBeam();

    beam->SetBeamDelay(beamDelay[beamIdx]);
    beam->SetGainOffset(2.2);
    beam->SetDigitizingDelay(digitizingDelay[beamIdx]);
    beam->SetDigitizingLength(2560.);
    beam->SetExitPointPrimary(exitPoint[beamIdx]);
    beam->SetRefractedAnglePrimary(BeamAngleStart + beamIdx);

    auto beamFormation = beam->CreateBeamFormation(ElementQty, ElementQty);
    auto pulserDelays = beamFormation->GetPulserDelayCollection();
    auto receiverDelays = beamFormation->GetReceiverDelayCollection();

    for (size_t elementIdx(0); elementIdx < ElementQty; ++elementIdx)
    {
        pulserDelays->GetElementDelay(elementIdx)->SetElementId(FirstElement + elementIdx);
        pulserDelays->GetElementDelay(elementIdx)->SetDelay(elementDelay[elementIdx]);

        receiverDelays->GetElementDelay(elementIdx)->SetElementId(FirstElement + elementIdx);
        receiverDelays->GetElementDelay(elementIdx)->SetDelay(elementDelay[elementIdx]);
    }

    // Gate configuration
    auto gateConfig = beam->GetGateConfigurations();

    auto gateI = gateConfig->Add(GATE_I);
    gateI->SetDelay(5500.);
    gateI->SetLength(1500.);
    gateI->SetThreshold(60);

    auto gateA = gateConfig->Add(GATE_A);
    gateA->SetDelay(6000.);
    gateA->SetLength(2000.);
    gateA->SetThreshold(35);
    gateA->ReserveCscanBuffer(true);

    auto gateB = gateConfig->Add(GATE_B);
    gateB->SetDelay(9000.);
    gateB->SetLength(2500.);
    gateB->SetThreshold(45);
    gateB->ReserveCscanBuffer(true);
}
```

---


## Step5: Scanning C Views
1. Cross sectional view of track with live probe Movement
1. Front View of Track for Defect location
1. Default A-scan, B-Scan, C-Scan and S-Scan Encoder Setting
1. Web Setup Encoder 1
1. Web and Tail Setup Encoder 2 (Switch is required when changing the setup to get correct encoder count)
1. Scan Start/Stop
1. Data Save button with File Name Step 6: Recall
1. Default Setup recall
1. Data file recall

```cpp
auto acquisition = IAcquisition::CreateEx(device);
acquisition->SetFiringTrigger(IAcquisition::FiringTrigger::Encoder);
acquisition->SetRate(50);

auto encoders = acquisition->GetEncoders();
auto encoderOne = encoders->GetEncoder(0);
encoderOne->Enable(true);
encoderOne->SetEncoderType(IEncoder::Type::Quadrature);
encoderOne->SetPresetValue(0);
encoderOne->SetResolution(1);
              
auto encoderTwo = encoders->GetEncoder(1);
encoderTwo->Enable(true);
encoderTwo->SetEncoderType(IEncoder::Type::Quadrature);
encoderTwo->SetPresetValue(0);
encoderTwo->SetResolution(1);

```

    
    
# Encoder Interface 

## Class: `Olympus::Inspection::IEncoderConfigurationCollection`

| Function                                             | Description                                                                         |
| ---------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `GetCount()`                                         | Gets the EncoderSensor Configurations count.                                        |
| `GetEncoderConfiguration(std::size_t index)`         | Gets a modifiable encoder configuration at the specified index.                     |
| `GetEncoderConfiguration(std::size_t index) const`   | Gets a read-only encoder configuration at the specified index.                      |
| `Add(Olympus::Equipment::IEncoderSensorPtr encoder)` | Adds an encoder (must have phase A pin connected). Returns a configuration pointer. |
| `Remove(std::size_t index)`                          | Removes the encoder at the specified index. Adjusts subsequent indices.             |

---

## Class: `Olympus::Equipment::IEncoderSensor`

| Function                                   | Description                               |
| ------------------------------------------ | ----------------------------------------- |
| `GetName() const`                          | Gets the name of this encoder.            |
| `GetDistanceResolution() const`            | Gets the distance resolution in steps/mm. |
| `SetDistanceResolution(double resolution)` | Sets the distance resolution in steps/mm. |
| `GetPhaseAPin() const`                     | Gets the phase A/clock/up/down pin.       |
| `SetPhaseAPin(IPinPtr phaseAPin)`          | Sets the phase A/clock/up/down pin.       |
| `GetPhaseBPin() const`                     | Gets the phase B/direction pin.           |
| `SetPhaseBPin(IPinPtr phaseBPin)`          | Sets the phase B/direction pin.           |

---

## Class: `Olympus::Inspection::IEncoderConfiguration`

| Function                                   | Description                                                              |
| ------------------------------------------ | ------------------------------------------------------------------------ |
| `GetName() const`                          | Gets the encoder's name.                                                 |
| `GetDistanceResolution() const`            | Gets distance resolution in steps/mm.                                    |
| `SetDistanceResolution(double resolution)` | Sets distance resolution in steps/mm.                                    |
| `GetFiringResolution() const`              | Gets firing resolution in steps/pulse.                                   |
| `SetFiringResolution(double resolution)`   | Sets firing resolution in steps/pulse.                                   |
| `GetType() const`                          | Gets the encoder type.                                                   |
| `SetType(EncoderType encoderType)`         | Sets the encoder type.                                                   |
| `GetPresetValue() const`                   | Gets the preset value (distance at reset).                               |
| `SetPresetValue(std::size_t preset)`       | Sets the preset value (distance at reset).                               |
| `IsInverted() const`                       | Checks if the encoder is inverted (positive count = negative direction). |
| `Invert(bool isInverted)`                  | Sets the inverted state.                                                 |

---

## Class: `Instrumentation::IEncoder`

| Function                                  | Description                                         |
| ----------------------------------------- | --------------------------------------------------- |
| `Enable(bool doEnable)`                   | Enables or disables the encoder.                    |
| `IsEnabled() const`                       | Returns whether the encoder is enabled.             |
| `GetEncoderType() const`                  | Gets the encoder type (e.g., Quadrature, ClockDir). |
| `SetEncoderType(Type type)`               | Sets the encoder type.                              |
| `GetResolution() const`                   | Gets the resolution.                                |
| `SetResolution(std::size_t resolution)`   | Sets the resolution.                                |
| `GetPresetValue() const`                  | Gets the preset value.                              |
| `SetPresetValue(std::size_t presetValue)` | Sets the preset value.                              |
| `GetName() const`                         | Gets the encoder name.                              |
| `SetName(const std::wstring& name)`       | Sets the encoder name.                              |

---

## Class: `Instrumentation::IEncoderData`

| Function                        | Description                                   |
| ------------------------------- | --------------------------------------------- |
| `GetDeviceSerialNumber() const` | Gets the serial number of the encoder device. |
| `GetCounter() const`            | Gets the encoder's counter value.             |
| `GetValue() const`              | Gets the encoder's measured value.            |

---

## Class: `Instrumentation::IEncoderDataCollection`

| Function                                  | Description                                          |
| ----------------------------------------- | ---------------------------------------------------- |
| `GetCount() const`                        | Returns the number of encoder data entries.          |
| `GetEncoderData(std::size_t index) const` | Gets the encoder data object at the specified index. |

---

## Class: `Instrumentation::IEncoderCollection`

| Function                              | Description                                     |
| ------------------------------------- | ----------------------------------------------- |
| `GetCount() const`                    | Returns the number of encoders.                 |
| `GetEncoder(std::size_t index) const` | Gets the encoder object at the specified index. |

---



```cpp
#include <memory>
#include <iostream>

#include <instrumentation/Instrumentation.h>

using namespace std;
using namespace Instrumentation;


int main()
{
  try
  {
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Discover device connected to the ethernet.
    string ipAddress = "192.168.0.1";
    Duration discoveryTimeout = 5000;

    auto discovery = IDeviceDiscovery::Create(ipAddress.c_str());
    auto dicoveryResult = discovery->DiscoverFor(discoveryTimeout);

    if (dicoveryResult.status != DiscoverResult::DeviceFound)
      throw std::exception("No device were found.");

    auto device = dicoveryResult.device;

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Select the latest version of firmware packages.
    wstring packageName(L"FocusPxPackage");
    shared_ptr<IFirmwarePackage> package;
    auto packages = IFirmwarePackageScanner::GetFirmwarePackageCollection();
    for (size_t packageIndex(0); packageIndex < packages->GetCount(); ++packageIndex)
    {
      if (packages->GetFirmwarePackage(packageIndex)->GetName().find(packageName) != string::npos)
        package = packages->GetFirmwarePackage(packageIndex);
    }

    if (package == nullptr)
      throw std::exception("Could not find the firmware package.");

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Start the package on the device. 
    if (!device->HasPackage(package))
      device->Download(package);
      
    device->Start(package);

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Ultrasound configuration.
    auto ultrasoundConfig = device->GetConfiguration()->GetUltrasoundConfiguration();
    auto conventionalTechno = ultrasoundConfig->GetDigitizerTechnology(UltrasoundTechnology::Conventional);
    auto connectorP1R1 = conventionalTechno->GetConnectorCollection()->GetPulseAndReceiveConnector();

    // Create and add conventional pulse echo beam set using P1R1 connector.
    auto beamSetOne = conventionalTechno->GetBeamSetFactory()->CreateBeamSetConventional(L"BS1");
    ultrasoundConfig->GetFiringBeamSetCollection()->Add(beamSetOne, connectorP1R1);

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Create and configure acquisition.

    auto acquisition = IAcquisition::CreateEx(device);
    acquisition->SetFiringTrigger(IAcquisition::FiringTrigger::Encoder);
    acquisition->SetRate(50);

    auto encoders = acquisition->GetEncoders();
    auto encoderOne = encoders->GetEncoder(0);
    encoderOne->Enable(true);
    encoderOne->SetEncoderType(IEncoder::Type::Quadrature);
    encoderOne->SetPresetValue(0);
    encoderOne->SetResolution(1);

    auto encoderTwo = encoders->GetEncoder(1);
    encoderTwo->Enable(true);
    encoderTwo->SetEncoderType(IEncoder::Type::Quadrature);
    encoderTwo->SetPresetValue(0);
    encoderTwo->SetResolution(1);

    acquisition->ApplyConfiguration();

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Acquire data.

    auto encoderCountOne = 0;
    auto encoderCountTwo = 0;
    IAcquisition::WaitForDataResultEx dataResult;

    acquisition->Start();

    do
    {
      dataResult = acquisition->WaitForDataEx();
      if (dataResult.status == IAcquisition::WaitForDataResultEx::Status::DataAvailable)
      {
        auto encoderDataOne = dataResult.cycleData->GetEncoderDataCollection()->GetEncoderData(0);
        auto encoderDataTwo = dataResult.cycleData->GetEncoderDataCollection()->GetEncoderData(1);
        
        if (dataResult.cycleData->GetCycleId() == 0)
        {
          encoderCountOne = encoderDataOne->GetValue();
          std::cout << "Encoder 1 count: " << encoderCountOne << std::endl;

          encoderCountTwo = encoderDataTwo->GetValue();
          std::cout << "Encoder 2 count: " << encoderCountTwo << std::endl;
        }
        else
        {
          if (encoderCountOne != encoderDataOne->GetValue())
          {
            encoderCountOne = encoderDataOne->GetValue();
            std::cout << "Encoder 1 count: " << encoderCountOne << std::endl;
          }

          if (encoderCountTwo != encoderDataTwo->GetValue())
          {
            encoderCountTwo = encoderDataTwo->GetValue();
            std::cout << "Encoder 2 count: " << encoderDataTwo->GetValue() << std::endl;
          }
        }

        if (dataResult.cycleData->GetCycleId() > 1000)
          acquisition->Stop();
      }

    } while (dataResult.status != IAcquisition::WaitForDataResultEx::Status::NoMoreData);
  }
  catch (exception const& e)
  {
    cout << e.what() << endl;
    return EXIT_FAILURE;
  }

  return EXIT_SUCCESS;
}


```



## IFilterSettings
### Include/UltrasoundConfiguration/IFilterSettings.h
```cpp
     std::shared_ptr<IDigitalBandPassFilter> GetDigitalBandPassFilter() const = 0;
     void SetDigitalBandPassFilter(std::shared_ptr<IDigitalBandPassFilter> digitalBandPassFilter) = 0;
     double GetSmoothingFilter() const = 0;
     void SetSmoothingFilter(double smoothingFilter) = 0;
     void EnableSmoothingFilter(bool doEnable) = 0;
     bool IsSmoothingFilterEnabled() const = 0;

```    
    
## Custom Section 
### Include/CustomSection/ICustomSectionCollection.h    
### Include/CustomSection/ICustomSection.h    
 ```cpp      
       ~ICustomSection() = default;
       const std::wstring& GetName() const = 0;
       std::size_t GetSize() const = 0;
       void* GetData() = 0;
       const void* GetData() const = 0;
       const std::wstring& GetFormat() const = 0;
       const std::wstring& GetUsage() const = 0;
      ~ICustomSectionCollection() = default;
       ICustomSectionConstPtr FindCustomSection(const std::wstring& name) const = 0;
       ICustomSectionPtr FindCustomSection(const std::wstring& name) = 0;
       ICustomSectionConstPtr GetCustomSection(std::size_t index) const = 0;
       ICustomSectionPtr GetCustomSection(std::size_t index) = 0;
       ICustomSectionPtr AddCustomSection(const std::wstring& name, std::size_t size) = 0;
       void Remove(const std::wstring& name) = 0;
       std::size_t GetCount() const = 0;
       void Reset() = 0;
       ICustomSectionPtr AddCustomSection(const std::wstring& name,std::size_t size,const std::wstring& format,const std::wstring& usage) = 0;
```
## Range    
### Include/DAL/IDataRange.h    
```cpp    
     double GetFloatingMin() const = 0;
     double GetFloatingMax() const = 0;
     DataUnit GetUnit() const = 0;
```    
## Angle    
### Include/Inspection/IAngleRange.h    
```cpp    
     double GetStart() const = 0;
     double GetStop() const = 0;
     double GetStep() const = 0;
     void SetStart(double start) = 0;
     void SetStop(double stop) = 0;
     void SetStep(double step) = 0;
```    
## Voltage
```cpp
double GetPulserVoltage() const = 0;
     void SetPulserVoltage(double voltage) = 0;
     std::shared_ptr<Instrumentation::IPulserVoltageCollection> GetPulserVoltages() const = 0;
     std::shared_ptr<Instrumentation::IDigitalBandPassFilterCollection> GetBandPassFilters() const = 0;
     std::shared_ptr<Instrumentation::ISmoothingFilterCollection> GetSmoothingFilters() const = 0;
     ICapabilitiesConfigurationPtr GetCapabilitiesConfiguration() const = 0;
     IFullMatrixCaptureConfigurationCollectionPtr GetFullMatrixCaptureConfigurations() const = 0;
```
    
    
## Gain
### Include/Inspection/IConventionalConfiguration.h
```cpp    
virtual ~IConventionalConfiguration() = default;

virtual void SetVelocity(double velocity) = 0;
virtual double GetVelocity() const = 0;

virtual void SetWedgeDelay(double wedgeDelay) = 0;
virtual double GetWedgeDelay() const = 0;

virtual void SetDigitizingDelay(double digitizingDelay) = 0;
virtual double GetDigitizingDelay() const = 0;

virtual void SetExitPoint(double exitPoint) = 0;
virtual double GetExitPoint() const = 0;

virtual void SetFiringOrder(std::size_t firingOrder) = 0;
virtual std::size_t GetFiringOrder() const = 0;

virtual void SetReferenceAmplitude(double referenceAmplitude) = 0;
virtual double GetReferenceAmplitude() const = 0;

virtual void SetGain(double gain) = 0;
virtual double GetGain() const = 0;

virtual void SetDigitizingLength(double digitizingLength) = 0;
virtual double GetDigitizingLength() const = 0;

virtual void SetRecurrence(double recurrence) = 0;
virtual double GetRecurrence() const = 0;

virtual Instrumentation::IDigitizingSettingsPtr GetDigitizingSettings() const = 0;
virtual Instrumentation::IPulsingSettingsPtr GetPulsingSettings() const = 0;

virtual IGateConfigurationCollectionPtr GetGateConfigurations() const = 0;
virtual Instrumentation::ITcgPtr GetTcg() const = 0;

virtual double GetRefractedAngle() const = 0;
virtual void SetRefractedAngle(double refractedAngle) = 0;

virtual ICalibrationStatesPtr GetCalibrationStates() const = 0;

virtual AmplitudeScalingRange GetAmplitudeScalingRange() const = 0; // deprecated
virtual void SetAmplitudeScalingRange(AmplitudeScalingRange amplitudeScalingRange) = 0; // deprecated

virtual double GetAmplitudeScalingRangeEx() const = 0;
virtual void SetAmplitudeScalingRangeEx(double amplitudeScalingRange) = 0;

virtual void SetAnalysisGain(double gain) = 0;
virtual double GetAnalysisGain() const = 0;

virtual double GetAscanDataAmplitudeMultiplierFactor() const = 0;
virtual void SetAscanDataAmplitudeMultiplierFactor(double multiplierFactor) = 0;

virtual bool HasReferenceGain() const = 0;
virtual void HasReferenceGain(bool hasRefGain) = 0;

virtual double GetReferenceGain() const = 0;
virtual void SetReferenceGain(double refGain) = 0;

virtual IThicknessSettingsPtr GetThicknessSettings() const = 0;

virtual const std::string GetApplicationSettings(std::string application) const = 0;
virtual void SetApplicationSettings(std::string json) = 0;
```
    
    
## offset
    
  ##  Include/Inspection/IPhasedArrayBeamConfiguration.h
    
```cpp
virtual ~IPhasedArrayBeamConfiguration() = default;
[[DEPRECATED]] virtual double GetRefractedAnglePrimary() const = 0;
[[DEPRECATED]] virtual void SetRefractedAnglePrimary(double angle) = 0;

[[DEPRECATED]] virtual double GetRefractedAngleSecondary() const = 0;
[[DEPRECATED]] virtual void SetRefractedAngleSecondary(double angle) = 0;

virtual double GetBeamDelay() const = 0;
virtual void SetBeamDelay(double beamDelay) = 0;

virtual double GetDigitizingDelay() const = 0;
virtual void SetDigitizingDelay(double delay) = 0;

virtual double GetDigitizingLength() const = 0;
virtual void SetDigitizingLength(double length) = 0;

virtual double GetExitPointPrimary() const = 0;
virtual void SetExitPointPrimary(double exitPoint) = 0;

virtual double GetExitPointSecondary() const = 0;
virtual void SetExitPointSecondary(double exitPoint) = 0;

virtual std::size_t GetFiringOrder() const = 0;
virtual void SetFiringOrder(std::size_t order) = 0;

virtual double GetGainOffset() const = 0;
virtual void SetGainOffset(double gainOffset) = 0;

virtual double GetRecurrence() const = 0;
virtual void SetRecurrence(double recurrence) = 0;

virtual Instrumentation::IBeam::SumGainMode GetSumGainMode() const = 0;
virtual void SetSumGainMode(Instrumentation::IBeam::SumGainMode mode) = 0;

virtual double GetSumGain() const = 0;
virtual void SetSumGain(double sumGain) = 0;

virtual std::shared_ptr<Instrumentation::IBeamFormation> GetBeamFormation() const = 0;

virtual std::shared_ptr<Instrumentation::IBeamFormation> CreateBeamFormation(
    std::size_t pulserQuantity,
    std::size_t receiverQuantity,
    std::size_t firstPulserElementId = 1,
    std::size_t firstReceiverElementId = 1
) = 0;

virtual IGateConfigurationCollectionPtr GetGateConfigurations() const = 0;

virtual Instrumentation::ITcgPtr GetTcg() const = 0;

virtual void SetRefractedAngle(double angle) = 0;
virtual double GetRefractedAngle() const = 0;

virtual void SetSkewAngle(double angle) = 0;
virtual double GetSkewAngle() const = 0;
```

    
    
    
### Include/Equipment/IElementOffset.h
    
    
```cpp
virtual ~IElementOffset() = default;

virtual double GetPrimary() const = 0;
virtual void SetPrimary(double primary) = 0;

virtual double GetSecondary() const = 0;
virtual void SetSecondary(double secondary) = 0;

virtual double GetTertiary() const = 0;
virtual void SetTertiary(double tertiary) = 0;

    
```



Here is your C++ API documentation converted into **Markdown** (`.md`) format:

---

# OlympusNDT.Storage API Documentation

## Save Functions

### `SaveSetupFile`

```cpp
STORAGE_API void SaveSetupFile(const std::wstring& destinationFile, ISetupPtr setup);
```

Saves a setup file.

* **@param** `destinationFile`: Destination file.
* **@param** `setup`: The setup.

---

```cpp
STORAGE_API void SaveSetupFile(const std::wstring& destinationFile, ISetupPtr setup, ICustomSectionCollectionPtr customSections);
```

Saves a setup file with custom sections.

* **@param** `destinationFile`: Destination file.
* **@param** `setup`: The setup.
* **@param** `customSections`: The custom sections.

---

### `SaveDataFile`

```cpp
STORAGE_API void SaveDataFile(const std::wstring& destinationFile, IAcquisitionDataPtr acquisitionData);
```

Saves a data file.

* **@param** `destinationFile`: Destination file.
* **@param** `acquisitionData`: Information describing the acquisition.

---

```cpp
STORAGE_API void SaveDataFile(const std::wstring& destinationFile, IAcquisitionDataPtr acquisitionData, ICustomSectionCollectionPtr customSections);
```

* **@param** `destinationFile`: Destination file.
* **@param** `acquisitionData`: Information describing the acquisition.
* **@param** `customSections`: The custom sections.

---

```cpp
STORAGE_API void SaveDataFile(const std::wstring& destinationFile, IDataFilePtr dataFile);
```

* **@param** `destinationFile`: Destination file.
* **@param** `dataFile`: Previously saved data file.

---

```cpp
STORAGE_API void SaveDataFile(const std::wstring& destinationFile, IAcquisitionDataPtr acquisitionData, IApplicationStampPtr appStamp);
```

* **@param** `destinationFile`: Destination file.
* **@param** `acquisitionData`: Information describing the acquisition.
* **@param** `appStamp`: Application stamp to create the file signature.

---

```cpp
STORAGE_API void SaveDataFile(const std::wstring& destinationFile, IAcquisitionDataPtr acquisitionData, ICustomSectionCollectionPtr customSections, IApplicationStampPtr appStamp);
```

* **@param** `destinationFile`: Destination file.
* **@param** `acquisitionData`: Information describing the acquisition.
* **@param** `customSections`: The custom sections.
* **@param** `appStamp`: Application stamp to create the file signature.

---

```cpp
STORAGE_API void SaveDataFile(const std::wstring& destinationFile, IDataFilePtr dataFile, IApplicationStampPtr appStamp);
```

* **@param** `destinationFile`: Destination file.
* **@param** `dataFile`: Previously saved data file.
* **@param** `appStamp`: Application stamp to create the file signature.

---

```cpp
STORAGE_API void SaveDataFile(const std::wstring& destinationFile, IDataFilePtr dataFile, IApplicationStampPtr appStamp, const std::string& fileVersion, uint8_t /*compressionLevel*/);
```

* **@param** `destinationFile`: Destination file.
* **@param** `dataFile`: Previously saved data file.
* **@param** `appStamp`: Application stamp to create the file signature.
* **@param** `fileVersion`: Version of the format.
* **@param** `compressionLevel`: OBSELETE.

---

```cpp
STORAGE_API void SaveDataFile(const std::wstring& destinationFile, IDataFilePtr dataFile, IApplicationStampPtr appStamp, const std::string& fileVersion, uint8_t /*compressionLevel*/, uint16_t configCount);
```

* **@param** `destinationFile`: Destination file.
* **@param** `dataFile`: Previously saved data file.
* **@param** `appStamp`: Application stamp to create the file signature.
* **@param** `fileVersion`: Version of the format.
* **@param** `compressionLevel`: OBSELETE.
* **@param** `configCount`: Configuration count saved from file source.

---

## Open Functions

### `OpenSetupFile`

```cpp
STORAGE_API ISetupFilePtr OpenSetupFile(const std::wstring& sourceFile);
```

Opens a setup file.

* **@param** `sourceFile`: Source file.
* **@returns** `ISetupFilePtr`.

---

### `OpenDataFile`

```cpp
STORAGE_API IDataFilePtr OpenDataFile(const std::wstring& sourceFile);
```

Opens a data file.

* **@param** `sourceFile`: Source file.
* **@returns** `IDataFilePtr`.

---

## Creation Functions

### `CreateSetup`

```cpp
STORAGE_API ISetupPtr CreateSetup();
```

Creates a new setup.

* **@returns** `ISetupPtr`.

---

### `CreateCustomSectionCollection`

```cpp
STORAGE_API ICustomSectionCollectionPtr CreateCustomSectionCollection();
```

Creates a new instance of `ICustomSectionCollection`.

* **@returns** `ICustomSectionCollectionPtr`.

---

### `CreateAcquisitionData`

```cpp
STORAGE_API IAcquisitionDataPtr CreateAcquisitionData(ISetupPtr setup);
```

Creates new acquisition data to create buffers based on the setup.

* **@param** `setup`: An existing setup.
* **@returns** `IAcquisitionDataPtr`.

---

### `CreateOriginalFileSource`

```cpp
STORAGE_API IOriginalFileSourcePtr CreateOriginalFileSource(const std::wstring& fileName, const std::string& dateTime);
```

Creates a new original file source.

* **@param** `fileName`: File where data was originally collected.
* **@param** `dateTime`: Timestamp string.
* **@returns** `IOriginalFileSourcePtr`.

---

### `CreateApplicationStamp`

```cpp
STORAGE_API IApplicationStampPtr CreateApplicationStamp(const std::wstring& companyName, const std::wstring& appName, const std::wstring& appVersion, IOriginalFileSourcePtr originalFileSource = nullptr);
```

Creates a new application stamp.

* **@param** `companyName`: A name.
* **@param** `appName`: An application name.
* **@param** `appVersion`: Application version.
* **@param** `originalFileSource`: Optional original file source.
* **@returns** `IApplicationStampPtr`.

---

```cpp
STORAGE_API IApplicationStampPtr CreateApplicationStamp(const std::wstring& companyName, const std::wstring& appName, const std::wstring& appVersion, IOriginalFileSourcePtr originalFileSource, IGeoCoordinatePtr GeoCoordinate);
```

* **@param** `GeoCoordinate`: GPS coordinate saved in the file.

---

### `CreateGeoCoordinate`

```cpp
STORAGE_API IGeoCoordinatePtr CreateGeoCoordinate(double latitude, double longitude);
```

Creates a GeoCoordinate.

* **@returns** `IGeoCoordinatePtr`.

---

## Version and Logging

### `GetLibraryVersion`

```cpp
STORAGE_API std::wstring GetLibraryVersion();
```

Returns the loaded OlympusNDT.Storage library version.

---

### `GetVersion`

```cpp
__declspec(deprecated("Deprecated. Use GetLibraryVersion"))
STORAGE_API std::string GetVersion();
```

Returns the old version format of the library. **Deprecated**.

---

### `EnableLogger`

```cpp
__declspec(deprecated("Deprecated. Log is always enabled"))
STORAGE_API bool EnableLogger();
```

Enable logging of library operations. **Deprecated**.

---

### `CreateDataStorage` (Deprecated)

```cpp
#ifndef SWIG
__declspec(deprecated("Deprecated. Use CreateAcquisitionData"))
STORAGE_API IAcquisitionDataPtr CreateDataStorage(ISetupPtr setup);
#endif
```

Creates a new acquisition data. **Deprecated** in favor of `CreateAcquisitionData`.

---


