|
- using BPA.Helper;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.DosingSystem
- {
- public class ConveyerBeltModel : NotifyBase
- {
- public string Name { get { return _mName; } set { _mName = value; OnPropertyChanged(); } }
- private string _mName;
-
- public int Num { get { return _mNum; } set { _mNum = value; OnPropertyChanged(); } }
- private int _mNum;
-
- public int Speed
- {
- get { return _mSpeed; }
- set
- {
- _mSpeed = value;
- if (Num >= 1 && Num <= 32)
- {
- SiemensDevice.GetInstance.MySiemens.Write($"DB4.DBW{Num * 2 + 132}", value);
- }
- OnPropertyChanged();
- }
- }
- private int _mSpeed;
-
- public bool ConveyerBeltWork
- {
- get { return _mConveyerBeltWork; }
- set
- {
- _mConveyerBeltWork = value;
- if (Num >= 1 && Num <= 32)
- {
- var add = SiemensDevice.GetInstance.GetSiemensBitSingleAdd("DB5.DBX", Num, 6);
- SiemensDevice.GetInstance.MySiemens.Write(add, !value);
- }
- OnPropertyChanged();
- }
- }
- private bool _mConveyerBeltWork;
-
- public bool Control { get; set; }
-
- }
- }
|