配置文件添加是否有冰箱抽屉,home页面根据该值显示与隐藏 查看冰箱温度按钮

This commit is contained in:
maqiao 2024-07-06 15:17:15 +08:00
parent 07db386649
commit ad5f4d86bb
5 changed files with 12 additions and 18 deletions

View File

@ -57,6 +57,10 @@
<add key="CanBusPortPath" value="COM3" />
<!-- 条码枪串口的串口号 -->
<add key="ScanCodePortPath" value="COM8" />
<!--是否有冰箱抽屉0无1有-->
<add key="hasFridge" value="1"/>
<!-- 冰箱的串口号 -->
<add key="FridgePortPath" value="COM7" />
@ -80,7 +84,6 @@
<add key="AlarmState2" value="0"/>
<!-- 抽屉串口的串口号 --><!--
<add key="DrawerPortPath" value="COM11" />
--><!-- can总线串口的串口号 --><!--

View File

@ -94,19 +94,6 @@ namespace DM_Weight.Converter
{
return "计数回收(外置)";
}
case 35:
if (DrawerType == 1)
{
return "药盒智能显示";
}
else if (DrawerType == 2)
{
return "药盒智能显示回收(内置)";
}
else
{
return "药盒智能显示回收(外置)";
}
}
return "";
}

View File

@ -43,6 +43,11 @@ namespace DM_Weight.ViewModels
public string WD { get => _wd; set => SetProperty(ref _wd, value); }
System.Timers.Timer WDTimer;
/// <summary>
/// 是否有冰箱抽屉
/// </summary>
private string hasFridge= ConfigurationManager.AppSettings["hasFridge"].ToString().Equals("1")? "Visible" : "Collapsed";
public string HasFridge { get => hasFridge; set => SetProperty(ref hasFridge,value); }
private int loginMode = Convert.ToInt32(ConfigurationManager.AppSettings["loginMode"]?.ToString() ?? "1");
public bool MultiLogin

View File

@ -452,9 +452,8 @@ namespace DM_Weight.ViewModels
if (f.Data)
{
// 更新屏显库存
List<ChannelStock> singleChannels = record.FindAll(it => it.BoardType != 1);
//if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5)
if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1).ToString().Contains("5"))
List<ChannelStock> singleChannels = record.FindAll(it => it.BoardType == 5);
if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5)
{
singleChannels.ForEach(it =>
{

View File

@ -119,7 +119,7 @@
<StackPanel Margin="6" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Content="储物箱" Command="{Binding OpenRecoverCommand}" Visibility="{Binding Is16Drawer, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource MaterialDesignFlatSecondaryLightButton}" />
<!--<TextBlock Margin="0,10,10,0" Text="{Binding WD}" Foreground="White" FontWeight="Bold" FontSize="14"/>-->
<Button Content="查看冰箱温度" Command="{Binding CheckWDCommand}" Style="{StaticResource MaterialDesignFlatSecondaryLightButton}"/>
<Button Content="查看冰箱温度" Visibility="{Binding HasFridge}" Command="{Binding CheckWDCommand}" Style="{StaticResource MaterialDesignFlatSecondaryLightButton}"/>
</StackPanel>
</Grid>