using BPA.Helper;
using System.Collections.Generic;
namespace BPASmartClient.DosingSystem
{
///
/// 基础参数
///
public class BasePar : NotifyBase
{
///
/// 设备扫描网段
///
public string NetworkSegAddress { get { return _mNetworkSegAddress; } set { _mNetworkSegAddress = value; OnPropertyChanged(); } }
private string _mNetworkSegAddress = "192.168.0.";
///
/// 输送带设备 PLC IP 地址
///
public string DeviceAddress { get { return _mDeviceAddress; } set { _mDeviceAddress = value; OnPropertyChanged(); } }
private string _mDeviceAddress = "192.168.0.15";
///
/// 料仓数量
///
public int StockCount { get { return _stockCount; } set { _stockCount = value; OnPropertyChanged(); } }
private int _stockCount = 0;
///
/// 当前使用的输送线类型
///
public string ConveryType { get { return _converyType; } set { _converyType = value; OnPropertyChanged(); } }
private string _converyType;
///
/// 输送线类型集合
///
private List _converyTypeList = new List();
public List ConveryTypeList
{
get { return _converyTypeList; }
set
{
foreach (var item in value)
{
if (_converyTypeList.Contains(item))
{
continue;
}
_converyTypeList.Add(item);
}
OnPropertyChanged();
}
}
///
/// 输送带数量
///
public int ConveyerBeltCount
{
get { return _mConveyerBeltCount; }
set
{
_mConveyerBeltCount = value;
//var temp = ConveyerBeltModels;
//App.Current.Dispatcher.Invoke(() => { ConveyerBeltModels.Clear(); });
//for (int i = 0; i < value; i++)
//{
// App.Current.Dispatcher.Invoke(() =>
// {
// ConveyerBeltModels.Add(new ConveyerBeltModel()
// {
// Name = $"输送带{i + 1}速度",
// Num = i + 1,
// Speed = (i >= 0 && i < temp.Count) ? temp.ElementAt(i).Speed : 0
// });
// });
//}
OnPropertyChanged();
}
}
private int _mConveyerBeltCount = 0;
///
/// 升降气缸数量
///
public int LiftCylinderCount { get { return _mLiftCylinderCount; } set { _mLiftCylinderCount = value; OnPropertyChanged(); } }
private int _mLiftCylinderCount = 0;
///
/// 阻挡气缸数量
///
public int BlockCylinderCount { get { return _mBlockCylinderCount; } set { _mBlockCylinderCount = value; OnPropertyChanged(); } }
private int _mBlockCylinderCount = 0;
///
/// 托盘气缸数量
///
public int PalletCylinderCount { get { return _mPalletCylinderCount; } set { _mPalletCylinderCount = value; OnPropertyChanged(); } }
private int _mPalletCylinderCount = 0;
//public ObservableCollection ConveyerBeltModels { get; set; } = new ObservableCollection();
}
}