Procházet zdrojové kódy

煮面机升级版:修改参数设置界面和煮面时间写入判断逻辑。

master
ZhaoGang před 1 rokem
rodič
revize
e4b44efc61
4 změnil soubory, kde provedl 166 přidání a 19 odebrání
  1. +14
    -4
      BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs
  2. +1
    -0
      BPASmartClient.MorkSUpgradedVer/Model/MorksPar.cs
  3. +138
    -14
      BPASmartClient.MorkSUpgradedVer/View/ParSet.xaml
  4. +13
    -1
      BPASmartClient.MorkSUpgradedVer/ViewModel/ParSetViewModel.cs

+ 14
- 4
BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs Zobrazit soubor

@@ -647,10 +647,20 @@ namespace BPASmartClient.MorkSUpgradedVer
if (mORKS.RBTakeNoodleTask.TryDequeue(out OrderLocInfo orderLocInfo))
{
//写入煮面时间
List<ushort> values = new List<ushort>();
values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Minute);
values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Second);
WriteData($"VW{324 + (loc * 4)}", values.ToArray());
//List<ushort> values = new List<ushort>();
//values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Minute);
//values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Second);
//WriteData($"VW{324 + (loc * 4)}", values.ToArray());
if (mORKS.CurrentFeedbackLoc >= 1 && mORKS.CurrentFeedbackLoc <= 5) {
var x = Json<MorksPar>.Data.DishLibraryParSets.FirstOrDefault(p => p.TextBlockContext == mORKS.CurrentFeedbackLoc.ToString());
if (x != null) {
List<ushort> values = new List<ushort>();
values.Add(x.Minute);
values.Add(x.Second);
WriteData($"VW{324 + (loc * 4)}", values.ToArray());
DeviceProcessLogShow($"转盘位置[{mORKS.CurrentFeedbackLoc}]:写入煮面时间{x.Minute}分{x.Second}秒。");
}
}

mORKS.CurrentLoc = 0;
mORKS.CookNodelId[loc] = orderLocInfo.SuborderId;


+ 1
- 0
BPASmartClient.MorkSUpgradedVer/Model/MorksPar.cs Zobrazit soubor

@@ -12,5 +12,6 @@ namespace BPASmartClient.MorkSUpgradedVer.Model
internal class MorksPar
{
public ObservableCollection<ParSet> parSets { get; set; } = new ObservableCollection<ParSet>();
public ObservableCollection<ParSet> DishLibraryParSets { get; set; } = new ObservableCollection<ParSet>();
}
}

+ 138
- 14
BPASmartClient.MorkSUpgradedVer/View/ParSet.xaml Zobrazit soubor

@@ -76,12 +76,13 @@

<!-- 参数放置面板 -->
<Grid Grid.Row="2">
<ItemsControl ItemsSource="{Binding parSets}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle}" Text="{Binding TextBlockContext}" />
<TextBox
<StackPanel Orientation="Horizontal">
<ItemsControl ItemsSource="{Binding parSets}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle}" Text="{Binding TextBlockContext}" />
<TextBox
Width="100"
Margin="10,0,0,0"
VerticalAlignment="Center"
@@ -92,8 +93,8 @@
FontSize="21"
Foreground="#ff34f7f7"
Text="{Binding Minute}" />
<TextBlock Style="{StaticResource TextBlockStyle}" Text="(分)" />
<TextBox
<TextBlock Style="{StaticResource TextBlockStyle}" Text="(分)" />
<TextBox
Width="100"
Margin="0,10"
VerticalAlignment="Center"
@@ -104,9 +105,9 @@
FontSize="21"
Foreground="#ff34f7f7"
Text="{Binding Second}" />
<TextBlock Style="{StaticResource TextBlockStyle}" Text="(秒)" />
<TextBlock Style="{StaticResource TextBlockStyle}" Text="(秒)" />

<CheckBox
<CheckBox
Height="20"
Margin="10"
VerticalAlignment="Center"
@@ -117,10 +118,133 @@
IsChecked="{Binding IsShield}"
Template="{StaticResource CbTemplate}" />

</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition />
</Grid.RowDefinitions>

<Grid
Grid.Row="0"
Margin="100,10,0,0"
Background="#ff0C255F">

<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
FontSize="24"
Style="{StaticResource TitleTextblockStyle}"
Text="库位序号" />

<TextBlock
Grid.Column="1"
FontSize="24"
Style="{StaticResource TitleTextblockStyle}"
Text="煮时间(分)" />

<TextBlock
Grid.Column="2"
FontSize="24"
Style="{StaticResource TitleTextblockStyle}"
Text="煮时间(秒)" />

<Border
Grid.Column="0"
Grid.ColumnSpan="4"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,1,1,1" />
<Border
Grid.Column="1"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0" />
<Border
Grid.Column="3"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0" />


</Grid>
<Grid Grid.Row="1" Margin="100,0,0,0">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ItemsControl Foreground="DeepSkyBlue" ItemsSource="{Binding DishLibraryParSets}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Name="gr">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="157"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="18"
Text="{Binding TextBlockContext}" />

<!--<ComboBox
Grid.Column="1"
Height="auto"
Background="Transparent"
BorderThickness="0"
FontSize="18"
Foreground="DeepSkyBlue"
IsEditable="False"
ItemsSource="{Binding DataContext.DishTypeName, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
SelectedIndex="{Binding LocDishType}" />-->

<Border
Grid.Column="0"
Grid.ColumnSpan="3"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,1"></Border>

<Border
Grid.Column="1"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0">
<TextBox
Grid.Column="1"
FontSize="18"
Style="{StaticResource InputTextboxStyle}"
Text="{Binding Minute}" />
</Border>

<Border
Grid.Column="2"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0">
<TextBox
Grid.Column="2"
FontSize="18"
Style="{StaticResource InputTextboxStyle}"
Text="{Binding Second}" />
</Border>
</Grid>

<DataTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</Grid>
</StackPanel>

</Grid>



+ 13
- 1
BPASmartClient.MorkSUpgradedVer/ViewModel/ParSetViewModel.cs Zobrazit soubor

@@ -19,12 +19,24 @@ namespace BPASmartClient.MorkSUpgradedVer.ViewModel
SaveInfoCommand = new RelayCommand(SaveSettingData);

ActionManage.GetInstance.Register(SaveSettingData, "初始化设定煮面时间");

if (Json<MorksPar>.Data.DishLibraryParSets.Count < 5) {
Json<MorksPar>.Data.DishLibraryParSets.Clear();
for (int i = 0; i < 5; i++) {
Json<MorksPar>.Data.DishLibraryParSets.Add(new ParSet() {
Minute = 2,
Second = 0,
TextBlockContext = $"{i + 1}"
});
}
}

}

public RelayCommand SaveInfoCommand { get; set; }

public ObservableCollection<ParSet> parSets { get; set; } = Json<MorksPar>.Data.parSets;
public ObservableCollection<ParSet> DishLibraryParSets { get; set; } = Json<MorksPar>.Data.DishLibraryParSets;

private void SaveSettingData()
{


Načítá se…
Zrušit
Uložit