Click or drag to resize

SDK modifications from version 7.3.x to 8.0.x

Structural changes
  • A new library, LynceeTec.Eucalyptus.dll, was added to our Lyncee Tec libraries.

  • All configuration management, user management (including log in), user access rights (including for reading/writing from/to the database) and database accesses are managed via the new Eucalyptus library.

  • The database was restructured and many fields were renamed. See the Database documentation page for a definition of the database elements relevant for an SDK user.

Renamings and new functions

Renamings of NuGets packages

  • LynceeTec.DigitizerInterface was renamed LynceeTec.InterfaceDigitizer

  • LynceeTec.StageInterface was renamed LynceeTec.InterfaceStage

  • LynceeTec.Epos was renamed LynceeTec.InterfaceEpos

  • LynceeTec.Processing was renamed LynceeTec.InterfaceProcessing

Note Note

Useful tip when migrating to the new NuGets names with the NuGet manager:

To prevent difficulties, it is recommended to first remove all your Lyncée Tec SDK NuGets with the manager, and then add the new NuGets as if you just started your project.

It can happen that the NuGet manager does not show one of the NuGets, usually LynceeTec.InterfaceProcessing, and only displays the older version. Searching it by name solves the problem.

Renamings and new functions in the libraries

  • In the MaskMethod enumeration ThresholdIntensity was renamed IntensityThreshold

  • In the MaskMethod enumeration MaxPhaseGradient was renamed PhaseGradientThreshold

  • IMask.ThresholdIntensityValue was renamed IMask.IntensityThresholdValuePercent

  • IMask.ThresholdPhaseMaskValue was split into IMask.PhaseGradientThresholdValuePercent and IMask.PhaseGradientThresholdValueRadian

  • IMask.AutoThresholdIntensity was renamed IMask.UseAutoIntensityThreshold

  • IMask.FillMaskSz was renamed IMask.NonMeasuredAreasConnectingSize

  • IMask.ClearBitmap was renamed IMask.ClearMask

  • IMask.NumMasks was renamed IMask.MasksCount

  • Added new method IMask.UseDefaultPhaseGradientThreshold

  • IReconstruction.DoAutoAdjustDpm was renamed IReconstruction.AutoComputePhaseMaskUsingSegments. The behavior of the function was also modified, please refer to the documentation.

  • IReconstruction.Do2DAdjustDpm was renamed IReconstruction.AutoComputePhaseMaskUsingZones. The behavior of the function was also modified, please refer to the documentation.

  • IReconstruction.OnDpmChange was renamed IReconstruction.ComputePhaseMask. The behavior of the function was also modified, please refer to the documentation.

  • IReconstruction.PhMonUnwrap was renamed IReconstruction.UnwrapPhaseMonitorZones

  • IReconstruction.AddPhMonitorZone was renamed IReconstruction.AddPhaseMonitorZone

  • IReconstruction.ResetPhMonitorZone was renamed IReconstruction.ResetPhaseMonitorZones

  • IReconstruction.PhCorrDegree was renamed IReconstruction.PhaseCorrectionDegree

  • IReconstruction.GetPhCorrCoeff was renamed IReconstruction.GetPhaseCorrectionCoefficient

  • IReconstruction.SetPhCorrCoeff was renamed IReconstruction.SetPhaseCorrectionCoefficient

  • IReconstruction.AddPhCorrSegment was renamed IReconstruction.AddPhaseCorrectionSegment. The behavior and signature of the function was also modified, please refer to the documentation.

  • IReconstruction.AddPhCorrZone was renamed IReconstruction.AddPhaseCorrectionZone. The behavior and signature of the function was also modified, please refer to the documentation.

  • IReconstruction.ResetPhCorrSegment was renamed IReconstruction.ResetPhaseCorrectionSegments

  • IReconstruction.UndoPhCorrSegment was renamed IReconstruction.UndoPhaseCorrectionSegment. The behavior and signature of the function was also modified, please refer to the documentation.

  • IReconstruction.ResetPhCorrZone was renamed IReconstruction.ResetPhaseCorrectionZones

  • IReconstruction.AddPhOffAdjZone was renamed IReconstruction.AddPhaseOffsetAdjustmentZone

  • IReconstruction.SavePhOffAdjZones was renamed IReconstruction.SavePhaseOffsetAdjustmentZones

  • IReconstruction.LoadPhOffAdjZones was renamed IReconstruction.LoadPhaseOffsetAdjustmentZones

  • IReconstruction.AddPhOffAdjZone was renamed IReconstruction.AddPhaseOffsetAdjustmentZone

  • IReconstruction.ResetPhOffAdjZone was renamed IReconstruction.ResetPhaseOffsetAdjustmentZones

  • IReconstruction.ParsePhOffAdjZones was renamed IReconstruction.ParsePhaseOffsetAdjustmentZones

  • IReconstruction.TempPhAvgState was renamed IReconstruction.UseTemporalPhaseAverage

  • IReconstruction.PhAvgNum was renamed IReconstruction.TemporalPhaseAverageFramesNumber

  • IReconstruction.SpPhAvgState was renamed IReconstruction.SpatialPhaseAverageState

How to modify your code to make it compatible with version 8.0.x

Where can I read? Useful values location

Note Note

The following examples applies for the classic case of using a single database. For offline work with multiple databases, please see the ReconstructionWithMultiDatabasesExample code example.

Version 7.3.x

Version 8.0.x

