Selaa lähdekoodia

180更新

样式分支
taoye 2 vuotta sitten
vanhempi
commit
5c82ce5ec6
6 muutettua tiedostoa jossa 195 lisäystä ja 39 poistoa
  1. +1
    -1
      BPASmartClient.CustomResource/Pages/View/SubPagLoginView.xaml
  2. +4
    -3
      FryPot_DosingSystem/App.xaml.cs
  3. +173
    -35
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  4. +2
    -0
      FryPot_DosingSystem/View/DebugView.xaml
  5. +1
    -0
      FryPot_DosingSystem/ViewModel/AgvViewModel.cs
  6. +14
    -0
      FryPot_DosingSystem/ViewModel/DebugViewModel.cs

+ 1
- 1
BPASmartClient.CustomResource/Pages/View/SubPagLoginView.xaml Näytä tiedosto

@@ -224,8 +224,8 @@
<!--#endregion-->

</Window.Resources>

<Grid>
<Grid.Background>
<ImageBrush ImageSource="../../Image/智慧城市科技风登录页面边框.png" />
</Grid.Background>


+ 4
- 3
FryPot_DosingSystem/App.xaml.cs Näytä tiedosto

@@ -29,6 +29,7 @@ namespace FryPot_DosingSystem
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
SystemHelper.GetInstance.CreateDesktopShortcut();
MenuInite();
LoginDataInite();
@@ -171,7 +172,7 @@ namespace FryPot_DosingSystem
});
DeviceMonitor.Add(new SubMenumodel()
{
SubMenuName = "炒锅状态监控",
SubMenuName = "炒锅状态数据监控",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员, Permission.观察员 },
AssemblyName = "FryPot_DosingSystem",
ToggleWindowPath = "View.FryPotMonitorView"
@@ -201,7 +202,7 @@ namespace FryPot_DosingSystem
UserManager.Add(new SubMenumodel()
{
SubMenuName = "用户登录",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.管理员, Permission.技术员,Permission.观察员,Permission.操作员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.SubPagLoginView"
});
@@ -232,7 +233,7 @@ namespace FryPot_DosingSystem
MainMenuIcon = "&#xe66d;",
MainMenuName = "用户管理",
Alias = "User Management",
MainMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 },
MainMenuPermission = new Permission[] { Permission.管理员, Permission.技术员, Permission.观察员, Permission.操作员 },
subMenumodels = UserManager,
});
#endregion


+ 173
- 35
FryPot_DosingSystem/Control/DosingLogicControl.cs Näytä tiedosto

@@ -201,10 +201,19 @@ namespace FryPot_DosingSystem.Control

ActionManage.GetInstance.Register(new Action(() =>
{
EmptyRollerCleanTaskRestart();
LineOneEmptyRollerCleanTaskRestart();

}), "EmptyRollerCleanTaskRestart");
ActionManage.GetInstance.Register(new Action(() =>
{
LineTwoEmptyRollerCleanTaskRestart();

}), "LineTwoEmptyRollerCleanTaskRestart");
ActionManage.GetInstance.Register(new Action(() =>
{
LineThreeEmptyRollerCleanTaskRestart();

}), "LineThreeEmptyRollerCleanTaskRestart");
#endregion
//接口调试
ActionManage.GetInstance.Register(new Action(() =>
@@ -1290,9 +1299,9 @@ namespace FryPot_DosingSystem.Control
}));
}

