@@ -20,6 +20,10 @@ namespace BPASmartClient.CustomResource.Pages.View | |||
/// </summary> | |||
public partial class MainView : Window | |||
{ | |||
public string TitleName { get { return _mTitleName; } set { _mTitleName = value; this.tbTitle.Text = value; } } | |||
private string _mTitleName; | |||
public MainView() | |||
{ | |||
InitializeComponent(); | |||
@@ -51,7 +51,7 @@ | |||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="Foreground" Value="Red" /> | |||
<Setter Property="Foreground" Value="#FF2BD06F" /> | |||
<Setter Property="FontSize" Value="14" /> | |||
</Style> | |||
@@ -160,8 +160,8 @@ | |||
<!--#region 表格标题栏设置--> | |||
<Grid Grid.Row="1" Background="#ff0C255F"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="0.7*" /> | |||
<ColumnDefinition Width="0.7*" /> | |||
<ColumnDefinition Width="0.2*" /> | |||
<ColumnDefinition Width="0.2*" /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
@@ -243,8 +243,8 @@ | |||
<DataTemplate> | |||
<Grid x:Name="gr" Height="30"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="0.7*" /> | |||
<ColumnDefinition Width="0.7*" /> | |||
<ColumnDefinition Width="0.2*" /> | |||
<ColumnDefinition Width="0.2*" /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
@@ -260,28 +260,11 @@ | |||
<TextBlock | |||
Grid.Column="2" | |||
Margin="10,0,0,0" | |||
HorizontalAlignment="Left" | |||
Style="{StaticResource DataTextBlockStyle}" | |||
Text="{Binding RunLogInfo}" /> | |||
<!--<Grid Grid.Column="3"> | |||
<TextBlock | |||
Margin="10,0,0,0" | |||
HorizontalAlignment="Left" | |||
Style="{StaticResource DataTextBlockStyle}" | |||
Text="{Binding Info}" /> | |||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||
</Grid> | |||
<TextBlock | |||
Grid.Column="4" | |||
Style="{StaticResource DataTextBlockStyle}" | |||
Text="{Binding Value}" /> | |||
<Grid Grid.Column="5"> | |||
<TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Grade}" /> | |||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||
</Grid>--> | |||
<Border | |||
Grid.ColumnSpan="6" | |||
BorderBrush="{StaticResource BorderSolid}" | |||
@@ -306,8 +289,8 @@ | |||
<DataTemplate> | |||
<Grid x:Name="gr" Height="30"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="0.7*" /> | |||
<ColumnDefinition Width="0.7*" /> | |||
<ColumnDefinition Width="0.2*" /> | |||
<ColumnDefinition Width="0.2*" /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
@@ -323,28 +306,11 @@ | |||
<TextBlock | |||
Grid.Column="2" | |||
Margin="10,0,0,0" | |||
HorizontalAlignment="Left" | |||
Style="{StaticResource DataTextBlockStyle}" | |||
Text="{Binding RunLogInfo}" /> | |||
<!--<Grid Grid.Column="3"> | |||
<TextBlock | |||
Margin="10,0,0,0" | |||
HorizontalAlignment="Left" | |||
Style="{StaticResource DataTextBlockStyle}" | |||
Text="{Binding Info}" /> | |||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||
</Grid> | |||
<TextBlock | |||
Grid.Column="4" | |||
Style="{StaticResource DataTextBlockStyle}" | |||
Text="{Binding Value}" /> | |||
<Grid Grid.Column="5"> | |||
<TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Grade}" /> | |||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||
</Grid>--> | |||
<Border | |||
Grid.ColumnSpan="6" | |||
BorderBrush="{StaticResource BorderSolid}" | |||
@@ -45,8 +45,6 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||
private void DoNavChanged(object obj) | |||
{ | |||
if (obj != null && obj is SubMenumodel menumodel) | |||
{ | |||
DisplayName = menumodel.SubMenuName; | |||
@@ -18,6 +18,7 @@ | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/DatePickeerDictionary.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecButtonStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/TextBoxStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.SmallBatchingSystem;component/ResourcesStyle/ResourcesStyle.xaml" /> | |||
<ResourceDictionary> | |||
<con:ColorConverter x:Key="ColorConverter" /> | |||
@@ -26,8 +26,9 @@ namespace BPASmartClient.SmallBatchingSystem | |||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; | |||
MenuInit(); | |||
Control.GetInstance.Init(); | |||
SiloServer siloServer = new SiloServer(); | |||
//SiloServer siloServer = new SiloServer(); | |||
MainView mv = new MainView(); | |||
mv.TitleName = "黑菠萝配料系统"; | |||
//LoginView lv = new LoginView(); | |||
//var res = lv.ShowDialog(); | |||
//if (res != null && res == true) | |||
@@ -132,6 +133,7 @@ namespace BPASmartClient.SmallBatchingSystem | |||
SubMenuName = "操作日志", | |||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
SubMenuVisibility = Visibility.Visible, | |||
ToggleWindowPath = "Pages.View.UserLogView" | |||
}); | |||
@@ -140,6 +142,7 @@ namespace BPASmartClient.SmallBatchingSystem | |||
SubMenuName = "运行日志", | |||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
SubMenuVisibility = Visibility.Visible, | |||
ToggleWindowPath = "Pages.View.RunLogView" | |||
}); | |||
@@ -148,6 +151,7 @@ namespace BPASmartClient.SmallBatchingSystem | |||
SubMenuName = "报警记录", | |||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
SubMenuVisibility = Visibility.Visible, | |||
ToggleWindowPath = "Pages.View.AlarmView" | |||
}); | |||
@@ -156,6 +160,7 @@ namespace BPASmartClient.SmallBatchingSystem | |||
SubMenuName = "调试日志", | |||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
SubMenuVisibility = Visibility.Visible, | |||
ToggleWindowPath = "Pages.View.DebugLogView" | |||
}); | |||
@@ -7,6 +7,10 @@ | |||
<UseWPF>true</UseWPF> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<None Remove="Fonts\iconfont.ttf" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Images\" /> | |||
</ItemGroup> | |||
@@ -23,4 +27,8 @@ | |||
<ProjectReference Include="..\BPASmartClient.Modbus\BPASmartClient.Modbus.csproj" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Resource Include="Fonts\iconfont.ttf" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,35 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using System.Data; | |||
using System.Windows.Data; | |||
using System.Globalization; | |||
using System.Windows.Media; | |||
namespace BPASmartClient.SmallBatchingSystem.Converter | |||
{ | |||
public class ForegroundConverter : IValueConverter | |||
{ | |||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |||
{ | |||
SolidColorBrush returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 204, 255)); | |||
if (value != null) | |||
{ | |||
if (value.ToString() == "等待配料") | |||
returnValue = new SolidColorBrush(Color.FromArgb(255, 236, 187, 17));//黄 FFECBB11 | |||
else if (value.ToString() == "正在配料") | |||
returnValue = new SolidColorBrush(Color.FromArgb(255, 22, 219, 234));//篮 FF16DBEA | |||
else if (value.ToString() == "配料完成") | |||
returnValue = new SolidColorBrush(Color.FromArgb(255, 43, 208, 111));//绿 FF2BD06F | |||
} | |||
return returnValue; | |||
} | |||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | |||
{ | |||
throw new NotImplementedException(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,47 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using System.Data; | |||
using System.Windows.Data; | |||
using System.Globalization; | |||
using System.Text.RegularExpressions; | |||
namespace BPASmartClient.SmallBatchingSystem.Converter | |||
{ | |||
public class StatusIconConverter : IValueConverter | |||
{ | |||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |||
{ | |||
if (value != null) | |||
{ | |||
if (value.ToString() == Status.等待配料.ToString()) | |||
return Regex.Unescape(StringToUnicode("")); | |||
else if (value.ToString() == Status.正在配料.ToString()) | |||
return Regex.Unescape(StringToUnicode("")); | |||
else if (value.ToString() == Status.配料完成.ToString()) | |||
return Regex.Unescape(StringToUnicode("")); | |||
} | |||
return value; | |||
} | |||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | |||
{ | |||
throw new NotImplementedException(); | |||
} | |||
/// <summary> | |||
/// 字符串转为UniCode码字符串 | |||
/// </summary> | |||
public static string StringToUnicode(string s) | |||
{ | |||
if (!string.IsNullOrEmpty(s)) | |||
{ | |||
//这里把格式 转为 \ue625 | |||
return s.Replace(@"&#x", @"\u").Replace(";", ""); | |||
} | |||
return s; | |||
} | |||
} | |||
} |
@@ -8,7 +8,8 @@ namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public class CommunicationPar | |||
{ | |||
public string Host { get; set; } | |||
//public string Host { get; set; } = "192.168.6.100"; | |||
public string Host { get; set; } = "127.0.0.1"; | |||
public int Port { get; set; } = 502; | |||
} | |||
@@ -9,6 +9,20 @@ namespace BPASmartClient.SmallBatchingSystem | |||
public class PlcDataModel | |||
{ | |||
public static bool[] TargetLocFeedback { get; set; } = new bool[16]; | |||
/// <summary> | |||
/// 到达目标位置 | |||
/// </summary> | |||
public static bool TargetLocComplete { get; set; } | |||
/// <summary> | |||
/// 通道配料完成 | |||
/// </summary> | |||
public static bool BatchingCompleted { get; set; } | |||
/// <summary> | |||
/// 配方配料完成 | |||
/// </summary> | |||
public static bool RecipeBatchingComplete { get; set; } | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public class RecipeStatus : ObservableObject | |||
{ | |||
public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } } | |||
private string _mRawMaterialName; | |||
public bool IsChecked { get { return _mIsChecked; } set { _mIsChecked = value; OnPropertyChanged(); } } | |||
private bool _mIsChecked; | |||
public string Status { get { return _mStatus; } set { _mStatus = value; OnPropertyChanged(); } } | |||
private string _mStatus = "等待配料"; | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public enum Status | |||
{ | |||
等待配料, | |||
正在配料, | |||
配料完成 | |||
} | |||
} |
@@ -0,0 +1,133 @@ | |||
<ResourceDictionary | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:con="clr-namespace:BPASmartClient.SmallBatchingSystem.Converter" | |||
xmlns:locCon="clr-namespace:BPASmartClient.SmallBatchingSystem.Converter"> | |||
<!--#region 颜色资源--> | |||
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" /> | |||
<SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" /> | |||
<SolidColorBrush x:Key="bordColor" Color="#332AB2E7" /> | |||
<!--#endregion--> | |||
<!--#region 值转换器--> | |||
<con:DataTableRedundantConverter x:Key="tabConvert" /> | |||
<locCon:StatusIconConverter x:Key="StatusIconConverter" /> | |||
<locCon:ForegroundConverter x:Key="ForegroundConverter" /> | |||
<!--#endregion--> | |||
<Style x:Key="TextBlockStyle" TargetType="TextBlock"> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="HorizontalAlignment" Value="Right" /> | |||
<Setter Property="Foreground" Value="{StaticResource FontColor}" /> | |||
<Setter Property="FontSize" Value="20" /> | |||
</Style> | |||
<Style x:Key="TextBoxStyle" TargetType="TextBox"> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontSize" Value="22" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Width" Value="188" /> | |||
<Setter Property="Padding" Value="6,0,0,0" /> | |||
<Setter Property="Height" Value="37" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="Foreground" Value="#009dff" /> | |||
<Setter Property="BorderBrush" Value="#009dff" /> | |||
<Setter Property="CaretBrush" Value="#009dff" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Background"> | |||
<Setter.Value> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/textBox.png" Stretch="Fill" /> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="InputTextboxStyle" TargetType="TextBox"> | |||
<Setter Property="Margin" Value="5,0,0,0" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="HorizontalAlignment" Value="Left" /> | |||
<Setter Property="Width" Value="150" /> | |||
<Setter Property="Height" Value="40" /> | |||
<Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="FontSize" Value="14" /> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
</Style> | |||
<Style x:Key="ControlButtonStyle" TargetType="Button"> | |||
<Setter Property="Margin" Value="0" /> | |||
<Setter Property="FontSize" Value="18" /> | |||
<Setter Property="Foreground" Value="#FFF53F62" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="Button"> | |||
<Border | |||
Name="TitleBarBr" | |||
BorderBrush="#00c2f4" | |||
BorderThickness="0" | |||
CornerRadius="0" | |||
Opacity="0.8"> | |||
<ContentPresenter | |||
Margin="{TemplateBinding Margin}" | |||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | |||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||
<Border.Background> | |||
<ImageBrush | |||
ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png" | |||
Opacity="0.8" | |||
Stretch="Fill" /> | |||
</Border.Background> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter TargetName="TitleBarBr" Property="Opacity" Value="1" /> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="TitleTextblockStyle" TargetType="TextBlock"> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Foreground" Value="{StaticResource tabColor}" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
</Style> | |||
<Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem"> | |||
<Style.Resources> | |||
<!-- SelectedItem with focus --> | |||
<SolidColorBrush | |||
x:Key="{x:Static SystemColors.HighlightBrushKey}" | |||
Opacity=".4" | |||
Color="White" /> | |||
<!-- SelectedItem without focus --> | |||
<SolidColorBrush | |||
x:Key="{x:Static SystemColors.ControlBrushKey}" | |||
Opacity=".4" | |||
Color="White" /> | |||
</Style.Resources> | |||
<!-- 设置触发器 --> | |||
<Style.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter Property="Background" Value="White" /> | |||
<Setter Property="Foreground" Value="White" /> | |||
</Trigger> | |||
<Trigger Property="IsFocused" Value="true"> | |||
<Setter Property="Background" Value="White" /> | |||
<Setter Property="Foreground" Value="White" /> | |||
</Trigger> | |||
</Style.Triggers> | |||
</Style> | |||
</ResourceDictionary> |
@@ -8,6 +8,7 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
@@ -18,12 +19,13 @@ namespace BPASmartClient.SmallBatchingSystem | |||
private Control() { } | |||
public ConcurrentQueue<RecipeInfo> MakeOrderQueue { get; set; } = new ConcurrentQueue<RecipeInfo>(); | |||
public bool IsCancel { get; set; } | |||
public void Init() | |||
{ | |||
ThreadManage.GetInstance().Start(new Action(() => | |||
{ | |||
PlcServer.GetInstance.Connect(); | |||
}), "设备初始化"); | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
@@ -32,43 +34,84 @@ namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
if (MakeOrderQueue.TryDequeue(out RecipeInfo recipeInfo)) | |||
{ | |||
IsCancel = false; | |||
List<int> OutletInfo = new List<int>(); | |||
recipeInfo.SiloInfoModels.ToList()?.ForEach(item => | |||
{ | |||
var res = Json<ConfigInfoModel>.Data.OutletInfoModels.FirstOrDefault(p => p.SiloInfos.FirstOrDefault(s => s.Contains(item.SiloName)) != null); | |||
if (res != null) if (!OutletInfo.Contains(res.OutletLoc)) OutletInfo.Add(res.OutletLoc); | |||
}); | |||
OutletInfo.ForEach(temp => | |||
foreach (var temp in OutletInfo) | |||
{ | |||
PlcServer.GetInstance.WriteData("VW302", (ushort)temp);//设置出料口位置 | |||
PlcServer.GetInstance.WriteData("M10.0", true);//定位启动 | |||
Message($"启动定位,出料口位置:{temp}"); | |||
int index = temp - 1; | |||
if (index >= 0 && index < PlcDataModel.TargetLocFeedback.Length) | |||
if (index >= 0) | |||
{ | |||
while (!PlcDataModel.TargetLocFeedback[index]) Thread.Sleep(1);//等待定位反馈 | |||
recipeInfo.SiloInfoModels.ToList()?.ForEach(temp1 => | |||
Message("等待定位完成"); | |||
while (!PlcDataModel.TargetLocComplete && !IsCancel) Thread.Sleep(1);//等待定位反馈 | |||
if (IsCancel) break; | |||
Message("定位完成"); | |||
PlcServer.GetInstance.WriteData("M20.0", false); | |||
while (PlcDataModel.TargetLocComplete && !IsCancel) Thread.Sleep(1); | |||
if (IsCancel) break; | |||
Message("定位完成,复位成功"); | |||
foreach (var temp1 in recipeInfo.SiloInfoModels) | |||
{ | |||
var res = Json<ConfigInfoModel>.Data.SiloInfoModels.FirstOrDefault(p => p.SiloName == temp1.SiloName); | |||
if (res != null) | |||
var rest = Json<ConfigInfoModel>.Data.OutletInfoModels.FirstOrDefault(p => p.SiloInfos.FirstOrDefault(s => s.Contains(temp1.SiloName)) != null); | |||
if (rest != null && rest.OutletLoc == temp) | |||
{ | |||
PlcServer.GetInstance.WriteData(GetWeightAdd(res.SiloLoc), (ushort)temp1.SiloWeight); | |||
PlcServer.GetInstance.WriteData(GetStartSingleAdd(res.SiloLoc), true); | |||
while (!PlcDataModel.BatchingCompleted) Thread.Sleep(1);//等待出料完成 | |||
PlcServer.GetInstance.WriteData("M4.0", false);//复位出料完成信号 | |||
while (PlcDataModel.BatchingCompleted) Thread.Sleep(1);//等待出料完成信号复位成功 | |||
var res = Json<ConfigInfoModel>.Data.SiloInfoModels.FirstOrDefault(p => p.SiloName == temp1.SiloName); | |||
if (res != null) | |||
{ | |||
StatusNotify(res.SiloName, Status.正在配料); | |||
Message($"写重量地址:{GetWeightAdd(res.SiloLoc)},重量:{temp1.SiloWeight}"); | |||
PlcServer.GetInstance.WriteData(GetWeightAdd(res.SiloLoc), (ushort)temp1.SiloWeight); | |||
Message($"写启动信号地址:{GetStartSingleAdd(res.SiloLoc)}"); | |||
PlcServer.GetInstance.WriteData(GetStartSingleAdd(res.SiloLoc), true); | |||
while (!PlcDataModel.BatchingCompleted && !IsCancel) Thread.Sleep(1);//等待出料完成 | |||
if (IsCancel) break; | |||
Message("出料完成,复位出料完成状态"); | |||
PlcServer.GetInstance.WriteData("M4.0", false);//复位出料完成信号 | |||
while (PlcDataModel.BatchingCompleted && !IsCancel) Thread.Sleep(1);//等待出料完成信号复位成功 | |||
if (IsCancel) break; | |||
Message("出料完成复位成功"); | |||
StatusNotify(res.SiloName, Status.配料完成); | |||
} | |||
} | |||
}); | |||
} | |||
if (IsCancel) return; | |||
} | |||
} | |||
}); | |||
PlcServer.GetInstance.WriteData("M10.4", true); | |||
if (!IsCancel) | |||
{ | |||
Message($"写入配方执行完成信号"); | |||
PlcServer.GetInstance.WriteData("M10.4", true); | |||
Message("等待配方执行完成"); | |||
while (!PlcDataModel.RecipeBatchingComplete && !IsCancel) Thread.Sleep(1); | |||
if (IsCancel) break; | |||
Message($"【{recipeInfo.RecipeName}】配方执行完成"); | |||
ActionManage.GetInstance.Send("GrindArenaceousCancel"); | |||
} | |||
} | |||
} | |||
Thread.Sleep(10); | |||
}), "配方流程控制"); | |||
} | |||
private bool Wait(ref bool Targger, bool IsCancel = false) | |||
{ | |||
bool a = Targger; | |||
while (!IsCancel) | |||
{ | |||
if (a) | |||
Thread.Sleep(1); | |||
} | |||
return !IsCancel; | |||
} | |||
/// <summary> | |||
@@ -80,12 +123,31 @@ namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
if (num > 0) | |||
{ | |||
var s = 100 + (num - 1) * 2; | |||
return $"VW{s}"; | |||
int add = 0; | |||
if (num >= 1 && num <= 8) | |||
{ | |||
add = 100 + (num - 1) * 2; | |||
} | |||
else if (num >= 9 && num <= 18) | |||
{ | |||
add = 102 + (num - 1) * 2; | |||
} | |||
return $"VW{add}"; | |||
} | |||
return default; | |||
} | |||
private void StatusNotify(string SiloName, Status Status) | |||
{ | |||
ActionManage.GetInstance.Send("StatusNotify", new RecipeStatus() { RawMaterialName = SiloName, Status = Status.ToString() }); | |||
} | |||
private void Message(string info) | |||
{ | |||
BPASmartClient.CustomResource.Pages.Model.MessageLog.GetInstance.ShowRunLog(info); | |||
Debug.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")}:{info}"); | |||
} | |||
/// <summary> | |||
/// 获取启动信号地址 | |||
/// </summary> | |||
@@ -104,7 +166,6 @@ namespace BPASmartClient.SmallBatchingSystem | |||
c = 7; | |||
} | |||
else c--; | |||
Add = $"M{ t}.{c}"; | |||
return Add; | |||
} | |||
@@ -26,13 +26,10 @@ namespace BPASmartClient.SmallBatchingSystem | |||
MessageLog.GetInstance.Show("设备连接成功"); | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
var res = ReadData("M20.0", 16);//到达目标位置信号 | |||
if (res != null && res is bool[] bools && bools.Length == 16) | |||
var res = ReadData("M20.0", 1);//到达目标位置信号 | |||
if (res != null && res is bool[] bools && bools.Length == 1) | |||
{ | |||
for (int i = 0; i < bools.Length; i++) | |||
{ | |||
PlcDataModel.TargetLocFeedback[i] = bools[i]; | |||
} | |||
PlcDataModel.TargetLocComplete = bools[0]; | |||
} | |||
var res1 = ReadData("M4.0", 1);//通道出料完成 | |||
@@ -41,6 +38,12 @@ namespace BPASmartClient.SmallBatchingSystem | |||
PlcDataModel.BatchingCompleted = bools1[0]; | |||
} | |||
var res2 = ReadData("M13.3", 1);//配方配料完成 | |||
if (res2 != null && res2 is bool[] bools2 && bools2.Length == 1) | |||
{ | |||
PlcDataModel.RecipeBatchingComplete = bools2[0]; | |||
} | |||
Thread.Sleep(10); | |||
}), "PLC 数据监听"); | |||
}); | |||
@@ -1,221 +0,0 @@ | |||
using BPASmart.Model; | |||
using BPASmartClient.Helper; | |||
using System; | |||
using System.Collections.Concurrent; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
/// <summary> | |||
/// 料仓服务线程 | |||
/// </summary> | |||
public class SiloServer | |||
{ | |||
public SiloServer() | |||
{ | |||
BusinessThread(); | |||
RefreshRecips(); | |||
MakeToRecipsID("2d1ac4da-110b-4d4d-9e94-36aac6d67124"); | |||
} | |||
#region 临时变量 | |||
/// <summary> | |||
/// 物料数据 | |||
/// </summary> | |||
public ObservableCollection<RecipeMaterials> RecipeMaterialsDic = new ObservableCollection<RecipeMaterials>(); | |||
/// <summary> | |||
/// 当前配方 | |||
/// </summary> | |||
public ObservableCollection<Recipes> RecipesDic = new ObservableCollection<Recipes>(); | |||
#endregion | |||
#region 订单管理 | |||
public ConcurrentQueue<Recipes> MakeOrderQueue { get; set; } = new ConcurrentQueue<Recipes>(); | |||
#endregion | |||
#region 业务 | |||
/// <summary> | |||
/// 业务线程 | |||
/// </summary> | |||
public void BusinessThread() | |||
{ | |||
ThreadManage.GetInstance().Start(new Action(() => | |||
{ | |||
PlcServer.GetInstance.Connect(); | |||
}), "启动PLC", false); | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
// if (PlcServer.GetInstance.Communication.Connected) | |||
{ | |||
if (MakeOrderQueue.TryDequeue(out Recipes recipes)) | |||
{ | |||
Make(recipes); | |||
} | |||
} | |||
}), "配料线程启动", true); | |||
} | |||
#endregion | |||
#region 调用函数 | |||
/// <summary> | |||
/// 刷新配方数据 | |||
/// </summary> | |||
public void RefreshRecips() | |||
{ | |||
try | |||
{ | |||
//读取料仓物料数据 配方数据 | |||
Json<LocalMaterails>.Read(); | |||
Json<LocalRecipes>.Read(); | |||
RecipeMaterialsDic = Json<LocalMaterails>.Data.locaMaterails; | |||
RecipesDic = Json<LocalRecipes>.Data.locaRecipes; | |||
RecipesDic?.ToList().ForEach(par => | |||
{ | |||
par.recipeMaterials?.ToList().ForEach((recipeMaterial) => | |||
{ | |||
RecipeMaterials recipe = RecipeMaterialsDic?.ToList().Find(k => k.ID == recipeMaterial.ID); | |||
if (recipe != null) | |||
{ | |||
recipeMaterial.MaterialType = recipe.MaterialType; | |||
recipeMaterial.MaterialPosion = recipe.MaterialPosion; | |||
recipeMaterial.PropertyCollections = recipe.PropertyCollections; | |||
} | |||
}); | |||
}); | |||
} | |||
catch (Exception ex) | |||
{ | |||
} | |||
} | |||
/// <summary> | |||
/// 根据配方ID制作流程 | |||
/// </summary> | |||
public void MakeToRecipsID(string id) | |||
{ | |||
try | |||
{ | |||
//chaxun 配方 | |||
Recipes info = RecipesDic?.ToList().Find(par => par.ID == id); | |||
if (info != null) | |||
{ | |||
//添加到队列 | |||
MakeOrderQueue.Enqueue(info); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
} | |||
} | |||
/// <summary> | |||
/// 根据配方控制流程 | |||
/// </summary> | |||
/// <param name="recipes"></param> | |||
public async void Make(Recipes recipes) | |||
{ | |||
try | |||
{ | |||
//遍历配方物料集合 | |||
recipes?.recipeMaterials?.ToList().ForEach(recipe => | |||
{ | |||
//料仓位置 | |||
int recipesLoc = 1; | |||
int.TryParse(recipe.PropertyCollections?.First()?.PropertyValue, out recipesLoc); | |||
//原料位置 | |||
int storeLoc = 1; int.TryParse(recipe.MaterialPosion, out recipesLoc); | |||
//原料需求(g)数 | |||
int storeWeight = recipe.MaterialWeight; | |||
//1.写PLC VW302 目标位置 -> recipesLoc M10.0 定位启动 开始运行 | |||
//2.读取PLC M20.0 到达目标位置 <- 标志 (bool) 【等待】 | |||
//3.写PLC VW100 料口X需求 ->写入重量 storeWeight | |||
//4.写PLC M0.0 启动出料口xx ->storeLoc (bool) | |||
//5.读PLC M4.0 通道XX出料完成<-标志 (bool) 【等待】 | |||
if (storeWeight > 0) | |||
{ | |||
WriteData("VW302", recipesLoc); | |||
WriteData("M10.0", true); | |||
#region 读取是否到达目标位置,超时10秒 | |||
bool IsOver = false; | |||
int fade1 = 1000; | |||
while (fade1 != -1 && !IsOver) | |||
{ | |||
IsOver = (bool)ReadData("M20.0", 1); | |||
Thread.Sleep(10); | |||
fade1--; | |||
} | |||
#endregion | |||
if (IsOver)//到达指定位置 | |||
{ | |||
//写需求 | |||
string adder = $"VW{100 + 2 * (storeLoc - 1)}"; | |||
WriteData(adder, storeWeight); | |||
//写启动料口 | |||
adder = storeLoc <= 8 ? $"M0.{(storeLoc - 1)}" : $"M1.{(storeLoc - 9)}"; | |||
WriteData(adder, true); | |||
//读取通道下料是否完成 | |||
adder = storeLoc <= 8 ? $"M4.{(storeLoc - 1)}" : $"M5.{(storeLoc - 9)}"; | |||
#region 通道XX出料完成,超时10秒 | |||
bool IsXLOver = false; | |||
int fade1XL = 1000; | |||
while (fade1XL != -1 && !IsXLOver) | |||
{ | |||
IsXLOver = (bool)ReadData("M20.0", 1); | |||
Thread.Sleep(30); | |||
fade1XL--; | |||
} | |||
#endregion | |||
} | |||
} | |||
}); | |||
//6.写PLC M10.4 上位机配料完成 | |||
WriteData("M10.4", true); | |||
} | |||
catch (Exception ex) { } | |||
} | |||
#endregion | |||
#region 调用外部PLC | |||
/// <summary> | |||
/// 写PLC | |||
/// </summary> | |||
/// <param name="address"></param> | |||
/// <param name="value"></param> | |||
public void WriteData(string address, object value) | |||
{ | |||
//PlcServer.GetInstance.WriteData(address, value); | |||
} | |||
/// <summary> | |||
/// 读PLC | |||
/// </summary> | |||
/// <param name="address"></param> | |||
/// <param name="length"></param> | |||
/// <returns></returns> | |||
public object ReadData(string address, int length) | |||
{ | |||
//return PlcServer.GetInstance.ReadData(address, length); | |||
return null; | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,48 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using BPA.Helper; | |||
using System.Collections.ObjectModel; | |||
namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
{ | |||
public class GrindArenaceousViewModel : BaseModel | |||
{ | |||
public GrindArenaceousViewModel() | |||
{ | |||
ActionManage.GetInstance.Register(new Action<object>((o) => | |||
{ | |||
if (o != null && o is RecipeStatus recipe) | |||
{ | |||
int index = Array.FindIndex(Recipes.ToArray(), p => p.RawMaterialName == recipe.RawMaterialName); | |||
if (index >= 0 && index < Recipes.Count) | |||
{ | |||
Recipes.ElementAt(index).Status = recipe.Status; | |||
Recipes.ElementAt(index).IsChecked = true; | |||
} | |||
} | |||
}), "StatusNotify", true); | |||
ActionManage.GetInstance.Register(new Action<object>((o) => | |||
{ | |||
if (o != null && o is RecipeInfo recipe) | |||
{ | |||
RecipeName = recipe.RecipeName; | |||
recipe.SiloInfoModels.ToList()?.ForEach(x => | |||
{ | |||
Recipes.Add(new RecipeStatus() { RawMaterialName = x.SiloName, Status = "等待配料" }); | |||
}); | |||
} | |||
}), "OpenRecipeStatusMotion", true); | |||
CancelCommand = new RelayCommand(() => { Control.GetInstance.IsCancel = true; ActionManage.GetInstance.Send("GrindArenaceousCancel"); }); | |||
} | |||
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } } | |||
private string _mRecipeName; | |||
public ObservableCollection<RecipeStatus> Recipes { get; set; } = new ObservableCollection<RecipeStatus>(); | |||
} | |||
} |
@@ -7,6 +7,7 @@ using System.Threading.Tasks; | |||
using BPA.Helper; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using BPASmartClient.SmallBatchingSystem.Views; | |||
namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
{ | |||
@@ -22,7 +23,11 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
int index = Array.FindIndex(Json<ConfigInfoModel>.Data.Recipes.ToArray(), p => p.RecipeName == o.ToString()); | |||
if (index >= 0 && index < Json<ConfigInfoModel>.Data.Recipes.Count) | |||
{ | |||
Control.GetInstance.MakeOrderQueue.Enqueue(Json<ConfigInfoModel>.Data.Recipes.ElementAt(index)); | |||
var data = Json<ConfigInfoModel>.Data.Recipes.ElementAt(index); | |||
GrindArenaceousView grindArenaceousView = new GrindArenaceousView(); | |||
ActionManage.GetInstance.Send("OpenRecipeStatusMotion", data); | |||
Control.GetInstance.MakeOrderQueue.Enqueue(data); | |||
grindArenaceousView.ShowDialog(); | |||
} | |||
} | |||
}); | |||
@@ -0,0 +1,153 @@ | |||
<Window | |||
x:Class="BPASmartClient.SmallBatchingSystem.Views.GrindArenaceousView" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmartClient.SmallBatchingSystem.Views" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:vm="clr-namespace:BPASmartClient.SmallBatchingSystem.ViewModels" | |||
Title="GrindArenaceousView" | |||
Width="800" | |||
Height="450" | |||
AllowsTransparency="True" | |||
Background="{x:Null}" | |||
WindowStartupLocation="CenterScreen" | |||
WindowState="Maximized" | |||
WindowStyle="None" | |||
mc:Ignorable="d"> | |||
<Window.DataContext> | |||
<vm:GrindArenaceousViewModel /> | |||
</Window.DataContext> | |||
<Grid Name="gr"> | |||
<Border Background="#00c2f4" Opacity="0.2" /> | |||
<Grid Width="500" Height="350"> | |||
<Grid.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/容器边框.png" /> | |||
</Grid.Background> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="0.3*" /> | |||
<RowDefinition Height="0.2*" /> | |||
<RowDefinition /> | |||
<RowDefinition Height="0.3*" /> | |||
</Grid.RowDefinitions> | |||
<TextBlock | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
FontSize="20" | |||
Foreground="#00c2f4" | |||
Text="{Binding RecipeName}" /> | |||
<Grid Grid.Row="1" Margin="5,0"> | |||
<!--#region 表格标题栏设置--> | |||
<Grid Margin="0,10,0,0" Background="#ff0C255F"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock | |||
Grid.Column="0" | |||
Style="{StaticResource TitleTextblockStyle}" | |||
Text="原料" /> | |||
<Grid Grid.Column="1"> | |||
<TextBlock Style="{StaticResource TitleTextblockStyle}" Text="状态" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<Border | |||
Grid.ColumnSpan="2" | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" /> | |||
</Grid> | |||
<!--#endregion--> | |||
</Grid> | |||
<Grid Grid.Row="2" Margin="5,0"> | |||
<ScrollViewer | |||
Grid.Row="1" | |||
HorizontalScrollBarVisibility="Hidden" | |||
VerticalScrollBarVisibility="Hidden"> | |||
<ItemsControl ItemsSource="{Binding Recipes}"> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<RadioButton | |||
Name="rb" | |||
GroupName="all" | |||
IsChecked="{Binding IsChecked}"> | |||
<RadioButton.Template> | |||
<ControlTemplate TargetType="RadioButton"> | |||
<Grid Name="gr" Height="30"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<StackPanel | |||
Margin="0,0,5,0" | |||
HorizontalAlignment="Right" | |||
Orientation="Horizontal"> | |||
<TextBlock Style="{StaticResource TitleTextblockStyle}" Text="{Binding RawMaterialName}" /> | |||
<TextBlock Style="{StaticResource TitleTextblockStyle}" Text=":" /> | |||
</StackPanel> | |||
<StackPanel | |||
Grid.Column="1" | |||
Margin="2,0,0,0" | |||
Orientation="Horizontal"> | |||
<TextBlock | |||
Margin="0,0,5,0" | |||
Foreground="{Binding Status, Converter={StaticResource ForegroundConverter}}" | |||
Style="{StaticResource TitleTextblockStyle}" | |||
Text="{Binding Status}" /> | |||
<TextBlock | |||
FontFamily="../Fonts/#iconfont" | |||
FontSize="20" | |||
Foreground="{Binding Status, Converter={StaticResource ForegroundConverter}}" | |||
Style="{StaticResource TitleTextblockStyle}" | |||
Text="{Binding Status, Converter={StaticResource StatusIconConverter}}" /> | |||
</StackPanel> | |||
</Grid> | |||
</ControlTemplate> | |||
</RadioButton.Template> | |||
</RadioButton> | |||
</DataTemplate> | |||
</ItemsControl.ItemTemplate> | |||
</ItemsControl> | |||
</ScrollViewer> | |||
</Grid> | |||
<Button | |||
Grid.Row="3" | |||
Width="150" | |||
Height="35" | |||
Command="{Binding CancelCommand}" | |||
Content="取消" | |||
FontSize="20" | |||
Style="{StaticResource ControlButtonStyle}"> | |||
<Button.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.png" Stretch="Fill" /> | |||
</Button.Background> | |||
</Button> | |||
</Grid> | |||
</Grid> | |||
</Window> |
@@ -0,0 +1,29 @@ | |||
using BPA.Helper; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using System.Windows; | |||
using System.Windows.Controls; | |||
using System.Windows.Data; | |||
using System.Windows.Documents; | |||
using System.Windows.Input; | |||
using System.Windows.Media; | |||
using System.Windows.Media.Imaging; | |||
using System.Windows.Shapes; | |||
namespace BPASmartClient.SmallBatchingSystem.Views | |||
{ | |||
/// <summary> | |||
/// GrindArenaceousView.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class GrindArenaceousView : Window | |||
{ | |||
public GrindArenaceousView() | |||
{ | |||
InitializeComponent(); | |||
ActionManage.GetInstance.Register(new Action(() => { App.Current.Dispatcher.Invoke(() => { this.Close(); }); }), "GrindArenaceousCancel", true); | |||
} | |||
} | |||
} |
@@ -20,90 +20,6 @@ | |||
<vm:NewOutletViewModel /> | |||
</Window.DataContext> | |||
<Window.Resources> | |||
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" /> | |||
<SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" /> | |||
<!--<SolidColorBrush x:Key="bordColor" Color="#33ffffff" />--> | |||
<SolidColorBrush x:Key="bordColor" Color="#332AB2E7" /> | |||
<con:DataTableRedundantConverter x:Key="tabConvert" /> | |||
<Style x:Key="TextBlockStyle" TargetType="TextBlock"> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="HorizontalAlignment" Value="Right" /> | |||
<Setter Property="Foreground" Value="{StaticResource FontColor}" /> | |||
<Setter Property="FontSize" Value="20" /> | |||
</Style> | |||
<Style x:Key="TextBoxStyle" TargetType="TextBox"> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontSize" Value="22" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Width" Value="188" /> | |||
<Setter Property="Padding" Value="6,0,0,0" /> | |||
<Setter Property="Height" Value="37" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="Foreground" Value="{StaticResource PoupTextblockColor}" /> | |||
<Setter Property="BorderBrush" Value="{StaticResource PoupTextblockColor}" /> | |||
<Setter Property="CaretBrush" Value="{StaticResource PoupTextblockColor}" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Background"> | |||
<Setter.Value> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/textBox.png" Stretch="Fill" /> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="ControlButtonStyle" TargetType="Button"> | |||
<Setter Property="Margin" Value="0" /> | |||
<Setter Property="FontSize" Value="18" /> | |||
<Setter Property="Foreground" Value="#FFF53F62" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="Button"> | |||
<Border | |||
Name="TitleBarBr" | |||
BorderBrush="#00c2f4" | |||
BorderThickness="0" | |||
CornerRadius="0" | |||
Opacity="0.8"> | |||
<ContentPresenter | |||
Margin="{TemplateBinding Margin}" | |||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | |||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||
<Border.Background> | |||
<ImageBrush | |||
ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png" | |||
Opacity="0.8" | |||
Stretch="Fill" /> | |||
</Border.Background> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter TargetName="TitleBarBr" Property="Opacity" Value="1" /> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="TitleTextblockStyle" TargetType="TextBlock"> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Foreground" Value="{StaticResource tabColor}" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
</Style> | |||
</Window.Resources> | |||
<Grid> | |||
<Grid.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/容器边框.png" /> | |||
@@ -20,104 +20,6 @@ | |||
<vm:NewRecipeViewModel /> | |||
</Window.DataContext> | |||
<Window.Resources> | |||
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" /> | |||
<SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" /> | |||
<!--<SolidColorBrush x:Key="bordColor" Color="#33ffffff" />--> | |||
<SolidColorBrush x:Key="bordColor" Color="#332AB2E7" /> | |||
<con:DataTableRedundantConverter x:Key="tabConvert" /> | |||
<Style x:Key="TextBlockStyle" TargetType="TextBlock"> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="HorizontalAlignment" Value="Right" /> | |||
<Setter Property="Foreground" Value="{StaticResource FontColor}" /> | |||
<Setter Property="FontSize" Value="20" /> | |||
</Style> | |||
<Style x:Key="TextBoxStyle" TargetType="TextBox"> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontSize" Value="22" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Width" Value="188" /> | |||
<Setter Property="Padding" Value="6,0,0,0" /> | |||
<Setter Property="Height" Value="37" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="Foreground" Value="{StaticResource PoupTextblockColor}" /> | |||
<Setter Property="BorderBrush" Value="{StaticResource PoupTextblockColor}" /> | |||
<Setter Property="CaretBrush" Value="{StaticResource PoupTextblockColor}" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Background"> | |||
<Setter.Value> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/textBox.png" Stretch="Fill" /> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="ControlButtonStyle" TargetType="Button"> | |||
<Setter Property="Margin" Value="0" /> | |||
<Setter Property="FontSize" Value="18" /> | |||
<Setter Property="Foreground" Value="#FFF53F62" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="Button"> | |||
<Border | |||
Name="TitleBarBr" | |||
BorderBrush="#00c2f4" | |||
BorderThickness="0" | |||
CornerRadius="0" | |||
Opacity="0.8"> | |||
<ContentPresenter | |||
Margin="{TemplateBinding Margin}" | |||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | |||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||
<Border.Background> | |||
<ImageBrush | |||
ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png" | |||
Opacity="0.8" | |||
Stretch="Fill" /> | |||
</Border.Background> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter TargetName="TitleBarBr" Property="Opacity" Value="1" /> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="TitleTextblockStyle" TargetType="TextBlock"> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Foreground" Value="{StaticResource tabColor}" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
</Style> | |||
<Style x:Key="InputTextboxStyle" TargetType="TextBox"> | |||
<Setter Property="Margin" Value="5,0,0,0" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="HorizontalAlignment" Value="Left" /> | |||
<Setter Property="Width" Value="150" /> | |||
<Setter Property="Height" Value="40" /> | |||
<Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="FontSize" Value="14" /> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
</Style> | |||
</Window.Resources> | |||
<Grid> | |||
<Grid.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/容器边框.png" /> | |||
@@ -19,37 +19,6 @@ | |||
<vm:NewSiloViewModel /> | |||
</Window.DataContext> | |||
<Window.Resources> | |||
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" /> | |||
<Style x:Key="TextBlockStyle" TargetType="TextBlock"> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="HorizontalAlignment" Value="Right" /> | |||
<Setter Property="Foreground" Value="{StaticResource FontColor}" /> | |||
<Setter Property="FontSize" Value="20" /> | |||
</Style> | |||
<Style x:Key="TextBoxStyle" TargetType="TextBox"> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontSize" Value="22" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Width" Value="188" /> | |||
<Setter Property="Padding" Value="6,0,0,0" /> | |||
<Setter Property="Height" Value="37" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="Foreground" Value="{StaticResource PoupTextblockColor}" /> | |||
<Setter Property="BorderBrush" Value="{StaticResource PoupTextblockColor}" /> | |||
<Setter Property="CaretBrush" Value="{StaticResource PoupTextblockColor}" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Background"> | |||
<Setter.Value> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/textBox.png" Stretch="Fill" /> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
</Window.Resources> | |||
<Grid> | |||
<Grid.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/容器边框.png" /> | |||
@@ -16,140 +16,6 @@ | |||
<vm:OutletManagementViewModel /> | |||
</UserControl.DataContext> | |||
<UserControl.Resources> | |||
<SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" /> | |||
<!--<SolidColorBrush x:Key="bordColor" Color="#33ffffff" />--> | |||
<SolidColorBrush x:Key="bordColor" Color="#332AB2E7" /> | |||
<con:DataTableRedundantConverter x:Key="tabConvert" /> | |||
<Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem"> | |||
<Style.Resources> | |||
<!-- SelectedItem with focus --> | |||
<SolidColorBrush | |||
x:Key="{x:Static SystemColors.HighlightBrushKey}" | |||
Opacity=".4" | |||
Color="White" /> | |||
<!-- SelectedItem without focus --> | |||
<SolidColorBrush | |||
x:Key="{x:Static SystemColors.ControlBrushKey}" | |||
Opacity=".4" | |||
Color="White" /> | |||
</Style.Resources> | |||
<!-- 设置触发器 --> | |||
<Style.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter Property="Background" Value="White" /> | |||
<Setter Property="Foreground" Value="White" /> | |||
</Trigger> | |||
<Trigger Property="IsFocused" Value="true"> | |||
<Setter Property="Background" Value="White" /> | |||
<Setter Property="Foreground" Value="White" /> | |||
</Trigger> | |||
</Style.Triggers> | |||
</Style> | |||
<Style x:Key="RowRadioButtonStyle" TargetType="{x:Type RadioButton}"> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type RadioButton}"> | |||
<Border | |||
x:Name="NvaBor" | |||
Background="Transparent" | |||
BorderBrush="#FF2AB2E7" | |||
BorderThickness="0"> | |||
<ContentControl | |||
Margin="10,4" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
HorizontalContentAlignment="Center" | |||
VerticalContentAlignment="Center" | |||
Content="{TemplateBinding Content}" | |||
FontSize="16" /> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsChecked" Value="True"> | |||
<Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" /> | |||
<Setter TargetName="NvaBor" Property="BorderThickness" Value="0" /> | |||
</Trigger> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="IsChecked" Value="false" /> | |||
<Condition Property="IsMouseOver" Value="True" /> | |||
</MultiTrigger.Conditions> | |||
<MultiTrigger.Setters> | |||
<Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" /> | |||
</MultiTrigger.Setters> | |||
</MultiTrigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="InputTextboxStyle" TargetType="TextBox"> | |||
<Setter Property="Margin" Value="5,0,0,0" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="HorizontalAlignment" Value="Left" /> | |||
<Setter Property="Width" Value="150" /> | |||
<Setter Property="Height" Value="40" /> | |||
<Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="FontSize" Value="14" /> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
</Style> | |||
<Style x:Key="ControlButtonStyle" TargetType="Button"> | |||
<Setter Property="Margin" Value="0" /> | |||
<Setter Property="FontSize" Value="18" /> | |||
<Setter Property="Foreground" Value="#FFF53F62" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="Button"> | |||
<Border | |||
Name="TitleBarBr" | |||
BorderBrush="#00c2f4" | |||
BorderThickness="0" | |||
CornerRadius="0" | |||
Opacity="0.8"> | |||
<ContentPresenter | |||
Margin="{TemplateBinding Margin}" | |||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | |||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||
<Border.Background> | |||
<ImageBrush | |||
ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png" | |||
Opacity="0.8" | |||
Stretch="Fill" /> | |||
</Border.Background> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter TargetName="TitleBarBr" Property="Opacity" Value="1" /> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="TitleTextblockStyle" TargetType="TextBlock"> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Foreground" Value="{StaticResource tabColor}" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
</Style> | |||
</UserControl.Resources> | |||
<Grid Margin="10"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="40" /> | |||
@@ -16,295 +16,16 @@ | |||
<vm:RecipeControlViewModel /> | |||
</UserControl.DataContext> | |||
<UserControl.Resources> | |||
<!--<con:RunStatusConvert x:Key="RunStatusConvert" /> | |||
<con:EnbleConvert x:Key="EnbleConvert" /> | |||
<con:IntToSourceConvert x:Key="IntToSourceConvert" />--> | |||
<Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem"> | |||
<Style.Resources> | |||
<!-- SelectedItem with focus --> | |||
<SolidColorBrush | |||
x:Key="{x:Static SystemColors.HighlightBrushKey}" | |||
Opacity=".4" | |||
Color="White" /> | |||
<!-- SelectedItem without focus --> | |||
<SolidColorBrush | |||
x:Key="{x:Static SystemColors.ControlBrushKey}" | |||
Opacity=".4" | |||
Color="White" /> | |||
</Style.Resources> | |||
<!-- 设置触发器 --> | |||
<Style.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter Property="Background" Value="White" /> | |||
<Setter Property="Foreground" Value="White" /> | |||
</Trigger> | |||
<Trigger Property="IsFocused" Value="true"> | |||
<Setter Property="Background" Value="White" /> | |||
<Setter Property="Foreground" Value="White" /> | |||
</Trigger> | |||
</Style.Triggers> | |||
</Style> | |||
<Style x:Key="RadioState" TargetType="RadioButton"> | |||
<Setter Property="Margin" Value="1" /> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="Foreground" Value="#ddd" /> | |||
<Setter Property="VerticalContentAlignment" Value="Bottom" /> | |||
<Setter Property="Margin" Value="2,5" /> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="FontFamily" Value="Consolas" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="RadioButton"> | |||
<Border | |||
Name="radiobutton" | |||
Background="{TemplateBinding Background}" | |||
CornerRadius="5" | |||
Opacity="0.85"> | |||
<Grid> | |||
<ContentPresenter | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Content="{TemplateBinding Content}" | |||
TextBlock.FontFamily="{TemplateBinding FontFamily}" | |||
TextBlock.FontSize="{TemplateBinding FontSize}" | |||
TextBlock.Foreground="{TemplateBinding Foreground}" /> | |||
<Image | |||
Name="im" | |||
Source="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png" | |||
Stretch="Fill" /> | |||
</Grid> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsChecked" Value="True"> | |||
<!--<Setter TargetName="back_border" Property="BorderThickness" Value="1,0,1,1" /> | |||
<Setter TargetName="back_border" Property="CornerRadius" Value="5" /> | |||
<Setter TargetName="fore_border" Property="BorderThickness" Value="0,2,0,0" /> | |||
<Setter Property="Background" Value=" #4169E1" />--> | |||
<Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 7.png" /> | |||
</Trigger> | |||
<Trigger Property="IsChecked" Value="False"> | |||
<Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png" /> | |||
</Trigger> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<!--<Setter TargetName="back_border" Property="BorderBrush" Value="white" /> | |||
<Setter TargetName="back_border" Property="BorderThickness" Value="1,1,1,1" />--> | |||
<Setter TargetName="radiobutton" Property="Opacity" Value="1" /> | |||
<!--<Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮背景蓝色.png" />--> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="materialMakingButton" TargetType="Button"> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="Foreground" Value="#CD5555" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="HorizontalAlignment" Value="Left" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate> | |||
<Border | |||
x:Name="brState" | |||
Padding="2" | |||
BorderBrush="White" | |||
BorderThickness="0"> | |||
<TextBlock | |||
x:Name="txState" | |||
Margin="1" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding RecipeStatus, Converter={StaticResource RunStatusConvert}}" /> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsEnabled" Value="True"> | |||
<Setter TargetName="brState" Property="BorderThickness" Value="0" /> | |||
<Setter TargetName="brState" Property="CornerRadius" Value="5" /> | |||
<Setter TargetName="brState" Property="Background" Value="#F0FFFF" /> | |||
<Setter TargetName="txState" Property="Foreground" Value="#CD5555" /> | |||
</Trigger> | |||
<DataTrigger Binding="{Binding RecipeStatus}" Value="3"> | |||
<Setter TargetName="brState" Property="Background" Value="#F0FFFF" /> | |||
<Setter TargetName="txState" Property="Foreground" Value="#3CB371" /> | |||
</DataTrigger> | |||
<DataTrigger Binding="{Binding RecipeStatus}" Value="2"> | |||
<Setter TargetName="txState" Property="Foreground" Value="Aqua" /> | |||
</DataTrigger> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="IsMouseOver" Value="True" /> | |||
<Condition Property="IsEnabled" Value="True" /> | |||
</MultiTrigger.Conditions> | |||
<Setter TargetName="txState" Property="FontSize" Value="17 " /> | |||
</MultiTrigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
<Style.Triggers /> | |||
</Style> | |||
<DataTemplate x:Key="TreeItemTemplate" DataType="TreeViewItem"> | |||
<Grid Height="28" Margin="50,0,0,0"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="*" /> | |||
<ColumnDefinition Width="*" /> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock | |||
Margin="10,0" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Center" | |||
FontSize="15" | |||
Foreground="#aa2AB2E7" | |||
Text="原料:" /> | |||
<TextBlock | |||
Grid.Column="1" | |||
Margin="10,0" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Center" | |||
FontSize="15" | |||
Foreground="#aa2AB2E7" | |||
Text="{Binding RawMaterialName}" /> | |||
</Grid> | |||
</DataTemplate> | |||
<Style x:Key="recipeTreeItem" TargetType="TreeViewItem"> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="IsExpanded" Value="True" /> | |||
<Setter Property="HeaderTemplate"> | |||
<Setter.Value> | |||
<HierarchicalDataTemplate ItemTemplate="{StaticResource TreeItemTemplate}" ItemsSource="{Binding RawMaterials, Mode=TwoWay}"> | |||
<StackPanel | |||
Height="28" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Center" | |||
Orientation="Horizontal"> | |||
<TextBlock | |||
Margin="5,0,0,0" | |||
VerticalAlignment="Center" | |||
FontSize="15" | |||
Foreground="#FF2AB2E7" | |||
Text="配方:" /> | |||
<TextBlock | |||
Margin="5,0,0,0" | |||
VerticalAlignment="Center" | |||
FontSize="15" | |||
Foreground="#FF2AB2E7" | |||
Text="{Binding RecipeName}" /> | |||
</StackPanel> | |||
</HierarchicalDataTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type TreeViewItem}"> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="Auto" /> | |||
<ColumnDefinition Width="*" /> | |||
</Grid.ColumnDefinitions> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="Auto" /> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<Border | |||
x:Name="Bd" | |||
Grid.Column="0" | |||
Padding="{TemplateBinding Padding}" | |||
Background="{TemplateBinding Background}" | |||
BorderBrush="{TemplateBinding BorderBrush}" | |||
BorderThickness="{TemplateBinding BorderThickness}"> | |||
<ContentPresenter | |||
x:Name="PART_Header" | |||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | |||
ContentSource="Header" /> | |||
</Border> | |||
<ItemsPresenter | |||
x:Name="ItemsHost" | |||
Grid.Row="1" | |||
Grid.Column="0" | |||
Grid.ColumnSpan="2" | |||
Visibility="Collapsed" /> | |||
<VisualStateManager.VisualStateGroups> | |||
<VisualStateGroup x:Name="SelectionStates"> | |||
<VisualState x:Name="Selected"> | |||
<Storyboard> | |||
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"> | |||
<EasingColorKeyFrame KeyTime="0" Value="Transparent" /> | |||
</ColorAnimationUsingKeyFrames> | |||
</Storyboard> | |||
</VisualState> | |||
<VisualState x:Name="Unselected" /> | |||
<VisualState x:Name="SelectedInactive"> | |||
<Storyboard> | |||
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"> | |||
<EasingColorKeyFrame KeyTime="0" Value="Transparent" /> | |||
</ColorAnimationUsingKeyFrames> | |||
</Storyboard> | |||
</VisualState> | |||
</VisualStateGroup> | |||
<VisualStateGroup x:Name="ExpansionStates"> | |||
<VisualState x:Name="Expanded"> | |||
<Storyboard> | |||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="(UIElement.Visibility)"> | |||
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" /> | |||
</ObjectAnimationUsingKeyFrames> | |||
</Storyboard> | |||
</VisualState> | |||
<VisualState x:Name="Collapsed" /> | |||
</VisualStateGroup> | |||
</VisualStateManager.VisualStateGroups> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="HasHeader" Value="false" /> | |||
<Condition Property="Width" Value="Auto" /> | |||
</MultiTrigger.Conditions> | |||
<Setter TargetName="PART_Header" Property="MinWidth" Value="75" /> | |||
</MultiTrigger> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="HasHeader" Value="false" /> | |||
<Condition Property="Height" Value="Auto" /> | |||
</MultiTrigger.Conditions> | |||
<Setter TargetName="PART_Header" Property="MinHeight" Value="19" /> | |||
</MultiTrigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
</UserControl.Resources> | |||
<Grid Margin="20"> | |||
<Grid.ColumnDefinitions> | |||
<!--<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition Width="0.25*" /> | |||
</Grid.ColumnDefinitions> | |||
</Grid.ColumnDefinitions>--> | |||
<Grid Name="ggr" Margin="10"> | |||
<pry:ImageBorder Width="{Binding ElementName=ggr, Path=ActualWidth}" Height="{Binding ElementName=ggr, Path=ActualHeight}" /> | |||
<!--<pry:ImageBorder Width="{Binding ElementName=ggr, Path=ActualWidth}" Height="{Binding ElementName=ggr, Path=ActualHeight}" />--> | |||
<ListBox | |||
Margin="5" | |||
@@ -318,7 +39,7 @@ | |||
<UniformGrid | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Top" | |||
Columns="6" /> | |||
Columns="8" /> | |||
</ItemsPanelTemplate> | |||
</ListBox.ItemsPanel> | |||
@@ -16,140 +16,6 @@ | |||
<vm:RecipeViewModel /> | |||
</UserControl.DataContext> | |||
<UserControl.Resources> | |||
<SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" /> | |||
<!--<SolidColorBrush x:Key="bordColor" Color="#33ffffff" />--> | |||
<SolidColorBrush x:Key="bordColor" Color="#332AB2E7" /> | |||
<con:DataTableRedundantConverter x:Key="tabConvert" /> | |||
<Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem"> | |||
<Style.Resources> | |||
<!-- SelectedItem with focus --> | |||
<SolidColorBrush | |||
x:Key="{x:Static SystemColors.HighlightBrushKey}" | |||
Opacity=".4" | |||
Color="White" /> | |||
<!-- SelectedItem without focus --> | |||
<SolidColorBrush | |||
x:Key="{x:Static SystemColors.ControlBrushKey}" | |||
Opacity=".4" | |||
Color="White" /> | |||
</Style.Resources> | |||
<!-- 设置触发器 --> | |||
<Style.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter Property="Background" Value="White" /> | |||
<Setter Property="Foreground" Value="White" /> | |||
</Trigger> | |||
<Trigger Property="IsFocused" Value="true"> | |||
<Setter Property="Background" Value="White" /> | |||
<Setter Property="Foreground" Value="White" /> | |||
</Trigger> | |||
</Style.Triggers> | |||
</Style> | |||
<Style x:Key="RowRadioButtonStyle" TargetType="{x:Type RadioButton}"> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type RadioButton}"> | |||
<Border | |||
x:Name="NvaBor" | |||
Background="Transparent" | |||
BorderBrush="#FF2AB2E7" | |||
BorderThickness="0"> | |||
<ContentControl | |||
Margin="10,4" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
HorizontalContentAlignment="Center" | |||
VerticalContentAlignment="Center" | |||
Content="{TemplateBinding Content}" | |||
FontSize="16" /> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsChecked" Value="True"> | |||
<Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" /> | |||
<Setter TargetName="NvaBor" Property="BorderThickness" Value="0" /> | |||
</Trigger> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="IsChecked" Value="false" /> | |||
<Condition Property="IsMouseOver" Value="True" /> | |||
</MultiTrigger.Conditions> | |||
<MultiTrigger.Setters> | |||
<Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" /> | |||
</MultiTrigger.Setters> | |||
</MultiTrigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="InputTextboxStyle" TargetType="TextBox"> | |||
<Setter Property="Margin" Value="5,0,0,0" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="HorizontalAlignment" Value="Left" /> | |||
<Setter Property="Width" Value="150" /> | |||
<Setter Property="Height" Value="40" /> | |||
<Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="FontSize" Value="14" /> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
</Style> | |||
<Style x:Key="ControlButtonStyle" TargetType="Button"> | |||
<Setter Property="Margin" Value="0" /> | |||
<Setter Property="FontSize" Value="18" /> | |||
<Setter Property="Foreground" Value="#FFF53F62" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="Button"> | |||
<Border | |||
Name="TitleBarBr" | |||
BorderBrush="#00c2f4" | |||
BorderThickness="0" | |||
CornerRadius="0" | |||
Opacity="0.8"> | |||
<ContentPresenter | |||
Margin="{TemplateBinding Margin}" | |||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | |||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||
<Border.Background> | |||
<ImageBrush | |||
ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png" | |||
Opacity="0.8" | |||
Stretch="Fill" /> | |||
</Border.Background> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter TargetName="TitleBarBr" Property="Opacity" Value="1" /> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="TitleTextblockStyle" TargetType="TextBlock"> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Foreground" Value="{StaticResource tabColor}" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
</Style> | |||
</UserControl.Resources> | |||
<Grid Margin="10"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="40" /> | |||
@@ -16,140 +16,6 @@ | |||
<vm:SiloManagementViewModel /> | |||
</UserControl.DataContext> | |||
<UserControl.Resources> | |||
<SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" /> | |||
<!--<SolidColorBrush x:Key="bordColor" Color="#33ffffff" />--> | |||
<SolidColorBrush x:Key="bordColor" Color="#332AB2E7" /> | |||
<con:DataTableRedundantConverter x:Key="tabConvert" /> | |||
<Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem"> | |||
<Style.Resources> | |||
<!-- SelectedItem with focus --> | |||
<SolidColorBrush | |||
x:Key="{x:Static SystemColors.HighlightBrushKey}" | |||
Opacity=".4" | |||
Color="White" /> | |||
<!-- SelectedItem without focus --> | |||
<SolidColorBrush | |||
x:Key="{x:Static SystemColors.ControlBrushKey}" | |||
Opacity=".4" | |||
Color="White" /> | |||
</Style.Resources> | |||
<!-- 设置触发器 --> | |||
<Style.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter Property="Background" Value="White" /> | |||
<Setter Property="Foreground" Value="White" /> | |||
</Trigger> | |||
<Trigger Property="IsFocused" Value="true"> | |||
<Setter Property="Background" Value="White" /> | |||
<Setter Property="Foreground" Value="White" /> | |||
</Trigger> | |||
</Style.Triggers> | |||
</Style> | |||
<Style x:Key="RowRadioButtonStyle" TargetType="{x:Type RadioButton}"> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type RadioButton}"> | |||
<Border | |||
x:Name="NvaBor" | |||
Background="Transparent" | |||
BorderBrush="#FF2AB2E7" | |||
BorderThickness="0"> | |||
<ContentControl | |||
Margin="10,4" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
HorizontalContentAlignment="Center" | |||
VerticalContentAlignment="Center" | |||
Content="{TemplateBinding Content}" | |||
FontSize="16" /> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsChecked" Value="True"> | |||
<Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" /> | |||
<Setter TargetName="NvaBor" Property="BorderThickness" Value="0" /> | |||
</Trigger> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="IsChecked" Value="false" /> | |||
<Condition Property="IsMouseOver" Value="True" /> | |||
</MultiTrigger.Conditions> | |||
<MultiTrigger.Setters> | |||
<Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" /> | |||
</MultiTrigger.Setters> | |||
</MultiTrigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="InputTextboxStyle" TargetType="TextBox"> | |||
<Setter Property="Margin" Value="5,0,0,0" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="HorizontalAlignment" Value="Left" /> | |||
<Setter Property="Width" Value="150" /> | |||
<Setter Property="Height" Value="40" /> | |||
<Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="FontSize" Value="14" /> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
</Style> | |||
<Style x:Key="ControlButtonStyle" TargetType="Button"> | |||
<Setter Property="Margin" Value="0" /> | |||
<Setter Property="FontSize" Value="18" /> | |||
<Setter Property="Foreground" Value="#FFF53F62" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="Button"> | |||
<Border | |||
Name="TitleBarBr" | |||
BorderBrush="#00c2f4" | |||
BorderThickness="0" | |||
CornerRadius="0" | |||
Opacity="0.8"> | |||
<ContentPresenter | |||
Margin="{TemplateBinding Margin}" | |||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | |||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||
<Border.Background> | |||
<ImageBrush | |||
ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png" | |||
Opacity="0.8" | |||
Stretch="Fill" /> | |||
</Border.Background> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter TargetName="TitleBarBr" Property="Opacity" Value="1" /> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="TitleTextblockStyle" TargetType="TextBlock"> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Foreground" Value="{StaticResource tabColor}" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
</Style> | |||
</UserControl.Resources> | |||
<Grid Margin="10"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="40" /> | |||
@@ -6,20 +6,20 @@ | |||
<!--<add key="ClientId" value="43"/>--> | |||
<add key="IsEnableTest" value="false"/> | |||
<!--测试环境--><!-- | |||
<add key="apollouri" value="http://10.2.1.21:28080/"/> | |||
<!--测试环境--> | |||
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/> | |||
<add key="AppId" value="test1_HostComputer"/> | |||
<add key ="Namespaces" value="DEV.test1.Config"/>--> | |||
<!--开发环境--> | |||
<!--<add key="apollouri" value="http://47.108.65.220:28080/"/> | |||
<add key="apollouri" value="http://10.2.1.21:28080/"/> | |||
<add key="AppId" value="HostComputer"/> | |||
<add key ="Namespaces" value="DEV.Config"/>--> | |||
<add key ="Namespaces" value="DEV.Config"/> | |||
<!--正式环境--> | |||
<add key="apollouri" value="http://47.108.65.220:28080/"/> | |||
<!--正式环境--> | |||
<!--<add key="apollouri" value="http://47.108.65.220:28080/"/> | |||
<add key="appid" value="hostcomputer"/> | |||
<add key ="namespaces" value="test1.config"/> | |||
<add key ="namespaces" value="test1.config"/>--> | |||
<!--阿里云上报启动方式:API 或者 LOCAL--> | |||
<!--API :通过客户端ID,调用接口查询“设备连接信息”--> | |||