mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-14 07:41:53 +01:00
128 lines
3.1 KiB
C#
128 lines
3.1 KiB
C#
|
using FabAccessAPI.Schema;
|
|||
|
using Prism.Mvvm;
|
|||
|
using static FabAccessAPI.Schema.Machine;
|
|||
|
|
|||
|
namespace Borepin.Model
|
|||
|
{
|
|||
|
public class MachineVisualize : BindableBase
|
|||
|
{
|
|||
|
#region Private Properties
|
|||
|
public Machine _Machine { get; private set; }
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Constructors
|
|||
|
public MachineVisualize(Machine machine)
|
|||
|
{
|
|||
|
_Machine = machine;
|
|||
|
|
|||
|
LoadData();
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Methods
|
|||
|
public void LoadData()
|
|||
|
{
|
|||
|
ID = _Machine.Id;
|
|||
|
Space = new SpaceVisualize(_Machine.Space);
|
|||
|
Name = _Machine.Name;
|
|||
|
Description = _Machine.Description;
|
|||
|
State = _Machine.State;
|
|||
|
Manager = new UserVisualize(_Machine.Manager);
|
|||
|
|
|||
|
CanUse = _Machine.Use != null;
|
|||
|
CanInUse = _Machine.Inuse != null;
|
|||
|
CanTransfer = _Machine.Transfer != null;
|
|||
|
CanCheck = _Machine.Check != null;
|
|||
|
CanManage = _Machine.Manage != null;
|
|||
|
CanAdmin = _Machine.Admin != null;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Properties
|
|||
|
private UUID _ID;
|
|||
|
public UUID ID
|
|||
|
{
|
|||
|
get => _ID;
|
|||
|
set => SetProperty(ref _ID, value);
|
|||
|
}
|
|||
|
|
|||
|
private SpaceVisualize _Space;
|
|||
|
public SpaceVisualize Space
|
|||
|
{
|
|||
|
get => _Space;
|
|||
|
set => SetProperty(ref _Space, value);
|
|||
|
}
|
|||
|
|
|||
|
private string _Name;
|
|||
|
public string Name
|
|||
|
{
|
|||
|
get => _Name;
|
|||
|
set => SetProperty(ref _Name, value);
|
|||
|
}
|
|||
|
|
|||
|
private string _Description;
|
|||
|
public string Description
|
|||
|
{
|
|||
|
get => _Description;
|
|||
|
set => SetProperty(ref _Description, value);
|
|||
|
}
|
|||
|
|
|||
|
private MachineState _State;
|
|||
|
public MachineState State
|
|||
|
{
|
|||
|
get => _State;
|
|||
|
set => SetProperty(ref _State, value);
|
|||
|
}
|
|||
|
|
|||
|
private UserVisualize _Manager;
|
|||
|
public UserVisualize Manager
|
|||
|
{
|
|||
|
get => _Manager;
|
|||
|
set => SetProperty(ref _Manager, value);
|
|||
|
}
|
|||
|
|
|||
|
private bool _CanUse;
|
|||
|
public bool CanUse
|
|||
|
{
|
|||
|
get => _CanUse;
|
|||
|
set => SetProperty(ref _CanUse, value);
|
|||
|
}
|
|||
|
|
|||
|
private bool _CanInUse;
|
|||
|
public bool CanInUse
|
|||
|
{
|
|||
|
get => _CanInUse;
|
|||
|
set => SetProperty(ref _CanInUse, value);
|
|||
|
}
|
|||
|
|
|||
|
private bool _CanTransfer;
|
|||
|
public bool CanTransfer
|
|||
|
{
|
|||
|
get => _CanTransfer;
|
|||
|
set => SetProperty(ref _CanTransfer, value);
|
|||
|
}
|
|||
|
|
|||
|
private bool _CanCheck;
|
|||
|
public bool CanCheck
|
|||
|
{
|
|||
|
get => _CanCheck;
|
|||
|
set => SetProperty(ref _CanCheck, value);
|
|||
|
}
|
|||
|
|
|||
|
private bool _CanManage;
|
|||
|
public bool CanManage
|
|||
|
{
|
|||
|
get => _CanManage;
|
|||
|
set => SetProperty(ref _CanManage, value);
|
|||
|
}
|
|||
|
|
|||
|
private bool _CanAdmin;
|
|||
|
public bool CanAdmin
|
|||
|
{
|
|||
|
get => _CanAdmin;
|
|||
|
set => SetProperty(ref _CanAdmin, value);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|