public void EmptyRollerCleanTaskRestart()
public void LineOneEmptyRollerCleanTaskRestart()
{
ThreadManage.GetInstance().StopTask("空桶清洗任务线程", new Action(() =>
ThreadManage.GetInstance().StopTask("滚筒线1空桶清洗任务线程", new Action(() =>
{
globalVar.rollerLineOne.StationEight = 0;
globalVar.rollerLineOne.EmptyRollerNums.Clear();
@@ -1300,12 +1309,46 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineOne.IsEpmtyBefore = false;
// globalVar.rollerLineOne.CanRun = true;

globalVar.agvArriveLineFour = false;
globalVar.agvArriveCleanLoad = false;
globalVar.rollerLineOne.agvArriveCleanUnLoad = false;
globalVar.agvArriveLineOneLoadEmptyRoller = false;
globalVar.agvArriveLineOneLoadCom = false;
ThreadManage.GetInstance().StartLong(new Action(() => { LineOneToCleanProcessExecute(); Thread.Sleep(10); }), "滚筒线1空桶清洗任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线1空桶清洗任务重启成功");
}));
}


public void LineTwoEmptyRollerCleanTaskRestart()
{
ThreadManage.GetInstance().StopTask("滚筒线2空桶清洗任务线程", new Action(() =>
{
globalVar.rollerLineTwo.StationEight = 0;
globalVar.rollerLineTwo.EmptyRollerNums.Clear();
globalVar.rollerLineTwo.EmptyRollerNums.Add(208);
globalVar.rollerLineTwo.IsEpmtyBefore = false;
//globalVar.rollerLineTwo.CanRun = true;

globalVar.agvArriveLineFour = false;
globalVar.agvArriveCleanLoad = false;
globalVar.rollerLineTwo.agvArriveCleanUnLoad = false;
globalVar.agvArriveLineTwoLoadEmptyRoller = false;
globalVar.agvArriveLineTwoLoadCom = false;
ThreadManage.GetInstance().StartLong(new Action(() => { LineOneToCleanProcessExecute(); Thread.Sleep(10); }), "滚筒线2空桶清洗任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线2空桶清洗任务重启成功");
}));
}

public void LineThreeEmptyRollerCleanTaskRestart()
{
ThreadManage.GetInstance().StopTask("滚筒线3空桶清洗任务线程", new Action(() =>
{

globalVar.rollerLineThree.StationEight = 0;
globalVar.rollerLineThree.EmptyRollerNums.Clear();
globalVar.rollerLineThree.EmptyRollerNums.Add(308);
@@ -1314,17 +1357,11 @@ namespace FryPot_DosingSystem.Control

globalVar.agvArriveLineFour = false;
globalVar.agvArriveCleanLoad = false;
globalVar.rollerLineOne.agvArriveCleanUnLoad = false;
globalVar.rollerLineTwo.agvArriveCleanUnLoad = false;
globalVar.rollerLineThree.agvArriveCleanUnLoad = false;
globalVar.agvArriveLineOneLoadEmptyRoller = false;
globalVar.agvArriveLineTwoLoadEmptyRoller = false;
globalVar.agvArriveLineThreeLoadEmptyRoller = false;
globalVar.agvArriveLineOneLoadCom = false;
globalVar.agvArriveLineTwoLoadCom = false;
globalVar.agvArriveLineThreeLoadCom = false;
ThreadManage.GetInstance().StartLong(new Action(() => { LineFourProcessExecute(); Thread.Sleep(10); }), "空桶清洗任务线程");
MessageLog.GetInstance.ShowUserLog("空桶清洗任务重启成功");
ThreadManage.GetInstance().StartLong(new Action(() => { LineOneToCleanProcessExecute(); Thread.Sleep(10); }), "滚筒线3空桶清洗任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线3空桶清洗任务重启成功");
}));
}
/// <summary>
@@ -1991,8 +2028,11 @@ namespace FryPot_DosingSystem.Control
ThreadManage.GetInstance().StartLong(new Action(() => { LineOneProcessExecute(); Thread.Sleep(10); }), "滚筒线1任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineTwoProcessExecute(); Thread.Sleep(10); }), "滚筒线2任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineThreeProcessExecute(); Thread.Sleep(10); }), "滚筒线3任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineFourProcessExecute(); Thread.Sleep(10); }), "空桶清洗任务线程");

ThreadManage.GetInstance().StartLong(new Action(() => { LineOneToCleanProcessExecute(); Thread.Sleep(10); }), "滚筒线1空桶清洗任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineTwoToCleanProcessExecute(); Thread.Sleep(10); }), "滚筒线2空桶清洗任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineThreeToCleanProcessExecute(); Thread.Sleep(10); }), "滚筒线3空桶清洗任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { ToLineFourFromCleanPlate(); Thread.Sleep(10); }), "清洗台空桶回桶任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { EmptyRollerToLinFourFromPot(); Thread.Sleep(10); }), "炒锅空桶回桶任务线程");
}


@@ -2051,19 +2091,33 @@ namespace FryPot_DosingSystem.Control

//}
}
private void LineFourProcessExecute()
private void LineOneToCleanProcessExecute()
{
//线体1到清洗台
AgvFromLineOneToCleanPlate();
AgvArriveCleanPlateFromLineOne();
}
public void LineTwoToCleanProcessExecute()
{
//线体1到清洗台
AgvFromLineTwoToCleanPlate();
AgvArriveCleanPlateFromLineTwo();

}
public void LineThreeToCleanProcessExecute()
{
//线体1到清洗台
AgvFromLineThreeToCleanPlate();
AgvArriveCleanPlateFromLineThree();

}
private void ToLineFourFromCleanPlate()
{
//线体123到清洗台
AgvFromLineToCleanPlate();
AgvArriveCleanPlateFromLine();
//空桶到线体4
CallAgvToLineFour();
CleanPlateUpLoad();
//清洗台或线体123空桶到线体4
EmptyRollerToLinFourFromClean();
}