DhmDevice.CurrentConfiguration

ConfigManager.Instance.CurrentHoloMeasurementConfig

DhmDevice.CurrentConfiguration.NumLambda

ConfigManager.Instance.CurrentHoloMeasurementConfig.NumLambda

DhmDevice.CurrentConfiguration.ObjectiveConfig.ConvolutionXCalib

DhmDevice.CurrentConfiguration.ObjectiveConfig.ConvolutionYCalib

ConfigManager.Instance.CurrentHoloMeasurementConfig.ObjectiveInfo.PixelXSize_um

ConfigManager.Instance.CurrentHoloMeasurementConfig.ObjectiveInfo.PixelYSize_um

DhmDevice.User.Level

UserManager.Instance.CurrentUser.Level

Initializing your DHM and reconstruction objects with version 8.0.x

Note Note

The following examples applies for the classic case of using a single database. For offline work with multiple databases, please see the ReconstructionWithMultiDatabasesExample code example.

Version 7.3.x

Version 8.0.x

 

//Option: cache instances of Config and User Managers

ConfigManager configManager = ConfigManager.Instance;

UserManager userManager = UserManager.Instance;

//Create an instance of the hardware configuration

HardwareConfiguration hwConfig = new HardwareConfiguration(databasePath, driversPath);

//Initialize the configuration manager

configManager.Init(databasePath, driversPath);

//Create and instance of the dhm device

DHMDeviceBase dhmDevice = DHMDeviceFactory.CreateDHM(hwConfig);

//Create and instance of the dhm device

DHMDeviceBase dhmDevice = DHMDeviceFactory.CreateDHM(configManager.GetDHMParameters(), userManager);

 

//Connect DHM device to manager

configManager.Connect(dhmDevice);

//Log in

dhmDevice.Login(userName, password);

//Log in

userManager.Login(userName, password);

//Init the DHM

dhmDevice.InitDhm(null).Wait();

//Init the DHM

dhmDevice.InitDhm(null).Wait();

//Load a configuration without specific sample configuration (working in air)

dhmDevice.LoadConfig(prodConfigId, -1, null).Wait();

//Load a configuration without specific sample configuration (working in air)

configManager.LoadMeasurementConfig(measurementConfigId, null).Wait();

//Initialize the reconstruction object

IReconstruction reconstruction = ReconstructionFactory.CreateReconstruction( databasePath, prodConfigId,hwConfig.CameraConfigId, hwConfig.DHMType);

//Initialize the reconstruction object

IReconstruction reconstruction = ReconstructionFactory.CreateReconstruction( configManager.DHMHardwareConfiguration,configManager.CurrentHoloMeasurementConfig);

New concepts

Accessing values in the database via database accessor objects

Database values are accessed via Database Accessor objects.

There are 2 types of accessors:
  • LynceeTec.Eucalyptus.DatabaseAccessor: for one-shot read / write operations on the database.

    The connection is opened for each call, and closed at the end of the function. Use the functions with include parameter when you need elements from connected tables (see examples below)

  • LynceeTec.Eucalyptus.BindableDatabaseAccessor: for binding with datagrids or other data structures

    The connection is kept open until SaveChanges or Discard is called.

For both accessors, the user level is checked, to allow or not read/write operations. Therefore, a user must have logged in the user manager before.
DatabaseAccessor<UserInfo> dbAccessor = new DatabaseAccessor<UserInfo>();
UserInfo userInfo = dbAccessor.GetRow(userId);

DatabaseAccessor<UserInfo> dbAccessor = new DatabaseAccessor<UserInfo>();
UserInfo userInfo = dbAccessor.GetFilteredRows(u => u.Name == username)[0];

BindableDatabaseAccessor<UserInfo> bindableDbAccessor = new BindableDatabaseAccessor<UserInfo>();
BindingList<UserInfo> userInfoList = bindableDbAccessor.GetBoundList();
userInfoBindingSource.DataSource = userInfoList;

DatabaseAccessor<MeasurementConfig> dbAccessor = new DatabaseAccessor<MeasurementConfig>();
dbAccessor.GetAllRows("CameraConfig", "JoinConfigSource.InstalledLaserSources")

Checking for read or write permission

If code attempts to read or write to the database without the necessary permissions, the operation will not be executed and an InsufficientPrivilegeException will be thrown.

However it is possible to check for permission beforehand to avoid said exception:

//Create a LynceeTec.Eucalyptus.UserPermissionState object
private UserPermissionState m_permState;

//Check for the current permission state, which depends on the current logged-in user
m_permState = UserManager.Instance.GetPermissionState();

//Do not forget to register to the UserLoggedIn and UserLoggedOut events, to have up-to-date information
m_userManager.UserLoggedIn += UserManager_LoggedUserChanged;
m_userManager.UserLoggedOut += UserManager_LoggedUserChanged;

private void UserManager_LoggedUserChanged(object sender, EventArgs eventArgs)
{
    m_permState = m_userManager.GetPermissionState();
}

//At any point in code, you can check the permission for a database element:
//Check if it is possible de to edit or delete the item
m_permState.CanEdit(item);

//Check if it is possible to create the item
m_permState.CanCreate(item);
See Also

Reference

AddPhaseCorrectionSegment(Int32, Int32, Int32, SegmentOrientation)
AddPhaseCorrectionZone(Int32, Int32, Int32, Int32, ShapeType)
UndoPhaseCorrectionSegment(SegmentOrientation)