@@ -10,31 +10,31 @@ | |||
<ControlTemplate TargetType="{x:Type local:IcoButton}"> | |||
<Grid Name="PART_gr"> | |||
<Border | |||
Name="PART_br" | |||
Background="{TemplateBinding Background}" | |||
BorderBrush="{TemplateBinding BorderBrush}" | |||
BorderThickness="{TemplateBinding BorderThickness}" /> | |||
Name="PART_br" | |||
Background="{TemplateBinding Background}" | |||
BorderBrush="{TemplateBinding BorderBrush}" | |||
BorderThickness="{TemplateBinding BorderThickness}" /> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock | |||
Name="PART_icoText" | |||
Margin="0,0,10,0" | |||
HorizontalAlignment="Right" | |||
VerticalAlignment="Center" | |||
FontFamily="{TemplateBinding FontFamily}" | |||
FontSize="{TemplateBinding FontSize}" | |||
Foreground="{TemplateBinding Foreground}" /> | |||
Name="PART_icoText" | |||
Margin="0,0,10,0" | |||
HorizontalAlignment="Right" | |||
VerticalAlignment="Center" | |||
FontFamily="{TemplateBinding FontFamily}" | |||
FontSize="{TemplateBinding FontSize}" | |||
Foreground="{TemplateBinding Foreground}" /> | |||
<TextBlock | |||
Name="PART_content" | |||
Grid.Column="1" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Center" | |||
FontFamily="{TemplateBinding FontFamily}" | |||
FontSize="{TemplateBinding FontSize}" | |||
Foreground="{TemplateBinding Foreground}" /> | |||
Name="PART_content" | |||
Grid.Column="1" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Center" | |||
FontFamily="{TemplateBinding FontFamily}" | |||
FontSize="{TemplateBinding FontSize}" | |||
Foreground="{TemplateBinding Foreground}" /> | |||
</Grid> | |||
</Grid> | |||
</ControlTemplate> | |||
@@ -60,7 +60,7 @@ namespace BPASmartClient.Device | |||
{ | |||
p.DeviceId = this.DeviceId; | |||
p.Init(); | |||
}); | |||
this.peripherals = peripherals; | |||
} | |||
@@ -71,13 +71,13 @@ namespace BPASmartClient.Device | |||
{ | |||
foreach (var peripheral in peripherals) | |||
{ | |||
string TypeName = peripheral.GetType().FullName.Replace("BPASmartClient.",""); | |||
string TypeName = peripheral.GetType().FullName.Replace("BPASmartClient.", ""); | |||
Status.Update($"{TypeName}.IsConnected", peripheral.IsConnected); | |||
Status.Update($"{TypeName}.IsWork", peripheral.IsWork); | |||
foreach (var key in peripheral.GetAllStatus().Keys) | |||
{ | |||
peripheralStatus[key] = peripheral.GetAllStatus()[key]; | |||
Status.Update($"{TypeName}.{key}", peripheral.GetAllStatus()[key]); | |||
Status.Update(key, peripheral.GetAllStatus()[key]); | |||
} | |||
} | |||
Thread.Sleep(100); | |||
@@ -84,7 +84,7 @@ namespace BPASmartClient.Helper | |||
/// </summary> | |||
/// <param name="action"></param> | |||
/// <param name="key"></param> | |||
public void Start(Action action, string key, bool isRestart = true) | |||
public void Start(Action action, string key, bool isRestart = false) | |||
{ | |||
CancellationTokenSources.TryAdd(guid + key, new CancellationTokenSource()); | |||
bool result = Threads.TryAdd(guid + key, Task.Factory.StartNew(new Action(() => | |||
@@ -103,9 +103,9 @@ namespace BPASmartClient.Helper | |||
Threads.TryRemove(guid + key, out Task item2); | |||
Start(action, key, isRestart); | |||
} | |||
else | |||
else | |||
{ | |||
MessageLog.GetInstance.Show($"线程 【{key}】运行发生异常"); | |||
MessageLog.GetInstance.Show($"线程 【{key}】运行发生异常"); | |||
} | |||
} | |||
}), CancellationTokenSources[guid + key].Token).ContinueWith(new Action<Task, object>((t, o) => | |||
@@ -12,7 +12,7 @@ namespace BPASmartClient.MorkF | |||
{ | |||
public class Control_MorkF : BaseDevice | |||
{ | |||
public override DeviceClientType DeviceType => throw new NotImplementedException(); | |||
public override DeviceClientType DeviceType => DeviceClientType.MORKSF; | |||
GVL_MorkF morkF = new GVL_MorkF();//全局对象声明 | |||
private OrderMaterialDelivery orderMaterialDelivery { get; set; } = new OrderMaterialDelivery(); | |||
@@ -36,27 +36,33 @@ namespace BPASmartClient.MorkF | |||
{ | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
GetStatus("M0.1", new Action<bool[]>((bools) => { | |||
GetStatus("M0.1", new Action<bool[]>((bools) => | |||
{ | |||
morkF.InitialComplete = bools[0]; | |||
})); | |||
GetStatus("M1.0", new Action<bool[]>((bools) => { | |||
GetStatus("M1.0", new Action<bool[]>((bools) => | |||
{ | |||
morkF.ProvidePlateModule = bools[0]; | |||
morkF.ProvidePlateComplete = bools[2]; | |||
morkF.CleanModule = bools[3]; | |||
morkF.CleanComplete = bools[5]; | |||
})); | |||
GetStatus("M2.0", new Action<bool[]>((bools) => { | |||
GetStatus("M2.0", new Action<bool[]>((bools) => | |||
{ | |||
morkF.KitchenOneStatus = bools[1]; | |||
morkF.FallOilComplete = bools[8]; | |||
})); | |||
GetStatus("M8.0", new Action<bool[]>((bools) => { | |||
GetStatus("M8.0", new Action<bool[]>((bools) => | |||
{ | |||
morkF.TurnMachineUpComplete = bools[1]; | |||
morkF.TurnMachineDownComplete = bools[3]; | |||
})); | |||
GetStatus("M13.5", new Action<bool[]>((bools) => { | |||
GetStatus("M13.5", new Action<bool[]>((bools) => | |||
{ | |||
morkF.MaterialArriveComplete = bools[0]; | |||
})); | |||
GetStatus("M16.0", new Action<bool[]>((bools) => { | |||
GetStatus("M16.0", new Action<bool[]>((bools) => | |||
{ | |||
morkF.PutPotToKitchenComlete = bools[1]; | |||
morkF.TakeMaterialComplete = bools[2]; | |||
morkF.PlaceRinseTableComplete = bools[5]; | |||
@@ -371,7 +377,7 @@ namespace BPASmartClient.MorkF | |||
TurnDownStatusDetect();//翻转机下降及检测 | |||
KitchenAdjustGears(3);//灶台3挡 | |||
TurnMachineGearsControl(3);//翻炒机3挡 | |||
Task.Delay(2000);//葱姜蒜断生 | |||
Task.Delay(2000).Wait();//葱姜蒜断生 | |||
KitchenAdjustGears(1);//灶台1挡 | |||
TurnMachineGearsControl(0);//关闭翻炒机 | |||
TurnUpStatusDetect();//翻转机上升及检测 | |||
@@ -12,7 +12,7 @@ | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecTitleBarButton.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecComboBox.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecIcoButtonStyle.xaml"/> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecIcoButtonStyle.xaml" /> | |||
<!--<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml"/> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml"/>--> | |||
@@ -25,6 +25,7 @@ | |||
<ProjectReference Include="..\BPASmartClient.KLMCoffee\BPASmartClient.KLMCoffee.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.Lebai\BPASmartClient.Lebai.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.MorkD\BPASmartClient.MorkD.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.MorkF\BPASmartClient.MorkF.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.MorkS\BPASmartClient.MorkS.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.MorkT\BPASmartClient.MorkT.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.SCChip\BPASmartClient.SCChip.csproj" /> | |||
@@ -1,15 +1,15 @@ | |||
<?xml version="1.0" encoding="utf-8" ?> | |||
<BPADevices> | |||
<!--<Device Name="MorkT" Module="BPASmartClient.MorkT.Device_MorkT" DeviceId="1"> | |||
<Device Name="MorkT" Module="BPASmartClient.MorkT.Device_MorkT" DeviceId="1"> | |||
<Peripherals> | |||
--><!--<Peripheral Module="BPASmartClient.Lebai.LebaiRobot"> | |||
<Peripheral Module="BPASmartClient.Lebai.LebaiRobot"> | |||
<Parameters> | |||
<IpAddress>127.0.0.1</IpAddress> | |||
<HandSensor>1</HandSensor> | |||
<OutputSingalValue>0</OutputSingalValue> | |||
</Parameters> | |||
</Peripheral>--><!-- | |||
</Peripheral> | |||
<Peripheral Module="BPASmartClient.SCChip.ICChipMachine"> | |||
<Parameters> | |||
<PortName>COM5</PortName> | |||
@@ -17,39 +17,39 @@ | |||
</Parameters> | |||
</Peripheral> | |||
</Peripherals> | |||
</Device>--> | |||
</Device> | |||
<Device Name="MorkF" Module="BPASmartClient.MorkF.Control_MorkF" DeviceId="2"> | |||
<!--<Parameters> | |||
<Device Name="MorkF" Module="BPASmartClient.MorkF.Control_MorkF" DeviceId="2"> | |||
<!--<Parameters> | |||
<IpAddress>127.0.10.1</IpAddress> | |||
<Port>11</Port> | |||
</Parameters>--> | |||
<Peripherals> | |||
<Peripheral Module="BPASmartClient.PLC.MorksMachine"> | |||
<Parameters> | |||
<IpAddress>192.168.1.11</IpAddress> | |||
<Port>508</Port> | |||
<!--<PLCReadAddress>M,M0.3,3;M,M100.0,16;M,M235.0,1;M,M102.0,7;M,M103.0,6;VW,VW372,1</PLCReadAddress>--> | |||
<PLCReadAddress>M,M0.1,1;M,M1.0,8;M,M2.0,9;M,M8.0,4;M,M13.5,1;M,M16.0,7;</PLCReadAddress> | |||
</Parameters> | |||
</Peripheral> | |||
<!--<Peripheral Module="BPASmartClient.MORKSM.BK.PLC.MorksMachine"> | |||
<Peripherals> | |||
<Peripheral Module="BPASmartClient.PLC.MorksMachine"> | |||
<Parameters> | |||
<IpAddress>192.168.1.11</IpAddress> | |||
<Port>508</Port> | |||
<!--<PLCReadAddress>M,M0.3,3;M,M100.0,16;M,M235.0,1;M,M102.0,7;M,M103.0,6;VW,VW372,1</PLCReadAddress>--> | |||
<PLCReadAddress>M,M0.1,1;M,M1.0,8;M,M2.0,9;M,M8.0,4;M,M13.5,1;M,M16.0,7;</PLCReadAddress> | |||
</Parameters> | |||
</Peripheral> | |||
<!--<Peripheral Module="BPASmartClient.MORKSM.BK.PLC.MorksMachine"> | |||
<Parameters> | |||
<IpAddress>127.0.10.1</IpAddress> | |||
<Port>11</Port> | |||
</Parameters> | |||
</Peripheral>--> | |||
<!--<Peripheral Module="BPASmartClient.KLMCoffee.CoffeeMachine"> | |||
<!--<Peripheral Module="BPASmartClient.KLMCoffee.CoffeeMachine"> | |||
<Parameters> | |||
<PortName>COM8</PortName> | |||
<BaudRate>38400</BaudRate> | |||
</Parameters> | |||
</Peripheral>--> | |||
</Peripherals> | |||
</Device> | |||
</Peripherals> | |||
</Device> | |||
@@ -61,9 +61,9 @@ namespace BPASmartClient | |||
ThreadManage.GetInstance().Start(new Action(() => | |||
{ | |||
DataVClient.GetInstance().Start(); | |||
//DataVClient.GetInstance().Start(); | |||
new MainConsole().Start(); | |||
}), "启动主控制台"); | |||
}), "启动主控制台", false); | |||
} | |||
#endregion | |||