private void CleanPlateUpLoad()
{
if (globalVar.agvArriveCleanLoad)
@@ -2074,15 +2128,15 @@ namespace FryPot_DosingSystem.Control
// MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成");
if (globalVar.CleadBarrelExitSingle == 0)
{
MessageLog.GetInstance.ShowRunLog("警告:清洗台出桶滚筒未运行!!");
MessageLog.GetInstance.ShowRunLog("警告:清洗台空桶上料信号已发送,出桶滚筒未运行!!");
}
}
}

/// <summary>
/// 线体到清洗台
/// 线体1到清洗台
/// </summary>
private void AgvFromLineToCleanPlate()
private void AgvFromLineOneToCleanPlate()
{
if (AlarmHelper<AlarmInfo>.Alarm.LOneRollerTrouble == 0)//输送线无故障
{
@@ -2112,6 +2166,15 @@ namespace FryPot_DosingSystem.Control
AgvFromLineOneToClean(globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处
}
}
}

/// <summary>
/// 线体2到清洗台
/// </summary>
private void AgvFromLineTwoToCleanPlate()
{
// 线体2到清洗台
if (AlarmHelper<AlarmInfo>.Alarm.LTwoRollerTrouble == 0)//输送线无故障
{
@@ -2139,6 +2202,14 @@ namespace FryPot_DosingSystem.Control
AgvFromLineTwoToClean(globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处
}
}
}
/// <summary>
/// 线体3到清洗台
/// </summary>
private void AgvFromLineThreeToCleanPlate()
{
//线体3到清洗台
if (AlarmHelper<AlarmInfo>.Alarm.LThreeRollerTrouble == 0)//输送线无故障
{
@@ -2169,9 +2240,9 @@ namespace FryPot_DosingSystem.Control
}

/// <summary>
/// AGV从线体123到达清洗台下料位置
/// AGV从线体1到达清洗台下料位置
/// </summary>
private void AgvArriveCleanPlateFromLine()
private void AgvArriveCleanPlateFromLineOne()
{
if (globalVar.rollerLineOne.agvArriveCleanUnLoad)
{
@@ -2181,9 +2252,18 @@ namespace FryPot_DosingSystem.Control
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC
if (globalVar.CleadBarrelEnterSingle == 0)
{
MessageLog.GetInstance.ShowRunLog("警告:清洗台进桶滚筒未运行!!");
MessageLog.GetInstance.ShowRunLog("警告:清洗台空桶下料就位信号已发送,进桶滚筒未运行!!");
}
}
}

/// <summary>
/// AGV从线体2到达清洗台下料位置
/// </summary>
private void AgvArriveCleanPlateFromLineTwo()
{
if (globalVar.rollerLineTwo.agvArriveCleanUnLoad)
{
globalVar.rollerLineTwo.agvArriveCleanUnLoad = false;
@@ -2193,9 +2273,18 @@ namespace FryPot_DosingSystem.Control
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC
if (globalVar.CleadBarrelEnterSingle == 0)
{
MessageLog.GetInstance.ShowRunLog("警告:清洗台进桶滚筒未运行!!");
MessageLog.GetInstance.ShowRunLog("警告:清洗台空桶下料就位信号已发送,进桶滚筒未运行!!");
}
}

}
/// <summary>
/// AGV从线体3到达清洗台下料位置
/// </summary>
private void AgvArriveCleanPlateFromLineThree()
{
if (globalVar.rollerLineThree.agvArriveCleanUnLoad)
{
globalVar.rollerLineThree.agvArriveCleanUnLoad = false;
@@ -2205,12 +2294,11 @@ namespace FryPot_DosingSystem.Control
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC
if (globalVar.CleadBarrelEnterSingle == 0)
{
MessageLog.GetInstance.ShowRunLog("警告:清洗台进桶滚筒未运行!!");
MessageLog.GetInstance.ShowRunLog("警告:清洗台空桶下料就位信号已发送,进桶滚筒未运行!!");
}
}
}
/// <summary>
/// 呼叫Agv从清洗台运洗好的空桶到四号线体
/// </summary>
@@ -3038,7 +3126,7 @@ namespace FryPot_DosingSystem.Control
}

