渲染标签 按钮添加提示信息
This commit is contained in:
parent
c9ff369dcf
commit
e8e7bfc36d
|
@ -40,9 +40,9 @@
|
||||||
<!-- 抽屉串口使用的协议232或者485 -->
|
<!-- 抽屉串口使用的协议232或者485 -->
|
||||||
<add key="DrawerProtocol" value="485" />
|
<add key="DrawerProtocol" value="485" />
|
||||||
<!-- 抽屉串口的串口号 -->
|
<!-- 抽屉串口的串口号 -->
|
||||||
<add key="DrawerPortPath" value="COM18" />
|
<add key="DrawerPortPath" value="COM3" />
|
||||||
<!-- can总线串口的串口号 -->
|
<!-- can总线串口的串口号 -->
|
||||||
<add key="CanBusPortPath" value="COM17" />
|
<add key="CanBusPortPath" value="COM9" />
|
||||||
<!-- 条码枪串口的串口号 -->
|
<!-- 条码枪串口的串口号 -->
|
||||||
<add key="ScanCodePortPath" value="COM111" />
|
<add key="ScanCodePortPath" value="COM111" />
|
||||||
<!-- 抽屉串口的串口号 --><!--
|
<!-- 抽屉串口的串口号 --><!--
|
||||||
|
|
|
@ -218,7 +218,15 @@ namespace DM_Weight.ViewModels
|
||||||
SetProperty(ref _pageSize, value);
|
SetProperty(ref _pageSize, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 渲染标签状态
|
||||||
|
/// </summary>
|
||||||
|
private bool _status = false;
|
||||||
|
public bool Status
|
||||||
|
{
|
||||||
|
get => _status;
|
||||||
|
set => SetProperty(ref _status, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool CanCloseDialog()
|
public bool CanCloseDialog()
|
||||||
|
@ -510,23 +518,29 @@ namespace DM_Weight.ViewModels
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DelegateCommand ResetLabelCommand
|
public DelegateCommand ResetLabelCommand
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(async () =>
|
get => new DelegateCommand(() =>
|
||||||
{
|
{
|
||||||
|
|
||||||
var SelectChannels = Channels.FindAll(item => item.IsSelected);
|
var SelectChannels = Channels.FindAll(item => item.IsSelected);
|
||||||
var c = SelectChannels.Count;
|
var c = SelectChannels.Count;
|
||||||
if (c > 0)
|
if (c > 0)
|
||||||
{
|
{
|
||||||
|
List<Task> tasks = new List<Task>();
|
||||||
SelectChannels.ForEach(async item =>
|
SelectChannels.ForEach(async item =>
|
||||||
{
|
{
|
||||||
//var channelStock = SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.Chnguid == item.Id).ToList();
|
//var channelStock = SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.Chnguid == item.Id).ToList();
|
||||||
|
|
||||||
if (item.BoardType == 5)
|
if (item.BoardType == 5)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Status = true;
|
||||||
if (item.DrugId == null)
|
if (item.DrugId == null)
|
||||||
{
|
{
|
||||||
// 清除显示屏库位信息
|
// 清除显示屏库位信息
|
||||||
_portUtil.ClearContent(item.DrawerNo, item.ColNo);
|
_portUtil.ClearContent(item.DrawerNo, item.ColNo);
|
||||||
await Task.Delay(200);
|
//await Task.Delay(200000);
|
||||||
|
//Thread.Sleep(200);
|
||||||
|
tasks.Add(TaskSleep());
|
||||||
_portUtil.ShowContent(item.DrawerNo, item.ColNo);
|
_portUtil.ShowContent(item.DrawerNo, item.ColNo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -535,23 +549,36 @@ namespace DM_Weight.ViewModels
|
||||||
_portUtil.WindowName = "BindingChannelDialog";
|
_portUtil.WindowName = "BindingChannelDialog";
|
||||||
// 向显示屏写入库位信息
|
// 向显示屏写入库位信息
|
||||||
_portUtil.WriteChannelInfo(1, drugSelected.DrugName, item.DrawerNo, item.ColNo);
|
_portUtil.WriteChannelInfo(1, drugSelected.DrugName, item.DrawerNo, item.ColNo);
|
||||||
await Task.Delay(200);
|
//await Task.Delay(200000000);
|
||||||
|
//Thread.Sleep(200);
|
||||||
|
tasks.Add(TaskSleep());
|
||||||
_portUtil.WriteChannelInfo(2, drugSelected.DrugSpec, item.DrawerNo, item.ColNo);
|
_portUtil.WriteChannelInfo(2, drugSelected.DrugSpec, item.DrawerNo, item.ColNo);
|
||||||
await Task.Delay(200);
|
//await Task.Delay(200);
|
||||||
|
//Thread.Sleep(200);
|
||||||
|
tasks.Add(TaskSleep());
|
||||||
_portUtil.WriteChannelInfo(8, drugSelected.Manufactory.Length > 10 ? drugSelected.Manufactory.Substring(0, 10) : drugSelected.Manufactory, item.DrawerNo, item.ColNo);
|
_portUtil.WriteChannelInfo(8, drugSelected.Manufactory.Length > 10 ? drugSelected.Manufactory.Substring(0, 10) : drugSelected.Manufactory, item.DrawerNo, item.ColNo);
|
||||||
await Task.Delay(200);
|
//await Task.Delay(200);
|
||||||
|
//Thread.Sleep(200);
|
||||||
|
tasks.Add(TaskSleep());
|
||||||
_portUtil.ShowContent(item.DrawerNo, item.ColNo);
|
_portUtil.ShowContent(item.DrawerNo, item.ColNo);
|
||||||
//_portUtil.WriteChannelInfo(6, DrugManuNo.EffDate==null?"": DrugManuNo.EffDate, item.DrawerNo, item.ColNo);
|
//_portUtil.WriteChannelInfo(6, DrugManuNo.EffDate==null?"": DrugManuNo.EffDate, item.DrawerNo, item.ColNo);
|
||||||
await Task.Delay(200);
|
//await Task.Delay(200);
|
||||||
|
//Thread.Sleep(200);
|
||||||
|
tasks.Add(TaskSleep());
|
||||||
_portUtil.WriteQuantity(item.DrawerNo, item.ColNo, item.totalCount);
|
_portUtil.WriteQuantity(item.DrawerNo, item.ColNo, item.totalCount);
|
||||||
//await Task.Delay(200);
|
//await Task.Delay(200);
|
||||||
}
|
}
|
||||||
SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00e676"));
|
|
||||||
SnackbarMessageQueue.Enqueue("标签渲染完成!");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//GetChannelsByDrawerNo();
|
Task.WhenAll(tasks);
|
||||||
|
|
||||||
|
if (Status.Equals(true))
|
||||||
|
{
|
||||||
|
SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00e676"));
|
||||||
|
SnackbarMessageQueue.Enqueue("标签渲染完成!");
|
||||||
|
Status = false;
|
||||||
|
}
|
||||||
|
GetChannelsByDrawerNo();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -560,7 +587,11 @@ namespace DM_Weight.ViewModels
|
||||||
SnackbarMessageQueue.Enqueue("请选择库位");
|
SnackbarMessageQueue.Enqueue("请选择库位");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
}, () => Status == false);
|
||||||
|
}
|
||||||
|
static async Task TaskSleep()
|
||||||
|
{
|
||||||
|
await Task.Delay(200);
|
||||||
}
|
}
|
||||||
public DelegateCommand BtnCloseCommand
|
public DelegateCommand BtnCloseCommand
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<convert:BoardTypeConverter x:Key="BoardTypeConverter" />
|
<convert:BoardTypeConverter x:Key="BoardTypeConverter" />
|
||||||
|
<convert:StatusConverter x:Key="StatusConverter" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
|
@ -73,11 +74,24 @@
|
||||||
DisplayMemberPath="drug_name_spec" IsEditable="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
|
DisplayMemberPath="drug_name_spec" IsEditable="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
|
||||||
/>
|
/>
|
||||||
<StackPanel HorizontalAlignment="Right" Grid.Column="2" Grid.ColumnSpan="2" Orientation="Horizontal">
|
<StackPanel HorizontalAlignment="Right" Grid.Column="2" Grid.ColumnSpan="2" Orientation="Horizontal">
|
||||||
|
<!--<Button
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
ToolTip="渲染标签"
|
||||||
|
Content="渲染标签"
|
||||||
|
Command="{Binding ResetLabelCommand}"
|
||||||
|
materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
|
||||||
|
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
|
||||||
|
|
||||||
|
/>-->
|
||||||
<Button
|
<Button
|
||||||
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
ToolTip="渲染标签"
|
ToolTip="渲染标签"
|
||||||
Content="渲染标签"
|
Content="渲染标签"
|
||||||
Command="{Binding ResetLabelCommand}"/>
|
Command="{Binding ResetLabelCommand}"
|
||||||
|
materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding Status, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Status, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
|
||||||
|
/>
|
||||||
<Button
|
<Button
|
||||||
Margin="6 0 6 0"
|
Margin="6 0 6 0"
|
||||||
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
|
Loading…
Reference in New Issue