|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.Toolkit.Mvvm.ComponentModel;
- using System.Collections.Concurrent;
- using System.Collections.ObjectModel;
- using System.Windows;
- using BPASmartClient.Helper;
- using Microsoft.Toolkit.Mvvm.Input;
- using BPASmartClient.JXJFoodBigStation.Model;
- using BPASmartClient.JXJFoodBigStation.View;
- using System.Windows.Forms;
- using BPASmartClient.JXJFoodBigStation.Model.HK_PLC;
- using System.Reflection;
-
- namespace BPASmartClient.JXJFoodBigStation.ViewModel
- {
- public class HardwareStatusViewModel : ObservableObject
- {
- public HardwareStatusViewModel()
- {
- foreach (PropertyInfo mi in typeof(StockBinName).GetProperties())
- {
- object ab = GVL_BigStation.stockBinName.GetType().GetProperty(mi.Name).GetValue(GVL_BigStation.stockBinName, null);
- if (mi.Name=="RawMaterialName1" || mi.Name == "RawMaterialName2" || mi.Name == "RawMaterialName3" || mi.Name == "RawMaterialName4" || mi.Name == "RawMaterialName5" || mi.Name == "RawMaterialName6" || mi.Name == "RawMaterialName7")
- {
- TopDeviceCurrentStatuses.Add(new DeviceCurrentStatus()
- {
- DeviceName = ab.ToString(),
- DeviceNum = TopDeviceCurrentStatuses.Count + 1,
- RunStatus = true,
- Weight = new Random().Next(0, 100)
- });
- }
- else
- {
- BottomDeviceCurrentStatuses.Add(new DeviceCurrentStatus()
- {
- DeviceName = ab.ToString(),
- DeviceNum = BottomDeviceCurrentStatuses.Count + 8,
- RunStatus = false,
- Weight = new Random().Next(0, 100)
- });
- }
- }
- }
- public ObservableCollection<DeviceCurrentStatus> TopDeviceCurrentStatuses { get; set; } = new ObservableCollection<DeviceCurrentStatus>();
- public ObservableCollection<DeviceCurrentStatus> BottomDeviceCurrentStatuses { get; set; } = new ObservableCollection<DeviceCurrentStatus>();
- public RelayCommand<string> UpdateRawMaterName { get; set; }
- public RelayCommand<string> StartCommand { get; set; }
-
- public RelayCommand<string> StopCommand { get; set; }
- }
- }
|