Browse Source

1. 修改配方完成日志打印及显示界面。 2.调试日志打印时添加时间显示。

master
ZhaoGang 1 year ago
parent
commit
964f818557
5 changed files with 33 additions and 4 deletions
  1. +17
    -2
      BPASmartClient.CustomResource/Pages/View/DebugLogView.xaml
  2. +1
    -1
      BPASmartClient.CustomResource/Pages/View/RecipeCompleteView.xaml
  3. +10
    -0
      BPASmartClient.CustomResource/Pages/ViewModel/DebugLogViewModel.cs
  4. +4
    -0
      BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs
  5. +1
    -1
      BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs

+ 17
- 2
BPASmartClient.CustomResource/Pages/View/DebugLogView.xaml View File

@@ -24,20 +24,35 @@
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid> <Grid>
<TextBlock
<!--<TextBlock
FontFamily="黑体" FontFamily="黑体"
FontSize="16" FontSize="16"
Foreground="{Binding Forground}" Foreground="{Binding Forground}"
LineHeight="30" LineHeight="30"
Text="{Binding LogInfo}" Text="{Binding LogInfo}"
TextWrapping="Wrap"> TextWrapping="Wrap">
<!--<TextBlock.Effect>
-->
<!--<TextBlock.Effect>
<DropShadowEffect <DropShadowEffect
Direction="0" Direction="0"
Opacity="0.5" Opacity="0.5"
ShadowDepth="5" ShadowDepth="5"
Color="#20aefe" /> Color="#20aefe" />
</TextBlock.Effect>--> </TextBlock.Effect>-->
<!--
</TextBlock>-->
<TextBlock
FontFamily="黑体"
FontSize="16"
Foreground="{Binding Forground}"
LineHeight="30"
TextWrapping="Wrap">
<TextBlock.Text>
<MultiBinding StringFormat="{}【{0:yyyy-MM-dd HH:mm:ss:ff}】 :{1}">
<Binding Path="LogTime" />
<Binding Path="LogInfo" />
</MultiBinding>
</TextBlock.Text>
</TextBlock> </TextBlock>
</Grid> </Grid>
</DataTemplate> </DataTemplate>


+ 1
- 1
BPASmartClient.CustomResource/Pages/View/RecipeCompleteView.xaml View File

@@ -312,7 +312,7 @@
Margin="10,0,0,0" Margin="10,0,0,0"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DataTextBlockStyle}" Style="{StaticResource DataTextBlockStyle}"
Text="{Binding RunLogInfo}" />
Text="{Binding RecipeName}" />


<Border <Border
Grid.ColumnSpan="6" Grid.ColumnSpan="6"


+ 10
- 0
BPASmartClient.CustomResource/Pages/ViewModel/DebugLogViewModel.cs View File

@@ -40,6 +40,16 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel


public class MessageModel : ObservableObject public class MessageModel : ObservableObject
{ {
private DateTime _logTime;
/// <summary>
/// 记录打印时间。
/// </summary>
public DateTime LogTime
{
get { return _logTime; }
set { _logTime = value; }
}

public string LogInfo { get { return _mLogInfo; } set { _mLogInfo = value; OnPropertyChanged(); } } public string LogInfo { get { return _mLogInfo; } set { _mLogInfo = value; OnPropertyChanged(); } }
private string _mLogInfo; private string _mLogInfo;




+ 4
- 0
BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs View File

@@ -28,6 +28,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
//ff20aefe //ff20aefe
var temp = new MessageModel() var temp = new MessageModel()
{ {
LogTime = DateTime.Now,
LogInfo = o, LogInfo = o,
Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254)) Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254))
}; };
@@ -45,6 +46,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
//FFF53F62 //FFF53F62
var temp = new MessageModel() var temp = new MessageModel()
{ {
LogTime=DateTime.Now,
LogInfo = o, LogInfo = o,
Forground = new SolidColorBrush(Color.FromArgb(255, 245, 63, 98)) Forground = new SolidColorBrush(Color.FromArgb(255, 245, 63, 98))
}; };
@@ -62,6 +64,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
//ff20aefe //ff20aefe
var temp = new MessageModel() var temp = new MessageModel()
{ {
LogTime=DateTime.Now,
LogInfo = o, LogInfo = o,
Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254)) Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254))
}; };
@@ -78,6 +81,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
//FFF53F62 //FFF53F62
var temp = new MessageModel() var temp = new MessageModel()
{ {
LogTime = DateTime.Now,
LogInfo = o, LogInfo = o,
Forground = new SolidColorBrush(Color.FromArgb(255, 245, 63, 98)) Forground = new SolidColorBrush(Color.FromArgb(255, 245, 63, 98))
}; };


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs View File

@@ -1025,7 +1025,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
SiemensDevice.Siemens_PLC_S7.WriteClass<XL_Finish_DB>(RecipeFinishInfo, 2261); SiemensDevice.Siemens_PLC_S7.WriteClass<XL_Finish_DB>(RecipeFinishInfo, 2261);


MessageNotify.GetInstance.ShowRunLog($"托盘1,配方【{res.RecipeCode}】,配料完成,数据反馈给西门子"); MessageNotify.GetInstance.ShowRunLog($"托盘1,配方【{res.RecipeCode}】,配料完成,数据反馈给西门子");
MessageNotify.GetInstance.ShowRecipeLog(res.RecipeName);
MessageNotify.GetInstance.ShowRecipeLog($"配方名称:【{res.RecipeName}】\t 配方号:【{res.RecipeCode}】");
} }
else else
{ {


Loading…
Cancel
Save