using PdmSwPlugin.Common.Entity;
using SolidWorks.Interop.sldworks;
using System;
namespace PdmSwPlugin.PriceCheck.Model
{
public class ModelProperty : NotifyBase
{
public ModelDoc2 Doc { get; set; }
public event Action Changed;
private string _name;
public string name
{
get => _name;
set => RaiseAndSetIfChanged(ref _name, value);
}
private string _type;
public string type
{
get => _type;
set => RaiseAndSetIfChanged(ref _type, value);
}
private string _stuffType;
public string stuffType
{
get => _stuffType;
set => RaiseAndSetIfChanged(ref _stuffType, value);
}
private string _surfaceType;
public string surfaceType
{
get => _surfaceType;
set => RaiseAndSetIfChanged(ref _surfaceType, value);
}
private string _heatType;
public string heatType
{
get => _heatType;
set => RaiseAndSetIfChanged(ref _heatType, value);
}
private double _length;
public double length
{
get => _length;
set
{
RaiseAndSetIfChanged(ref _length, value);
RaiseAndSetIfChanged(ref _lengthStr, value.ToString());
}
}
private string _lengthStr;
public string lengthStr
{
get => _lengthStr;
set
{
double.TryParse(value, out double temp);
RaiseAndSetIfChanged(ref _length, temp);
RaiseAndSetIfChanged(ref _lengthStr, temp.ToString());
Changed?.Invoke();
}
}
private double _width;
public double width
{
get => _width;
set
{
RaiseAndSetIfChanged(ref _width, value);
RaiseAndSetIfChanged(ref _widthStr, value.ToString());
}
}
private string _widthStr;
public string widthStr
{
get => _widthStr;
set
{
double.TryParse(value, out double temp);
RaiseAndSetIfChanged(ref _width, temp);
RaiseAndSetIfChanged(ref _widthStr, temp.ToString());
Changed?.Invoke();
}
}
private double _height;
public double height
{
get => _height;
set
{
RaiseAndSetIfChanged(ref _height, value);
RaiseAndSetIfChanged(ref _heightStr, value.ToString());
}
}
private string _heightStr;
public string heightStr
{
get => _heightStr;
set
{
double.TryParse(value, out double temp);
RaiseAndSetIfChanged(ref _height, temp);
RaiseAndSetIfChanged(ref _heightStr, temp.ToString());
Changed?.Invoke();
}
}
private double _thickness;
public double thickness
{
get => _thickness;
set => RaiseAndSetIfChanged(ref _thickness, value);
}
///
/// solidwork给出的面积
///
private double _area;
public double area
{
get => _area;
set => RaiseAndSetIfChanged(ref _area, value);
}
///
/// 核价时实际计算的面积
///
private double _currentArea;
public double currentArea
{
get => _currentArea;
set => RaiseAndSetIfChanged(ref _currentArea, value);
}
///
/// solidwork给出的体积
///
private double _volume;
public double volume
{
get => _volume;
set => RaiseAndSetIfChanged(ref _volume, value);
}
///
/// 实际核价时计算的体积
///
private double _currentVolume;
public double currentVolume
{
get => _currentVolume;
set => RaiseAndSetIfChanged(ref _currentVolume, value);
}
private double _density;
public double density
{
get => _density;
set => RaiseAndSetIfChanged(ref _density, value);
}
private double _weight;
public double weight
{
get => _weight;
set => RaiseAndSetIfChanged(ref _weight, value);
}
///
/// 材料单价
///
private double _stuffUnitPrice;
public double stuffUnitPrice
{
get => _stuffUnitPrice;
set => RaiseAndSetIfChanged(ref _stuffUnitPrice, value);
}
///
/// 材料费
///
private double _stuffPrice;
public double stuffPrice
{
get => _stuffPrice;
set => RaiseAndSetIfChanged(ref _stuffPrice, value);
}
///
/// 表处理单价
///
private double _surfaceUnitPrice;
public double surfaceUnitPrice
{
get => _surfaceUnitPrice;
set => RaiseAndSetIfChanged(ref _surfaceUnitPrice, value);
}
///
/// 表处理费
///
private double _surfacePrice;
public double surfacePrice
{
get => _surfacePrice;
set => RaiseAndSetIfChanged(ref _surfacePrice, value);
}
///
/// 材料单价
///
private double _heatUnitPrice;
public double heatUnitPrice
{
get => _heatUnitPrice;
set => RaiseAndSetIfChanged(ref _heatUnitPrice, value);
}
///
/// 材料费
///
private double _heatPrice;
public double heatPrice
{
get => _heatPrice;
set => RaiseAndSetIfChanged(ref _heatPrice, value);
}
private double _price;
public double price
{
get => _price;
set => RaiseAndSetIfChanged(ref _price, value);
}
private bool _round;
public bool round
{
get => _round;
set => RaiseAndSetIfChanged(ref _round, value);
}
public bool bj => "钣金" == type;
public bool tb => "台板" == type;
}
}