/// <summary>
/// 4号线体下料
/// 清洗台到4号线体下料
/// </summary>
public void EmptyRollerToLinFourFromClean()
{
@@ -3051,6 +3139,11 @@ namespace FryPot_DosingSystem.Control
MessageLog.GetInstance.ShowRunLog("AGV从清洗台到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
}

public void EmptyRollerToLinFourFromPot()
{
if (globalVar.rollerLineOne.agvArriveLineFour)//agv到达线体4下料位置
{
globalVar.rollerLineOne.agvArriveLineFour = false;
@@ -3075,11 +3168,56 @@ namespace FryPot_DosingSystem.Control
MessageLog.GetInstance.ShowRunLog("AGV从3号炒锅到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}

}
///// <summary>
///// 线体1对应炒锅到4号线体下料
///// </summary>
//public void EmptyRollerToLinFourFromLineOne()
//{

// if (globalVar.rollerLineOne.agvArriveLineFour)//agv到达线体4下料位置
// {
// globalVar.rollerLineOne.agvArriveLineFour = false;
// //线体四信号交互
// WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
// MessageLog.GetInstance.ShowRunLog("AGV从1号线体对应炒锅到达【4】号回收线体,准备卸桶");
// // MessageLog.GetInstance.ShowRunLog("卸桶完成");
// }

//}

///// <summary>
/////线体2对应炒锅到4号线体下料
///// </summary>
//public void EmptyRollerToLinFourFromLineTwo()
//{
// if (globalVar.rollerLineTwo.agvArriveLineFour)//agv到达线体4下料位置
// {
// globalVar.rollerLineTwo.agvArriveLineFour = false;
// //线体四信号交互
// WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
// MessageLog.GetInstance.ShowRunLog("AGV从2号线体对应炒锅到达【4】号回收线体,准备卸桶");
// // MessageLog.GetInstance.ShowRunLog("卸桶完成");
// }
//}
///// <summary>
///// 线体3对应炒锅到4号线体下料
///// </summary>
//public void EmptyRollerToLinFourFromLineThree()
//{
// if (globalVar.rollerLineThree.agvArriveLineFour)//agv到达线体4下料位置
// {
// globalVar.rollerLineThree.agvArriveLineFour = false;
// //线体四信号交互
// WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
// MessageLog.GetInstance.ShowRunLog("AGV从3号炒锅到达【4】号回收线体,准备卸桶");
// // MessageLog.GetInstance.ShowRunLog("卸桶完成");
// }

//}
/// <summary>
/// 炒锅1,4滚筒进料运行到位处理
/// </summary>


+ 2
- 0
FryPot_DosingSystem/View/DebugView.xaml Näytä tiedosto

@@ -88,6 +88,7 @@
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoRecipeComSignal}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体2任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoTaskExit}"></Button>
<Button Content="空桶清洗任务重置" Width="140" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoEmptyRollerCleanTaskRestart}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/>
@@ -127,6 +128,7 @@
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeRecipeComSignal}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体3任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeTaskExit}"></Button>
<Button Content="空桶清洗任务重置" Width="140" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeEmptyRollerCleanTaskRestart}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/>


+ 1
- 0
FryPot_DosingSystem/ViewModel/AgvViewModel.cs Näytä tiedosto

@@ -372,6 +372,7 @@ namespace FryPot_DosingSystem.ViewModel
/// </summary>
public T ToEnumValue<T>(string name)
{
return (T)Enum.Parse(typeof(T), name);
}
#endregion


+ 14
- 0
FryPot_DosingSystem/ViewModel/DebugViewModel.cs Näytä tiedosto

@@ -76,6 +76,10 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand AgvArriveCleanPlateLocLoad { get; set; }//上料
public RelayCommand AgvArriveCleanPlateLocLoadCom { get; set; }//上料完成
public RelayCommand EmptyRollerCleanTaskRestart { get; set; }

public RelayCommand LineTwoEmptyRollerCleanTaskRestart { get; set; }

public RelayCommand LineThreeEmptyRollerCleanTaskRestart { get; set; }
public DebugViewModel()
{
AgvDebug = new RelayCommand(new Action(() =>
@@ -112,6 +116,16 @@ namespace FryPot_DosingSystem.ViewModel

ActionManage.GetInstance.Send("EmptyRollerCleanTaskRestart");
});
LineTwoEmptyRollerCleanTaskRestart = new RelayCommand(() =>
{

ActionManage.GetInstance.Send("LineTwoEmptyRollerCleanTaskRestart");
});
LineThreeEmptyRollerCleanTaskRestart = new RelayCommand(() =>
{

ActionManage.GetInstance.Send("LineThreeEmptyRollerCleanTaskRestart");
});
AgvLineOneLoadEmptyCom = new RelayCommand(() => {
ActionManage.GetInstance.Send("AgvLineOneLoadEmptyCom");
});


Ladataan…
Peruuta
Tallenna