Path not found
Content-Type: text/html; charset=UTF-8 Last-Modified: Thu, 09 Jul 2026 21:13:14 GMT Expires: Thu, 01 Jan 1970 00:00:05 GMT
![]() |
index : Tango | |
| Twine softwares | Thomas Vanbesien |
| aboutsummaryrefslogtreecommitdiffstats |
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.Core;
using Tango.PMR.ColorLab;
namespace Tango.MachineStudio.ThreadExtensions.ViewModels
{
public class CalibrationDataPointVM : ExtendedObject
{
public double Ink { get; set; }
public double L { get; set; }
public double A { get; set; }
public double B { get; set; }
private double _x;
public double X
{
get { return _x; }
set { _x = value; RaisePropertyChangedAuto(); }
}
private double _y;
public double Y
{
get { return _y; }
set { _y = value; RaisePropertyChangedAuto(); }
}
private int _index;
public int Index
{
get { return _index; }
set { _index = value; RaisePropertyChangedAuto(); }
}
public CalibrationDataPointVM()
{
}
public CalibrationDataPointVM(double x, double y)
{
X = x;
Y = y;
}
public CalibrationDataPointVM(CalibrationPoint calibrationPoint) : this(calibrationPoint.X, calibrationPoint.Y)
{
}
public CalibrationPoint ToPMR()
{
return new CalibrationPoint()
{
X = X,
Y = Y,
};
}
}
public class CalibrationDataVM : ExtendedObject
{
private BL.Entities.LiquidType _liquidType;
public BL.Entities.LiquidType LiquidType
{
get { return _liquidType; }
set { _liquidType = value; RaisePropertyChangedAuto(); }
}
private IdsPack _idsPack;
public IdsPack IdsPack
{
get { return _idsPack; }
set { _idsPack = value; RaisePropertyChangedAuto(); }
}
private ObservableCollection<CalibrationDataPointVM> _calibrationPoints;
public ObservableCollection<CalibrationDataPointVM> CalibrationPoints
{
get { return _calibrationPoints; }
set { _calibrationPoints = value; RaisePropertyChangedAuto(); OnCalibrationPointsChanged(); }
}
private void OnCalibrationPointsChanged()
{
if (CalibrationPoints != null)
{
CalibrationPoints.CollectionChanged -= CalibrationPoints_CollectionChanged;
CalibrationPoints.CollectionChanged += CalibrationPoints_CollectionChanged;
SetIndices();
}
}
private void CalibrationPoints_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
SetIndices();
}
private void SetIndices()
{
if (CalibrationPoints != null)
{
int index = 1;
foreach (var p in CalibrationPoints)
{
p.Index = index++;
}
}
}
private CalibrationDataVM()
{
CalibrationPoints = new ObservableCollection<CalibrationDataPointVM>();
}
public CalibrationDataVM(IdsPack pack) : this()
{
IdsPack = pack;
LiquidType = pack.LiquidType;
}
public CalibrationDataVM(BL.Entities.LiquidType liquidType) : this()
{
LiquidType = liquidType;
CalibrationPoints = new ObservableCollection<CalibrationDataPointVM>();
//CalibrationPoints.Add(new CalibrationDataPointVM() { Index = 1, X = 2, Y = 22 });
}
}
}