Browse Source

临时更新

样式分支
taoye 2 years ago
parent
commit
f641337fcb
9 changed files with 16 additions and 90 deletions
  1. +1
    -0
      BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs
  2. +1
    -4
      BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs
  3. +1
    -1
      BPASmartClient.CustomResource/Pages/Model/Config.cs
  4. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/UserInfo.cs
  5. +5
    -4
      BPASmartClient.CustomResource/Pages/View/UserManageView.xaml.cs
  6. +2
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/UserManageViewModel.cs
  7. +1
    -73
      BPASmartClient.Modbus/ModbusTcp.cs
  8. +2
    -5
      BPASmartClient.MorkF/Control_MorkF.cs
  9. +1
    -0
      FryPot_DosingSystem/Control/DosingLogicControl.cs

+ 1
- 0
BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs View File

@@ -12,6 +12,7 @@ using System.Windows;

namespace BPASmartClient.CustomResource.Pages.Model
{
public class AlarmHelper<AlarmT> where AlarmT : class, new()
{
public static ObservableCollection<Alarm> Alarms { get; set; } = new ObservableCollection<Alarm>();


+ 1
- 4
BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs View File

@@ -10,7 +10,6 @@ namespace BPASmartClient.CustomResource.Pages.Model
{
public AlarmInfo()
{

}

#region 180项目报警信息
@@ -54,7 +53,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
/// </summary>
[Alarm("【5】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort FryPotFiveRollerTrouble { get; set; }
#region 滚筒是否运行状态监测
#region 滚筒是否运行状态监测
/// <summary>
/// 1号滚筒线滚筒未运行
/// </summary>
@@ -133,7 +132,5 @@ namespace BPASmartClient.CustomResource.Pages.Model
public ushort CleanOutputRollerRunning { get; set; }
#endregion
#endregion


}
}

+ 1
- 1
BPASmartClient.CustomResource/Pages/Model/Config.cs View File

@@ -38,7 +38,7 @@ namespace BPASmartClient.CustomResource.Pages.Model

private void AddData()
{
Global.userManager.userInfos.Add(new UserInfo() { permission = Permission.管理员, UserName = "admin", Password = "admin" });
Global.userManager.userInfos.Add(new UserInfo() {Id = Guid.NewGuid().ToString(), permission = Permission.管理员, UserName = "admin", Password = "admin" });
SaveUser();
}



+ 2
- 2
BPASmartClient.CustomResource/Pages/Model/UserInfo.cs View File

@@ -22,10 +22,10 @@ namespace BPASmartClient.CustomResource.Pages.Model
private Permission _perimission;

public string UserName { get { return _userName; } set { _userName = value; OnPropertyChanged(); } }
private string _userName = "admin";
private string _userName ;

public string Password { get { return _password; } set { _password = value; OnPropertyChanged(); } }
private string _password = "admin";
private string _password;

public string CardId { get; set; } = string.Empty;



+ 5
- 4
BPASmartClient.CustomResource/Pages/View/UserManageView.xaml.cs View File

@@ -42,10 +42,11 @@ namespace BPASmartClient.CustomResource.Pages.View

}
}
else
{
UserManageViewModel.usersInfo.Last().permission = (Permission)Enum.Parse(typeof(Permission), per.ToString());
}
//else
//{
// if (UserManageViewModel.usersInfo.Last().permission.ToString() == null)
// UserManageViewModel.usersInfo.Last().permission = (Permission)Enum.Parse(typeof(Permission), per.ToString());
//}
}



+ 2
- 1
BPASmartClient.CustomResource/Pages/ViewModel/UserManageViewModel.cs View File

@@ -91,7 +91,8 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

AddUserInfoCommand = new RelayCommand( ()=>
{
usersInfo.Add(new UserInfo());
usersInfo.Add(new UserInfo() { Id=IdProcess()});
});
SaveDataCommand = new RelayCommand(() =>


+ 1
- 73
BPASmartClient.Modbus/ModbusTcp.cs View File

@@ -250,79 +250,7 @@ namespace BPASmartClient.Modbus
return default(object);
}

#region 180项目调用
public int GetAddress(string address, string target)
{
if (address == null) return -1;
if (address.Length > 0)
{
if (address.ToUpper().Contains("D") && address.Length == 5)
{
try
{
string head = "4" + (Convert.ToInt32(address.Substring(1, 1)) - 1).ToString();
string tail = address.Substring(2, 3);
address = head + tail;
return Convert.ToInt32(address);
}
catch (Exception)
{
//打印日志

}
}

}
return -1;
}
public object Read(string address, ushort len, string target, byte slaveAddress = 1)
{
if (address == null || tcpClient == null) return default(object);
ushort startAddress = (ushort)GetAddress(address, target);
CommandType commandType = CommandType.HoldingRegisters;
try
{
if (address.ToUpper().Contains("D"))
{
commandType = CommandType.HoldingRegisters;
return master.ReadHoldingRegisters(slaveAddress, startAddress, len);
}

}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"读取地址:【{address}:= {startAddress}】,读取类型:【{commandType.ToString()}】出错,{ex.ToString()}");
ExceptionHandling(ex);
}
return default(object);
}

public void Write<T>(string address, T value, string target, byte slaveAddress = 1)
{
if (address == null || tcpClient == null) return;
ushort startAddress = (ushort)GetAddress(address, target);
CommandType commandType = CommandType.Coils;
try
{

if (address.ToUpper().Contains("D"))
{
commandType = CommandType.HoldingRegisters;
if (value is ushort ushortValue)
{
master.WriteSingleRegister(slaveAddress, startAddress, ushortValue);
}

}

}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"写入地址:【{address}:= {startAddress}】,写入类型:【{commandType.ToString()}】出错,{ex.ToString()}");
ExceptionHandling(ex);
}
}
#endregion


public void Write<T>(string address, T value, byte slaveAddress = 1)


+ 2
- 5
BPASmartClient.MorkF/Control_MorkF.cs View File

@@ -229,7 +229,6 @@ namespace BPASmartClient.MorkF
}
public void TakePot(object obj)
{

WriteData("M14.0", true);
}

@@ -663,7 +662,7 @@ namespace BPASmartClient.MorkF
break;
case StirFryPotAction.大火t1s:
MinorProcessKitchenAdjustGears(3);
Task.Delay(1000).Wait(); //大火加热1s//执行大火锅干操作
// Task.Delay(1000).Wait(); //大火加热1s//执行大火锅干操作
break;
case StirFryPotAction.加油:
AddOil();//注油//执行加油操作
@@ -787,7 +786,7 @@ namespace BPASmartClient.MorkF
break;
case StirFryPotAction.大火t1s:
MainProcessKitchenAdjustGears(3);
Task.Delay(1000).Wait(); //大火加热1s//执行大火锅干操作
// Task.Delay(1000).Wait(); //大火加热1s//执行大火锅干操作
break;
case StirFryPotAction.加油:
AddOil();//注油//执行加油操作
@@ -845,8 +844,6 @@ namespace BPASmartClient.MorkF

//}
#endregion


}
morkF.MainOutMealComplete = true;
}


+ 1
- 0
FryPot_DosingSystem/Control/DosingLogicControl.cs View File

@@ -1531,6 +1531,7 @@ namespace FryPot_DosingSystem.Control
FryPotMonitorManage.GetInstance.fryFive.OilCapacity = globalVar.fryPotFive.OilCapacity;
FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy += globalVar.fryPotFive.OilCapacity;
}
//炒锅状态实时显示
FryPotStatusDisplay();
RollerLineStatusDisplay();


Loading…
Cancel
Save