|
- using BPA.Helper;
- using BPASmartClient.CustomResource.Pages.Model;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.DosingSystemSingle
- {
- 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;
-
- SiemensDevice.GetInstance.MySiemens.Write($"DB4.DBW{Num * 2 + 132}", (short)value);
- //SiemensDevice.GetInstance.MySiemens.WriteInt16(4, (short)value, (Num * 2 + 132));
- MessageNotify.GetInstance.ShowRunLog($"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);
- MessageNotify.GetInstance.ShowRunLog($"{add},{value}");
- }
- OnPropertyChanged();
- }
- }
- private bool _mConveyerBeltWork;
-
- public bool Control { get; set; }
-
- }
- }
|