123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using FestoDebugger.Service;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace FestoDebugger.Beckoff
- {
- public class BeckhoffItemManager : Singleton<BeckhoffItemManager>
- {
- private Dictionary<string, BeckhoffItem> _ioItemMap = new Dictionary<string, BeckhoffItem>();
- private Dictionary<string, BeckhoffItem> _writeItemMap = new Dictionary<string, BeckhoffItem>();
- public BeckhoffItem GetIOBeckhoffItem(string name)
- {
- return _ioItemMap.ContainsKey(name) ? _ioItemMap[name] : null;
- }
- public BeckhoffItem GetWriteBeckhoffItem(string name)
- {
- return _writeItemMap.ContainsKey(name) ? _writeItemMap[name] : null;
- }
- public void InitBeckhoffItem(string name, string address, string dataType, string ioType, int size, bool bitOperated, int bit, bool invert)
- {
- _ioItemMap[name] = new BeckhoffItem(name, address, dataType, ioType, size, bitOperated, bit, invert);
- }
- public void InitWriteBeckoffItem(string name, string address, string dataType, string ioType, int size, bool bitOperated, int bit, bool invert)
- {
- _writeItemMap[name] = new BeckhoffItem(name, address, dataType, ioType, size, bitOperated, bit, invert);
- }
- public List<BeckhoffItem> GetIOItems()
- {
- return _ioItemMap.Values.ToList();
- }
- public List<BeckhoffItem> GetWriteItems()
- {
- return _writeItemMap.Values.ToList();
- }
- }
- }
|