@@ -0,0 +1,171 @@ | |||||
using BPA.Message.Enum; | |||||
using BPASmartClient.Device; | |||||
using BPASmartClient.MorkCL.Model.Json; | |||||
using BPASmartClient.MorkCL.Server; | |||||
using SqlSugar; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.MorkCL | |||||
{ | |||||
public class Control_MorkCL : BaseDevice | |||||
{ | |||||
public override DeviceClientType DeviceType => DeviceClientType.MORKCL; | |||||
GVL_MorkCL morkCL = new GVL_MorkCL(); | |||||
Alarm alarm = new Alarm(); | |||||
/// <summary> | |||||
/// 设备信息集合 | |||||
/// </summary> | |||||
ConcurrentDictionary<EDeviceType, IModbus> devices { get; set; } = new(); | |||||
/// <summary> | |||||
/// 任务集合 | |||||
/// </summary> | |||||
ConcurrentDictionary<EDeviceType, TaskServer> TaskList { get; set; } = new(); | |||||
public override void DoMain() | |||||
{ | |||||
MonitorViewModel.DeviceId = DeviceId; | |||||
//注册本地配方接收 | |||||
ActionManage.GetInstance.Register(new Action<object>(o => | |||||
{ | |||||
if (o != null && o is ControlData cd) morkCL.cds.Enqueue(cd); | |||||
}), NotifyTopic.FormulaDistribution); | |||||
//初始化通讯对象 | |||||
devices.TryAdd(EDeviceType.炒锅1, new FryingPanServer()); | |||||
devices.TryAdd(EDeviceType.炒锅2, new FryingPanServer()); | |||||
devices.TryAdd(EDeviceType.机器人, new RobotServer()); | |||||
devices.TryAdd(EDeviceType.压力锅, new PressureCookerServer()); | |||||
devices.TryAdd(EDeviceType.外部设备, new OtherServer()); | |||||
devices[EDeviceType.炒锅1].Init(ConnectPar.FryingPanIP1); | |||||
devices[EDeviceType.炒锅2].Init(ConnectPar.FryingPanIP2); | |||||
devices[EDeviceType.机器人].Init(ConnectPar.RobotIP); | |||||
devices[EDeviceType.压力锅].Init(ConnectPar.PressureCookerIP); | |||||
devices[EDeviceType.外部设备].Init(ConnectPar.PPortName); | |||||
#region 读取本地文件数据 | |||||
Json<RecipesInfo>.Read(); | |||||
Json<ItemStroageInfo>.Read(); | |||||
#endregion | |||||
} | |||||
public override void MainTask() | |||||
{ | |||||
if (morkCL.cds.Count > 0 && !TaskList.ContainsKey(morkCL.cds.ElementAt(0).DeviceType)) | |||||
{ | |||||
if (morkCL.cds.TryDequeue(out ControlData cd)) | |||||
{ | |||||
TaskList.TryAdd(cd.DeviceType, new TaskServer()); | |||||
TaskList[cd.DeviceType].TaskName = $"{cd.DeviceType.ToString()}-{cd.Name}"; | |||||
TaskList[cd.DeviceType].RunTask = new Task(new Action(() => { FryingPanControl(cd.DeviceType, cd); })); | |||||
TaskList[cd.DeviceType].RunTask.Start(); | |||||
} | |||||
} | |||||
//检查到有任务完成后将对已完成的任务进行清理 | |||||
var res = TaskList.FirstOrDefault(p => p.Value.IsComplete).Key; | |||||
if (TaskList.ContainsKey(res)) TaskList.TryRemove(res, out _); | |||||
} | |||||
private void FryingPanControl(EDeviceType et, ControlData cd) | |||||
{ | |||||
DeviceProcessLogShow($"开始执行-{cd.Name} 任务"); | |||||
if (TaskList.ContainsKey(et) && TaskList[et].Cts.IsCancellationRequested) return; | |||||
while (cd.ControlFuncs.Count > 0) | |||||
{ | |||||
if (cd.ControlFuncs.TryDequeue(out FuncModel fm)) | |||||
{ | |||||
var device = (FryingPanServer)devices[et]; | |||||
var robot = (RobotServer)devices[EDeviceType.机器人]; | |||||
int index = (ushort)et - 1; | |||||
DeviceProcessLogShow($"{cd.Name}-任务执行-{fm.eFunc.ToString()}-步骤"); | |||||
switch (fm.eFunc) | |||||
{ | |||||
case EFunc.搅拌启动: | |||||
device.MixingFrequencySet(fm.funcPars.ElementAt(0).ParValue); | |||||
device.StirStartOrStop = true; | |||||
break; | |||||
case EFunc.搅拌停止: | |||||
device.StirStartOrStop = false; | |||||
break; | |||||
case EFunc.加热启动: | |||||
device.HeatingGearSet(fm.funcPars.ElementAt(0).ParValue); | |||||
device.HeatStartOrStop = true; | |||||
break; | |||||
case EFunc.加热停止: | |||||
device.HeatStartOrStop = false; | |||||
break; | |||||
case EFunc.添加调料: | |||||
var Seasoning = SqliteHelper.GetInstance.GetSeasoning().FirstOrDefault(p => p.Id == fm.funcPars.ElementAt(0).Id); | |||||
if (Seasoning != null) | |||||
{ | |||||
device.CuttingControl(Seasoning.Loc.ToString(), fm.funcPars.ElementAt(1).ParValue); | |||||
} | |||||
break; | |||||
case EFunc.添加主料: | |||||
case EFunc.添加辅料: | |||||
MaterialBase mb = new MaterialBase(); | |||||
if (fm.eFunc == EFunc.添加辅料) | |||||
mb = SqliteHelper.GetInstance.GetAccessories().FirstOrDefault(p => p.Id == fm.funcPars.ElementAt(0).Id); | |||||
else mb = SqliteHelper.GetInstance.GetIngredients().FirstOrDefault(p => p.Id == fm.funcPars.ElementAt(0).Id); | |||||
robot.RobotTaskControl(mb.Loc.ToString(), et); | |||||
device.FeedingLocFB.Wait(Cts: TaskList[et].Cts);//等待炒锅到投料位置 | |||||
robot.MaterialPouringRequest[index].Wait(Cts: TaskList[et].Cts); //等待机器人到投料位置 | |||||
robot.AllowPourVegetables(et);//允许机器人开始投料 | |||||
robot.MaterialPouringComplete[index].Wait(Cts: TaskList[et].Cts); //等待机器人投料完成 | |||||
break; | |||||
case EFunc.炒锅回原点位: | |||||
device.FryingPanHome = true; | |||||
break; | |||||
case EFunc.出餐启动: | |||||
robot.RobotTaskControl("1", et);//取空盆 | |||||
robot.DiningOutRequest[index].Wait(Cts: TaskList[et].Cts);//等待机器人到出菜位置 | |||||
device.DiningOutStart = true; | |||||
break; | |||||
case EFunc.炒锅清洗: | |||||
device.FryingPanClear = true; | |||||
break; | |||||
case EFunc.炒锅回投料位置: | |||||
device.FryingPanFeedingLoc = true; | |||||
break; | |||||
case EFunc.去指定炒制位: | |||||
device.SetStirFryingLoc(fm.funcPars.ElementAt(0).ParValue); | |||||
break; | |||||
case EFunc.炒制: | |||||
if (int.TryParse(fm.funcPars.ElementAt(0).ParValue, out int time)) | |||||
Task.Delay(time * 1000).Wait(TaskList[et].Cts.Token); | |||||
break; | |||||
default: | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
public override void ReadData() | |||||
{ | |||||
} | |||||
public override void ResetProgram() | |||||
{ | |||||
morkCL = null; | |||||
morkCL = new GVL_MorkCL(); | |||||
} | |||||
public override void SimOrder() | |||||
{ | |||||
} | |||||
public override void Stop() | |||||
{ | |||||
} | |||||
} | |||||
} |
@@ -23,6 +23,7 @@ namespace BPASmartClient.MorkCL.Model | |||||
/// <summary> | /// <summary> | ||||
/// 描述 | /// 描述 | ||||
/// </summary> | /// </summary> | ||||
[SugarColumn(IsNullable =true)] | |||||
public string Description { get; set; } | public string Description { get; set; } | ||||
/// <summary> | /// <summary> |
@@ -0,0 +1,59 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.MorkCL.Model | |||||
{ | |||||
/// <summary> | |||||
/// 库位状态。 | |||||
/// </summary> | |||||
public class ItemStroage : NotifyBase | |||||
{ | |||||
private bool isEmploy; | |||||
private string materialID; | |||||
private string name; | |||||
private float weight; | |||||
private object lockobj=new object(); | |||||
/// <summary> | |||||
/// 库位位置。 | |||||
/// </summary> | |||||
//public string ID { get; set; } | |||||
/// <summary> | |||||
/// 物料ID | |||||
/// </summary> | |||||
public string MaterialID { get => materialID; set { materialID = value; OnPropertyChanged(); } } | |||||
/// <summary> | |||||
/// 物料名称 | |||||
/// </summary> | |||||
public string Name { get => name; set { name = value;OnPropertyChanged(); } } | |||||
/// <summary> | |||||
/// 是否占用,有物体则为True。反之,为False。 | |||||
/// </summary> | |||||
public bool IsEmploy | |||||
{ | |||||
get => isEmploy; | |||||
set | |||||
{ | |||||
//需要测试是否有问题。 | |||||
lock (lockobj) | |||||
{ | |||||
if (value == false) | |||||
{ | |||||
Weight = 0.0f; | |||||
} | |||||
isEmploy = value; | |||||
OnPropertyChanged(); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 当前重量。 | |||||
/// </summary> | |||||
public float Weight { get => weight; set { weight = value; OnPropertyChanged(); } } | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
namespace BPASmartClient.MorkCL.Model.Json | |||||
{ | |||||
public class ItemStroageInfo | |||||
{ | |||||
/// <summary> | |||||
/// 主料库库位信息。 | |||||
/// </summary> | |||||
public ItemStroage[] IngredientsStorage { get; set; } = new ItemStroage[12] { | |||||
new ItemStroage(), new ItemStroage(), new ItemStroage(), new ItemStroage(), | |||||
new ItemStroage(), new ItemStroage(), new ItemStroage(), new ItemStroage(), | |||||
new ItemStroage(), new ItemStroage(), new ItemStroage(), new ItemStroage() | |||||
}; | |||||
/// <summary> | |||||
/// 辅料库库位信息。 | |||||
/// </summary> | |||||
public ItemStroage[] AccessoriesStorage { get; set; } = new ItemStroage[8] { | |||||
new ItemStroage(),new ItemStroage(),new ItemStroage(),new ItemStroage(),new ItemStroage(),new ItemStroage(),new ItemStroage(),new ItemStroage() | |||||
}; | |||||
} | |||||
} |
@@ -120,6 +120,16 @@ namespace BPASmartClient.MorkCL.Server | |||||
return Db.Queryable<IngredientsTB>().First(p => p.Id == id); | return Db.Queryable<IngredientsTB>().First(p => p.Id == id); | ||||
} | } | ||||
/// <summary> | |||||
/// 查询指定位置是否占用。 | |||||
/// </summary> | |||||
/// <param name="loc"></param> | |||||
/// <returns></returns> | |||||
public bool GetIngredientsInfoByLoc(int loc) | |||||
{ | |||||
return Db.Queryable<IngredientsTB>().Any(p => p.Loc == loc); | |||||
} | |||||
#endregion | #endregion | ||||
@@ -186,6 +196,16 @@ namespace BPASmartClient.MorkCL.Server | |||||
return Db.Queryable<AccessoriesTB>().First(p => p.Id == id); | return Db.Queryable<AccessoriesTB>().First(p => p.Id == id); | ||||
} | } | ||||
/// <summary> | |||||
/// 查询指定位置是否占用。 | |||||
/// </summary> | |||||
/// <param name="loc"></param> | |||||
/// <returns></returns> | |||||
public bool GetAccessoriesInfoByLoc(int loc) | |||||
{ | |||||
return Db.Queryable<AccessoriesTB>().Any(p => p.Loc == loc); | |||||
} | |||||
#endregion | #endregion | ||||
#region 调料数据操作 | #region 调料数据操作 | ||||
@@ -250,6 +270,17 @@ namespace BPASmartClient.MorkCL.Server | |||||
{ | { | ||||
return Db.Queryable<SeasoningTB>().First(p => p.Id == id); | return Db.Queryable<SeasoningTB>().First(p => p.Id == id); | ||||
} | } | ||||
/// <summary> | |||||
/// 查询指定位置是否占用。 | |||||
/// </summary> | |||||
/// <param name="loc"></param> | |||||
/// <returns></returns> | |||||
public bool GetSeasoningInfoByLoc(int loc) | |||||
{ | |||||
return Db.Queryable<SeasoningTB>().Any(p => p.Loc == loc); | |||||
} | |||||
#endregion | #endregion | ||||
@@ -52,12 +52,7 @@ | |||||
Content="新增辅料数据" | Content="新增辅料数据" | ||||
DockPanel.Dock="Right" /> | DockPanel.Dock="Right" /> | ||||
<Button | |||||
Margin="30,0" | |||||
Command="{Binding SaveMaterialInfoCommand}" | |||||
CommandParameter="辅料" | |||||
Content="保存数据" | |||||
DockPanel.Dock="Right" /> | |||||
</DockPanel> | </DockPanel> | ||||
<!--#region 表格标题栏设置--> | <!--#region 表格标题栏设置--> | ||||
<Grid | <Grid | ||||
@@ -66,11 +61,11 @@ | |||||
Background="#ff0C255F"> | Background="#ff0C255F"> | ||||
<Grid.ColumnDefinitions> | <Grid.ColumnDefinitions> | ||||
<ColumnDefinition Width="330"/> | |||||
<ColumnDefinition Width="330" /> | |||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80" /> | |||||
<ColumnDefinition Width="80" /> | |||||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||||
@@ -124,11 +119,11 @@ | |||||
<DataTemplate> | <DataTemplate> | ||||
<Grid Name="gr" Height="30"> | <Grid Name="gr" Height="30"> | ||||
<Grid.ColumnDefinitions> | <Grid.ColumnDefinitions> | ||||
<ColumnDefinition Width="330"/> | |||||
<ColumnDefinition Width="330" /> | |||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80" /> | |||||
<ColumnDefinition Width="80" /> | |||||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||||
<TextBox | <TextBox | ||||
@@ -141,6 +136,7 @@ | |||||
<Grid Grid.Column="1"> | <Grid Grid.Column="1"> | ||||
<TextBox | <TextBox | ||||
MinWidth="150" | MinWidth="150" | ||||
IsReadOnly="True" | |||||
Style="{StaticResource DataShowTextBoxStyle}" | Style="{StaticResource DataShowTextBoxStyle}" | ||||
Text="{Binding Name}" | Text="{Binding Name}" | ||||
TextAlignment="Center" /> | TextAlignment="Center" /> | ||||
@@ -152,11 +148,13 @@ | |||||
<TextBox | <TextBox | ||||
Grid.Column="2" | Grid.Column="2" | ||||
MinWidth="150" Height="30" | |||||
Height="30" | |||||
MinWidth="150" | |||||
IsReadOnly="True" | |||||
Style="{StaticResource DataShowTextBoxStyle}" | Style="{StaticResource DataShowTextBoxStyle}" | ||||
Text="{Binding Loc}" | Text="{Binding Loc}" | ||||
TextAlignment="Center" /> | TextAlignment="Center" /> | ||||
<Grid Grid.Column="3"> | <Grid Grid.Column="3"> | ||||
<Button | <Button | ||||
Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | ||||
@@ -169,7 +167,7 @@ | |||||
BorderThickness="1,0,1,0" | BorderThickness="1,0,1,0" | ||||
Cursor="SizeWE" /> | Cursor="SizeWE" /> | ||||
</Grid> | </Grid> | ||||
<Grid Grid.Column="4"> | <Grid Grid.Column="4"> | ||||
<Button | <Button | ||||
Command="{Binding DataContext.RemoveAccessoryCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | Command="{Binding DataContext.RemoveAccessoryCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | ||||
@@ -225,13 +223,6 @@ | |||||
CommandParameter="调料" | CommandParameter="调料" | ||||
Content="新增调料数据" | Content="新增调料数据" | ||||
DockPanel.Dock="Right" /> | DockPanel.Dock="Right" /> | ||||
<Button | |||||
Margin="30,0" | |||||
Command="{Binding SaveMaterialInfoCommand}" | |||||
CommandParameter="调料" | |||||
Content="保存数据" | |||||
DockPanel.Dock="Right" /> | |||||
</DockPanel> | </DockPanel> | ||||
<!--#region 表格标题栏设置--> | <!--#region 表格标题栏设置--> | ||||
<Grid | <Grid | ||||
@@ -240,11 +231,11 @@ | |||||
Background="#ff0C255F"> | Background="#ff0C255F"> | ||||
<Grid.ColumnDefinitions> | <Grid.ColumnDefinitions> | ||||
<ColumnDefinition Width="330"/> | |||||
<ColumnDefinition Width="330" /> | |||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80" /> | |||||
<ColumnDefinition Width="80" /> | |||||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||||
@@ -296,11 +287,11 @@ | |||||
<DataTemplate> | <DataTemplate> | ||||
<Grid Name="gr" Height="30"> | <Grid Name="gr" Height="30"> | ||||
<Grid.ColumnDefinitions> | <Grid.ColumnDefinitions> | ||||
<ColumnDefinition Width="330"/> | |||||
<ColumnDefinition Width="330" /> | |||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80" /> | |||||
<ColumnDefinition Width="80" /> | |||||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||||
<TextBox | <TextBox | ||||
@@ -313,6 +304,7 @@ | |||||
<Grid Grid.Column="1"> | <Grid Grid.Column="1"> | ||||
<TextBox | <TextBox | ||||
MinWidth="150" | MinWidth="150" | ||||
IsReadOnly="True" | |||||
Style="{StaticResource DataShowTextBoxStyle}" | Style="{StaticResource DataShowTextBoxStyle}" | ||||
Text="{Binding Name}" | Text="{Binding Name}" | ||||
TextAlignment="Center" /> | TextAlignment="Center" /> | ||||
@@ -324,7 +316,9 @@ | |||||
<TextBox | <TextBox | ||||
Grid.Column="2" | Grid.Column="2" | ||||
MinWidth="150" Height="30" | |||||
Height="30" | |||||
MinWidth="150" | |||||
IsReadOnly="True" | |||||
Style="{StaticResource DataShowTextBoxStyle}" | Style="{StaticResource DataShowTextBoxStyle}" | ||||
Text="{Binding Loc}" | Text="{Binding Loc}" | ||||
TextAlignment="Center" /> | TextAlignment="Center" /> | ||||
@@ -341,7 +335,7 @@ | |||||
BorderThickness="1,0,1,0" | BorderThickness="1,0,1,0" | ||||
Cursor="SizeWE" /> | Cursor="SizeWE" /> | ||||
</Grid> | </Grid> | ||||
<Grid Grid.Column="4"> | <Grid Grid.Column="4"> | ||||
<Button | <Button | ||||
@@ -405,12 +399,6 @@ | |||||
Content="新增主料数据" | Content="新增主料数据" | ||||
DockPanel.Dock="Right" /> | DockPanel.Dock="Right" /> | ||||
<Button | |||||
Margin="30,0" | |||||
Command="{Binding SaveMaterialInfoCommand}" | |||||
CommandParameter="主料" | |||||
Content="保存数据" | |||||
DockPanel.Dock="Right" /> | |||||
</DockPanel> | </DockPanel> | ||||
<!--#region 表格标题栏设置--> | <!--#region 表格标题栏设置--> | ||||
<Grid | <Grid | ||||
@@ -419,10 +407,10 @@ | |||||
Background="#ff0C255F"> | Background="#ff0C255F"> | ||||
<Grid.ColumnDefinitions> | <Grid.ColumnDefinitions> | ||||
<ColumnDefinition Width="330"/> | |||||
<ColumnDefinition Width="330" /> | |||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80" /> | |||||
<ColumnDefinition Width="80" /> | |||||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||||
@@ -473,10 +461,10 @@ | |||||
<DataTemplate> | <DataTemplate> | ||||
<Grid Name="gr" Height="30"> | <Grid Name="gr" Height="30"> | ||||
<Grid.ColumnDefinitions> | <Grid.ColumnDefinitions> | ||||
<ColumnDefinition Width="330"/> | |||||
<ColumnDefinition Width="330" /> | |||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80"/> | |||||
<ColumnDefinition Width="80" /> | |||||
<ColumnDefinition Width="80" /> | |||||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||||
<TextBox | <TextBox | ||||
@@ -489,6 +477,7 @@ | |||||
<Grid Grid.Column="1"> | <Grid Grid.Column="1"> | ||||
<TextBox | <TextBox | ||||
MinWidth="100" | MinWidth="100" | ||||
IsReadOnly="True" | |||||
Style="{StaticResource DataShowTextBoxStyle}" | Style="{StaticResource DataShowTextBoxStyle}" | ||||
Text="{Binding Name}" | Text="{Binding Name}" | ||||
TextAlignment="Center" /> | TextAlignment="Center" /> |
@@ -75,6 +75,8 @@ | |||||
<TextBlock Text="物料类型:" /> | <TextBlock Text="物料类型:" /> | ||||
<ComboBox | <ComboBox | ||||
Width="200" | Width="200" | ||||
Height="40" | |||||
FontSize="18" | |||||
IsEditable="False" | IsEditable="False" | ||||
ItemsSource="{Binding MaterialType}" | ItemsSource="{Binding MaterialType}" | ||||
SelectedItem="{Binding CurrentMaterialType}" /> | SelectedItem="{Binding CurrentMaterialType}" /> | ||||
@@ -83,6 +85,7 @@ | |||||
<TextBlock Text="物料名称:" /> | <TextBlock Text="物料名称:" /> | ||||
<TextBox | <TextBox | ||||
Width="200" | Width="200" | ||||
Height="40" | |||||
FontSize="18" | FontSize="18" | ||||
Text="{Binding MaterialName}" /> | Text="{Binding MaterialName}" /> | ||||
</StackPanel> | </StackPanel> | ||||
@@ -93,15 +96,15 @@ | |||||
<TextBlock Text="物料位置:" /> | <TextBlock Text="物料位置:" /> | ||||
<TextBox | <TextBox | ||||
Width="200" | Width="200" | ||||
Height="40" | |||||
FontSize="18" | FontSize="18" | ||||
Text="{Binding MaterialLoc}" /> | Text="{Binding MaterialLoc}" /> | ||||
</StackPanel> | </StackPanel> | ||||
<StackPanel | |||||
Margin="0,5" | |||||
Orientation="Horizontal"> | |||||
<StackPanel Margin="0,5" Orientation="Horizontal"> | |||||
<TextBlock Text="物料描述:" /> | <TextBlock Text="物料描述:" /> | ||||
<TextBox | <TextBox | ||||
Width="200" | Width="200" | ||||
Height="40" | |||||
FontSize="18" | FontSize="18" | ||||
Text="{Binding MaterialDescription}" /> | Text="{Binding MaterialDescription}" /> | ||||
</StackPanel> | </StackPanel> |
@@ -33,30 +33,40 @@ | |||||
<!--#region 入库电子称状态--> | <!--#region 入库电子称状态--> | ||||
<pry:ImageBorder Margin="5,15"/> | |||||
<pry:ImageBorder Margin="5,15" /> | |||||
<StackPanel Margin="15,20"> | <StackPanel Margin="15,20"> | ||||
<TextBlock Width="200" Text="{Binding ScaleCurrentWeight, StringFormat=当前重量:{0} g}" /> | <TextBlock Width="200" Text="{Binding ScaleCurrentWeight, StringFormat=当前重量:{0} g}" /> | ||||
</StackPanel> | </StackPanel> | ||||
<!--#endregion--> | <!--#endregion--> | ||||
<!--#region 入库操作--> | <!--#region 入库操作--> | ||||
<pry:ImageBorder Margin="5,15" Grid.Row="1"/> | |||||
<pry:ImageBorder Grid.Row="1" Margin="5,15" /> | |||||
<StackPanel Grid.Row="1" Margin="15,20"> | <StackPanel Grid.Row="1" Margin="15,20"> | ||||
<TextBlock Text="入库名称:" /> | <TextBlock Text="入库名称:" /> | ||||
<ComboBox IsEditable="False" Margin="0,5"/> | |||||
<ComboBox | |||||
x:Name="cmbSelectName" | |||||
Height="50" | |||||
Margin="0,5" | |||||
DisplayMemberPath="Name" | |||||
FontSize="26" | |||||
IsEditable="False" | |||||
ItemsSource="{Binding Ingredients}" /> | |||||
<Button Margin="0,10" Content="入库" /> | |||||
<Button | |||||
Margin="0,10" | |||||
Command="{Binding InStorageCommand}" | |||||
CommandParameter="{Binding ElementName=cmbSelectName, Path=SelectedItem}" | |||||
Content="入库" /> | |||||
</StackPanel> | </StackPanel> | ||||
<!--#endregion--> | <!--#endregion--> | ||||
<!--#region 辅料仓--> | <!--#region 辅料仓--> | ||||
<pry:ImageBorder Margin="15" | |||||
Grid.Column="1"/> | |||||
<pry:ImageBorder Grid.Column="1" Margin="15" /> | |||||
<ItemsControl | <ItemsControl | ||||
Grid.Column="1" | Grid.Column="1" | ||||
Margin="3" | Margin="3" | ||||
Background="Transparent" | Background="Transparent" | ||||
BorderThickness="1" | BorderThickness="1" | ||||
ItemsSource="{Binding Seasonings}" | |||||
ItemsSource="{Binding AccessoriesItorage}" | |||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | ||||
<ItemsControl.ItemsPanel> | <ItemsControl.ItemsPanel> | ||||
<ItemsPanelTemplate> | <ItemsPanelTemplate> | ||||
@@ -86,11 +96,11 @@ | |||||
<TextBlock | <TextBlock | ||||
Grid.Row="1" | Grid.Row="1" | ||||
Margin="0,0,0,35" | |||||
Margin="0,0,0,35" | |||||
HorizontalAlignment="Center" | HorizontalAlignment="Center" | ||||
FontSize="20" | FontSize="20" | ||||
Foreground="#FF0084FF" | Foreground="#FF0084FF" | ||||
Text="{Binding Weight,StringFormat={}{0} g}" /> | |||||
Text="{Binding Weight, StringFormat={}{0} g}" /> | |||||
<StackPanel | <StackPanel | ||||
@@ -101,7 +111,7 @@ | |||||
<TextBlock | <TextBlock | ||||
FontSize="20" | FontSize="20" | ||||
Foreground="#FF0084FF" | Foreground="#FF0084FF" | ||||
Text="{Binding ID,StringFormat={}{0} 号仓}" /> | |||||
Text="{Binding ID, StringFormat={}{0} 号仓}" /> | |||||
</StackPanel> | </StackPanel> | ||||
<Image | <Image | ||||
Grid.RowSpan="2" | Grid.RowSpan="2" | ||||
@@ -114,14 +124,16 @@ | |||||
</ItemsControl> | </ItemsControl> | ||||
<!--#endregion--> | <!--#endregion--> | ||||
<!--#region 原料仓--> | <!--#region 原料仓--> | ||||
<pry:ImageBorder Margin="15" | |||||
Grid.Column="1" Grid.Row="1"/> | |||||
<pry:ImageBorder | |||||
Grid.Row="1" | |||||
Grid.Column="1" | |||||
Margin="15" /> | |||||
<ItemsControl | <ItemsControl | ||||
Grid.Row="1" | Grid.Row="1" | ||||
Grid.Column="1" | Grid.Column="1" | ||||
Margin="3" | Margin="3" | ||||
Background="Transparent" | Background="Transparent" | ||||
ItemsSource="{Binding Materials}" | |||||
ItemsSource="{Binding IngredientsItorage}" | |||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | ||||
<ItemsControl.ItemsPanel> | <ItemsControl.ItemsPanel> | ||||
<ItemsPanelTemplate> | <ItemsPanelTemplate> | ||||
@@ -149,14 +161,14 @@ | |||||
FontSize="25" | FontSize="25" | ||||
Foreground="#ffccd61f" | Foreground="#ffccd61f" | ||||
Text="{Binding Name}" /> | Text="{Binding Name}" /> | ||||
<TextBlock | <TextBlock | ||||
Grid.Row="1" | Grid.Row="1" | ||||
Margin="0,0,0,35" | |||||
Margin="0,0,0,35" | |||||
HorizontalAlignment="Center" | HorizontalAlignment="Center" | ||||
FontSize="20" | FontSize="20" | ||||
Foreground="#FF0084FF" | Foreground="#FF0084FF" | ||||
Text="{Binding Weight,StringFormat={}{0} g}" /> | |||||
Text="{Binding Weight, StringFormat={}{0} g}" /> | |||||
<StackPanel | <StackPanel | ||||
@@ -167,7 +179,7 @@ | |||||
<TextBlock | <TextBlock | ||||
FontSize="20" | FontSize="20" | ||||
Foreground="#FF0084FF" | Foreground="#FF0084FF" | ||||
Text="{Binding ID,StringFormat={}{0} 号仓}" /> | |||||
Text="{Binding ID, StringFormat={}{0} 号仓}" /> | |||||
</StackPanel> | </StackPanel> | ||||
<Image | <Image | ||||
Grid.RowSpan="2" | Grid.RowSpan="2" |
@@ -183,16 +183,17 @@ | |||||
<TextBlock | <TextBlock | ||||
Grid.Column="0" | Grid.Column="0" | ||||
Style="{StaticResource TextBlockStyle}" | |||||
HorizontalAlignment="Center" | HorizontalAlignment="Center" | ||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="{Binding Name}" | Text="{Binding Name}" | ||||
TextAlignment="Center" /> | TextAlignment="Center" /> | ||||
<Grid Grid.Column="1"> | <Grid Grid.Column="1"> | ||||
<TextBox | <TextBox | ||||
MinWidth="400" | |||||
Style="{StaticResource DataShowTextBoxStyle}" | Style="{StaticResource DataShowTextBoxStyle}" | ||||
Text="{Binding DishType}" | Text="{Binding DishType}" | ||||
TextAlignment="Center" MinWidth="400"/> | |||||
TextAlignment="Center" /> | |||||
<Border | <Border | ||||
BorderBrush="{StaticResource bordColor}" | BorderBrush="{StaticResource bordColor}" | ||||
BorderThickness="1,0,1,0" | BorderThickness="1,0,1,0" | ||||
@@ -201,9 +202,10 @@ | |||||
<Grid Grid.Column="2"> | <Grid Grid.Column="2"> | ||||
<TextBox | <TextBox | ||||
MinWidth="400" | |||||
Style="{StaticResource DataShowTextBoxStyle}" | Style="{StaticResource DataShowTextBoxStyle}" | ||||
Text="{Binding Remark}" | Text="{Binding Remark}" | ||||
TextAlignment="Center" MinWidth="400"/> | |||||
TextAlignment="Center" /> | |||||
<Border | <Border | ||||
BorderBrush="{StaticResource bordColor}" | BorderBrush="{StaticResource bordColor}" | ||||
BorderThickness="1,0,1,0" | BorderThickness="1,0,1,0" | ||||
@@ -239,7 +241,7 @@ | |||||
<Grid Grid.Column="5"> | <Grid Grid.Column="5"> | ||||
<Button | <Button | ||||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | ||||
CommandParameter="{Binding ID}" | |||||
CommandParameter="{Binding Id}" | |||||
Content="删除" | Content="删除" | ||||
FontSize="16" | FontSize="16" | ||||
Style="{StaticResource ControlButtonStyle}" /> | Style="{StaticResource ControlButtonStyle}" /> |
@@ -58,24 +58,13 @@ namespace BPASmartClient.MorkCL.ViewModel | |||||
{ | { | ||||
EditRawMaterialView editRawMaterialView = new EditRawMaterialView(); | EditRawMaterialView editRawMaterialView = new EditRawMaterialView(); | ||||
ActionManage.GetInstance.Send("OpenEditRawMaterialView",new MaterialBase()); | ActionManage.GetInstance.Send("OpenEditRawMaterialView",new MaterialBase()); | ||||
ActionManage.GetInstance.Send("ChangeMaterialType", materialType); | |||||
if (editRawMaterialView.ShowDialog() == true) | if (editRawMaterialView.ShowDialog() == true) | ||||
{ | { | ||||
RefreshData(); | RefreshData(); | ||||
} | } | ||||
}); | }); | ||||
SaveMaterialInfoCommand = new BPARelayCommand<string>((materialType) => | |||||
{ | |||||
//TODO:暂时不写 可能使用数据库保存。 | |||||
switch (materialType) | |||||
{ | |||||
case "主料": | |||||
break; | |||||
case "辅料": | |||||
break; | |||||
case "调料": | |||||
break; | |||||
} | |||||
}); | |||||
EditCommand = new BPARelayCommand<object>((o) => | EditCommand = new BPARelayCommand<object>((o) => | ||||
{ | { | ||||
EditRawMaterialView editRawMaterialView = new EditRawMaterialView(); | EditRawMaterialView editRawMaterialView = new EditRawMaterialView(); | ||||
@@ -109,8 +98,8 @@ namespace BPASmartClient.MorkCL.ViewModel | |||||
private void RefreshData() | private void RefreshData() | ||||
{ | { | ||||
Ingredients = new ObservableCollection<IngredientsTB>(SqliteHelper.GetInstance.GetIngredients()); | Ingredients = new ObservableCollection<IngredientsTB>(SqliteHelper.GetInstance.GetIngredients()); | ||||
Accessories = new ObservableCollection<AccessoriesTB>(SqliteHelper.GetInstance.GetAccessories()); | |||||
Seasonings = new ObservableCollection<SeasoningTB>(SqliteHelper.GetInstance.GetSeasoning()); | |||||
Accessories = new ObservableCollection<AccessoriesTB>(SqliteHelper.GetInstance.GetAccessories().OrderBy(tb => tb.Loc)); | |||||
Seasonings = new ObservableCollection<SeasoningTB>(SqliteHelper.GetInstance.GetSeasoning().OrderBy(tb => tb.Loc)); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 辅料信息集合 | /// 辅料信息集合 | ||||
@@ -145,10 +134,8 @@ namespace BPASmartClient.MorkCL.ViewModel | |||||
/// </summary> | /// </summary> | ||||
public BPARelayCommand<string> AddMaterialCommand { get; set; } | public BPARelayCommand<string> AddMaterialCommand { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 保存物料信息。 | |||||
/// 编辑物料信息。 | |||||
/// </summary> | /// </summary> | ||||
public BPARelayCommand<string> SaveMaterialInfoCommand { get; set; } | |||||
public BPARelayCommand<object> EditCommand { get; set; } | public BPARelayCommand<object> EditCommand { get; set; } | ||||
} | } | ||||
} | } |
@@ -51,10 +51,26 @@ namespace BPASmartClient.MorkCL.ViewModel | |||||
} | } | ||||
} | } | ||||
}, "OpenEditRawMaterialView", true); | }, "OpenEditRawMaterialView", true); | ||||
ActionManage.GetInstance.Register((object o) => | |||||
{ | |||||
string materialType=o is String ? (String)o : null; | |||||
CurrentMaterialType = materialType!; | |||||
}, "ChangeMaterialType", true); | |||||
SaveParamCommand=new BPARelayCommand(() => { | |||||
#region 数据验证 | |||||
if (string.IsNullOrEmpty(MaterialName) || MaterialName.Length<=0) | |||||
{ | |||||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, Application.Current.MainWindow, "提示", $"失败,物料名称不正确!"); | |||||
return; | |||||
} | |||||
if (MaterialLoc<=0) | |||||
{ | |||||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, Application.Current.MainWindow, "提示", $"失败,物料位置应大于0!"); | |||||
return; | |||||
} | |||||
SaveParamCommand=new BPARelayCommand(() => { | |||||
#endregion | |||||
//新增 | //新增 | ||||
if (IsNewAdd) | if (IsNewAdd) | ||||
{ | { | ||||
@@ -63,14 +79,30 @@ namespace BPASmartClient.MorkCL.ViewModel | |||||
switch (CurrentMaterialType) | switch (CurrentMaterialType) | ||||
{ | { | ||||
case "主料": | case "主料": | ||||
//if (SqliteHelper.GetInstance.GetIngredientsInfoByLoc(MaterialLoc)) | |||||
//{ | |||||
// NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, Application.Current.MainWindow, "提示", $"添加失败,该位置已有物料!"); | |||||
// return; | |||||
//} | |||||
IngredientsTB ingredients = new IngredientsTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | IngredientsTB ingredients = new IngredientsTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | ||||
SqliteHelper.GetInstance.AddIngredients(ingredients); | SqliteHelper.GetInstance.AddIngredients(ingredients); | ||||
ActionManage.GetInstance.Send("RefreshIngredients"); | |||||
break; | break; | ||||
case "辅料": | case "辅料": | ||||
if (SqliteHelper.GetInstance.GetAccessoriesInfoByLoc(MaterialLoc)) | |||||
{ | |||||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, Application.Current.MainWindow, "提示", $"添加失败,该位置已有物料!"); | |||||
return; | |||||
} | |||||
AccessoriesTB accessories = new AccessoriesTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | AccessoriesTB accessories = new AccessoriesTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | ||||
SqliteHelper.GetInstance.AddAccessories(accessories); | SqliteHelper.GetInstance.AddAccessories(accessories); | ||||
break; | break; | ||||
case "调料": | case "调料": | ||||
if (SqliteHelper.GetInstance.GetSeasoningInfoByLoc(MaterialLoc)) | |||||
{ | |||||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, Application.Current.MainWindow, "提示", $"添加失败,该位置已有物料!"); | |||||
return; | |||||
} | |||||
SeasoningTB seasoning = new SeasoningTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | SeasoningTB seasoning = new SeasoningTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | ||||
SqliteHelper.GetInstance.AddSeasoning(seasoning); | SqliteHelper.GetInstance.AddSeasoning(seasoning); | ||||
break; | break; | ||||
@@ -90,14 +122,29 @@ namespace BPASmartClient.MorkCL.ViewModel | |||||
switch (CurrentMaterialType) | switch (CurrentMaterialType) | ||||
{ | { | ||||
case "主料": | case "主料": | ||||
if (SqliteHelper.GetInstance.GetIngredientsInfoByLoc(MaterialLoc)) | |||||
{ | |||||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, Application.Current.MainWindow, "提示", $"修改失败,该位置已有物料!"); | |||||
return; | |||||
} | |||||
IngredientsTB ingredients = new IngredientsTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | IngredientsTB ingredients = new IngredientsTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | ||||
SqliteHelper.GetInstance.EditIngredients(ingredients); | SqliteHelper.GetInstance.EditIngredients(ingredients); | ||||
break; | break; | ||||
case "辅料": | case "辅料": | ||||
if (SqliteHelper.GetInstance.GetAccessoriesInfoByLoc(MaterialLoc)) | |||||
{ | |||||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, Application.Current.MainWindow, "提示", $"修改失败,该位置已有物料!"); | |||||
return; | |||||
} | |||||
AccessoriesTB accessories = new AccessoriesTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | AccessoriesTB accessories = new AccessoriesTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | ||||
SqliteHelper.GetInstance.EditAccessories(accessories); | SqliteHelper.GetInstance.EditAccessories(accessories); | ||||
break; | break; | ||||
case "调料": | case "调料": | ||||
if (SqliteHelper.GetInstance.GetSeasoningInfoByLoc(MaterialLoc)) | |||||
{ | |||||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, Application.Current.MainWindow, "提示", $"修改失败,该位置已有物料!"); | |||||
return; | |||||
} | |||||
SeasoningTB seasoning = new SeasoningTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | SeasoningTB seasoning = new SeasoningTB() { Name = MaterialName, Loc = MaterialLoc, Id = _materialID, Description = MaterialDescription }; | ||||
SqliteHelper.GetInstance.EditSeasoning(seasoning); | SqliteHelper.GetInstance.EditSeasoning(seasoning); | ||||
break; | break; |
@@ -0,0 +1,135 @@ | |||||
using BPASmartClient.CustomResource.UserControls.MessageShow; | |||||
using BPASmartClient.MorkCL.Model.DB; | |||||
using BPASmartClient.MorkCL.Model.Json; | |||||
using BPASmartClient.MorkCL.Server; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.MorkCL.ViewModel | |||||
{ | |||||
public class ItemStorageViewModel:NotifyBase | |||||
{ | |||||
public ItemStorageViewModel() | |||||
{ | |||||
//加载读取数据。 | |||||
AddTestData(); | |||||
//IngredientsItorage =new ObservableCollection<ItemStroage> ( Json<ItemStroageInfo>.Data.IngredientsStorage); | |||||
//AccessoriesItorage =new ObservableCollection<ItemStroage> (Json<ItemStroageInfo>.Data.AccessoriesStorage); | |||||
IngredientsItorage = new ObservableCollection<ItemStroage>(new ItemStroage[12]); | |||||
AccessoriesItorage = new ObservableCollection<ItemStroage>(new ItemStroage[8]); | |||||
ActionManage.GetInstance.Register((() => | |||||
{ | |||||
Ingredients = new ObservableCollection<IngredientsTB>(SqliteHelper.GetInstance.GetIngredients()); | |||||
}),"RefreshIngredients",true); | |||||
Ingredients = new ObservableCollection<IngredientsTB>(SqliteHelper.GetInstance.GetIngredients()); | |||||
for (int i = 0; i < IngredientsItorage.Count; i++) | |||||
{ | |||||
IngredientsItorage[i]=new ItemStroage(); | |||||
} | |||||
for (int i = 0; i < AccessoriesItorage.Count; i++) | |||||
{ | |||||
AccessoriesItorage[i] = new ItemStroage(); | |||||
} | |||||
InStorageCommand = new BPARelayCommand<object>((o) => | |||||
{ | |||||
if (o != null && o is IngredientsTB ingredients) | |||||
{ | |||||
foreach (ItemStroage item in IngredientsItorage) | |||||
{ | |||||
if (item.IsEmploy == false) | |||||
{ | |||||
item.MaterialID = ingredients.Id; | |||||
item.Name = ingredients.Name; | |||||
item.IsEmploy = true; | |||||
item.Weight = ScaleCurrentWeight; | |||||
Json<ItemStroageInfo>.Save(); | |||||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, Application.Current.MainWindow, "入库成功", $"物料{ingredients.Name}入库成功。"); | |||||
return; | |||||
} | |||||
} | |||||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, Application.Current.MainWindow, "入库失败", $"物料库已满。"); | |||||
} | |||||
else | |||||
{ | |||||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, Application.Current.MainWindow, "入库失败", $"物料入库失败。"); | |||||
} | |||||
}); | |||||
} | |||||
void AddTestData() | |||||
{ | |||||
ScaleCurrentWeight = 1.23f; | |||||
//Materials.Clear(); | |||||
//for (int i = 1; i < 13; i++) | |||||
//{ | |||||
// Materials.Add(new TempMaterial() { ID = 10000 + i, Loc = i.ToString(), Name = $"第{i}库位", Weight = new Random().NextSingle()*10000 }); | |||||
//} | |||||
//Seasonings.Clear(); | |||||
//for (int i = 1; i < 9; i++) | |||||
//{ | |||||
// Seasonings.Add(new TempMaterial() { ID = 10000 + i, Loc = i.ToString(), Name = $"第{i}库位", Weight = new Random().NextSingle()*10000 }); | |||||
//} | |||||
} | |||||
public BPARelayCommand<object> InStorageCommand { get; set; } | |||||
private float _ScaleCurrentWeight; | |||||
public float ScaleCurrentWeight { get { return _ScaleCurrentWeight; } set { _ScaleCurrentWeight = value; OnPropertyChanged(); } } | |||||
private IngredientsTB _SelectIngreditent; | |||||
public IngredientsTB SelectIngreditent | |||||
{ | |||||
get { return _SelectIngreditent; } | |||||
set { _SelectIngreditent = value; OnPropertyChanged(); } | |||||
} | |||||
private ObservableCollection<ItemStroage> _IngredientsItorage; | |||||
/// <summary> | |||||
/// 主料库位。 | |||||
/// </summary> | |||||
public ObservableCollection<ItemStroage> IngredientsItorage | |||||
{ | |||||
get { return _IngredientsItorage; } | |||||
set { _IngredientsItorage = value; OnPropertyChanged(); } | |||||
} | |||||
private ObservableCollection<ItemStroage> _AccessoriesItorage; | |||||
/// <summary> | |||||
/// 辅料库位 | |||||
/// </summary> | |||||
public ObservableCollection<ItemStroage> AccessoriesItorage | |||||
{ | |||||
get { return _AccessoriesItorage; } | |||||
set { _AccessoriesItorage = value; OnPropertyChanged(); } | |||||
} | |||||
private ObservableCollection<IngredientsTB> _Ingredients ; | |||||
/// <summary> | |||||
/// 所有的主料数据。作为ComboBox的数据源。 | |||||
/// </summary> | |||||
public ObservableCollection<IngredientsTB> Ingredients | |||||
{ | |||||
get { return _Ingredients; } | |||||
set { _Ingredients = value; OnPropertyChanged(); } | |||||
} | |||||
} | |||||
} |
@@ -1,62 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.MorkCL.ViewModel | |||||
{ | |||||
public class ItemStorageViewModel:NotifyBase | |||||
{ | |||||
public ItemStorageViewModel() | |||||
{ | |||||
Materials = new ObservableCollection<TempMaterial>(); | |||||
Seasonings = new ObservableCollection<TempMaterial>(); | |||||
AddTestData(); | |||||
} | |||||
void AddTestData() | |||||
{ | |||||
ScaleCurrentWeight = 1.23f; | |||||
Materials.Clear(); | |||||
for (int i = 1; i < 13; i++) | |||||
{ | |||||
Materials.Add(new TempMaterial() { ID = 10000 + i, Loc = i.ToString(), Name = $"第{i}库位", Weight = new Random().NextSingle()*10000 }); | |||||
} | |||||
Seasonings.Clear(); | |||||
for (int i = 1; i < 9; i++) | |||||
{ | |||||
Seasonings.Add(new TempMaterial() { ID = 10000 + i, Loc = i.ToString(), Name = $"第{i}库位", Weight = new Random().NextSingle()*10000 }); | |||||
} | |||||
} | |||||
private float _ScaleCurrentWeight; | |||||
public float ScaleCurrentWeight { get { return _ScaleCurrentWeight; } set { _ScaleCurrentWeight = value; OnPropertyChanged(); } } | |||||
private ObservableCollection<TempMaterial> _Materials; | |||||
public ObservableCollection<TempMaterial> Materials | |||||
{ | |||||
get { return _Materials; } | |||||
set { _Materials = value; OnPropertyChanged(); } | |||||
} | |||||
private ObservableCollection<TempMaterial> _Seasonings; | |||||
public ObservableCollection<TempMaterial> Seasonings | |||||
{ | |||||
get { return _Seasonings; } | |||||
set { _Seasonings = value; OnPropertyChanged(); } | |||||
} | |||||
} | |||||
public class TempMaterial | |||||
{ | |||||
public int ID { get; set; } | |||||
public string Name { get; set; } | |||||
public float Weight { get; set; } | |||||
public string Loc { get; set; } | |||||
} | |||||
} |
@@ -1,46 +0,0 @@ | |||||
<Application | |||||
x:Class="BPASmartClient.TourismCollege.App" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource" | |||||
xmlns:local="clr-namespace:BPASmartClient.TourismCollege"> | |||||
<Application.Resources> | |||||
<ResourceDictionary> | |||||
<ResourceDictionary.MergedDictionaries> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecCheckBox.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecTitleBarButton.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalStyle.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecComboBox.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecIcoButtonStyle.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecToggleButton.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/BeveledRadioButtonStyle.xaml" /> | |||||
<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.CustomResource;component/Themes/GenricStyle.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" /> | |||||
<ResourceDictionary> | |||||
<con:ColorConverter x:Key="ColorConverter" /> | |||||
<con:TextConverter x:Key="TextConverter" /> | |||||
<con:VisibleTypeConverter x:Key="VisibleTypeConverter" /> | |||||
<con:StatusConverter x:Key="StatusConverter" /> | |||||
<con:StringToIconConverter x:Key="StringToIconConverter" /> | |||||
<con:BoolToVisibilityConvert x:Key="BoolToVisibilityConvert" /> | |||||
<con:CountIsVisiableConvert x:Key="CountIsVisiableConvert" /> | |||||
<con:BoolToFillColorConverter x:Key="BoolToFillColorConverter" /> | |||||
<con:RecipeStatusConvert x:Key="RecipeStatusConvert" /> | |||||
</ResourceDictionary> | |||||
<ResourceDictionary> | |||||
<ImageBrush x:Key="hbl" ImageSource="/BPASmartClient.CustomResource;component/Image/HBL.png" /> | |||||
<ImageBrush x:Key="dbxt" ImageSource="/BPASmartClient.CustomResource;component/Image/顶部线条.png" /> | |||||
</ResourceDictionary> | |||||
</ResourceDictionary.MergedDictionaries> | |||||
</ResourceDictionary> | |||||
</Application.Resources> | |||||
</Application> |
@@ -1,296 +0,0 @@ | |||||
using BPASmartClient.CustomResource.Pages.ViewModel; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Collections.ObjectModel; | |||||
using System.Configuration; | |||||
using System.Data; | |||||
using System.Linq; | |||||
using System.Threading; | |||||
using System.Threading.Tasks; | |||||
using System.Windows; | |||||
namespace BPASmartClient.TourismCollege | |||||
{ | |||||
/// <summary> | |||||
/// Interaction logic for App.xaml | |||||
/// </summary> | |||||
public partial class App : Application | |||||
{ | |||||
public static Window MainWindow; | |||||
protected override void OnStartup(StartupEventArgs e) | |||||
{ | |||||
bool createNew; | |||||
MessageLog.GetInstance.NotifyShow = new Action<string>(o => | |||||
{ | |||||
DebugLogViewModel.MessageModels.Add(new MessageModel() | |||||
{ | |||||
LogInfo = o, | |||||
Forground = System.Windows.Media.Brushes.DeepSkyBlue | |||||
}); | |||||
}); | |||||
MessageLog.GetInstance.NotifyShowEx = new Action<string>(o => | |||||
{ | |||||
DebugLogViewModel.MessageModels.Add(new MessageModel() | |||||
{ | |||||
LogInfo = o, | |||||
Forground = System.Windows.Media.Brushes.Red | |||||
}); | |||||
}); | |||||
new EventWaitHandle(false, EventResetMode.AutoReset, "BPASmartClient.TourismCollege", out createNew); | |||||
if (!createNew) | |||||
{ | |||||
MessageBox.Show("程序已启动"); | |||||
App.Current.Shutdown(); | |||||
Environment.Exit(0); | |||||
} | |||||
base.OnStartup(e); | |||||
SystemHelper.GetInstance.CreateDesktopShortcut(); | |||||
MenuInit(); | |||||
DataInit(); | |||||
MainView mv = new MainView(); | |||||
mv.TitleName = $"智能炒锅控制系统"; | |||||
LoginView lv = new LoginView(); | |||||
var res = lv.ShowDialog(); | |||||
if (res != null && res == true) | |||||
{ | |||||
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.ShowUserLog("用户登录"); | |||||
mv.Show(); | |||||
} | |||||
else | |||||
mv.Close(); | |||||
MainWindow = mv; | |||||
} | |||||
protected override void OnExit(ExitEventArgs e) | |||||
{ | |||||
base.OnExit(e); | |||||
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.LogSave(); | |||||
TaskManage.GetInstance.Dispose(); | |||||
} | |||||
private void MenuInit() | |||||
{ | |||||
NfcServer.GetInstance.Init(); | |||||
#region 配方管理菜单 | |||||
ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>(); | |||||
RecipeManage.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "配方管理", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.RecipeSettingsView" | |||||
}); | |||||
RecipeManage.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "配方下发", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.RecipeControlView" | |||||
}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||||
{ | |||||
MainMenuIcon = "", | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
MainMenuName = "配方管理", | |||||
Alias = "Recipe Management", | |||||
subMenumodels = RecipeManage, | |||||
}); | |||||
#endregion | |||||
#region 参数设置 | |||||
ObservableCollection<SubMenumodel> ParSet = new ObservableCollection<SubMenumodel>(); | |||||
ParSet.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "原料参数设置", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.DeviceMaterialParView" | |||||
}); | |||||
ParSet.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "设备参数设置", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.CommParSetView" | |||||
}); | |||||
//ParSet.Add(new SubMenumodel() | |||||
//{ | |||||
// SubMenuName = "出料口管理设置", | |||||
// SubMenuPermission = new Permission[] { Permission.管理员 }, | |||||
// AssemblyName = "BPASmartClient.DosingSystem", | |||||
// ToggleWindowPath = "View.OutletManagementView" | |||||
//}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||||
{ | |||||
MainMenuIcon = "", | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
MainMenuName = "参数设置", | |||||
Alias = "Parameter Set", | |||||
subMenumodels = ParSet, | |||||
}); | |||||
#endregion | |||||
#region 手动控制 | |||||
ObservableCollection<SubMenumodel> ManualControl = new ObservableCollection<SubMenumodel>(); | |||||
ManualControl.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "气缸手动控制", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.ManualControlView" | |||||
}); | |||||
ManualControl.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "输送带手动控制", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.ConveyerBeltManualView" | |||||
}); | |||||
ManualControl.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "配料输送带控制", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.TempManageControlView" | |||||
}); | |||||
//ManualControl.Add(new SubMenumodel() | |||||
//{ | |||||
// SubMenuName = "料仓控制", | |||||
// SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
// AssemblyName = "BPASmartClient.DosingSystem", | |||||
// ToggleWindowPath = "View.StockControlView" | |||||
//}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||||
{ | |||||
MainMenuIcon = "", | |||||
MainMenuName = "手动控制", | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
Alias = "Parameter Set", | |||||
subMenumodels = ManualControl, | |||||
}); | |||||
#endregion | |||||
#region 消息日志 | |||||
ObservableCollection<SubMenumodel> InfoLog = new ObservableCollection<SubMenumodel>(); | |||||
InfoLog.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "操作日志", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.UserLogView" | |||||
}); | |||||
InfoLog.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "运行日志", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.RunLogView" | |||||
}); | |||||
InfoLog.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "报警记录", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.AlarmView" | |||||
}); | |||||
InfoLog.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "调试日志", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.DebugLogView" | |||||
}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||||
{ | |||||
MainMenuIcon = "", | |||||
MainMenuName = "消息日志", | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
Alias = "Message Log", | |||||
subMenumodels = InfoLog, | |||||
}); | |||||
#endregion | |||||
#region 硬件设备监控 | |||||
ObservableCollection<SubMenumodel> DeviceMonitor = new ObservableCollection<SubMenumodel>(); | |||||
DeviceMonitor.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "原料设备列表", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.DeviceListView" | |||||
}); | |||||
DeviceMonitor.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "设备状态", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.DosingSystem", | |||||
ToggleWindowPath = "View.HardwareStatusView" | |||||
}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||||
{ | |||||
MainMenuIcon = "", | |||||
MainMenuName = "设备监控", | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
Alias = "Device Monitor", | |||||
subMenumodels = DeviceMonitor, | |||||
}); | |||||
#endregion | |||||
#region 用户管理 | |||||
ObservableCollection<SubMenumodel> UserManager = new ObservableCollection<SubMenumodel>(); | |||||
UserManager.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "用户登录", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.SubPagLoginView" | |||||
}); | |||||
UserManager.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "密码修改", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.PasswordChangeView" | |||||
}); | |||||
UserManager.Add(new SubMenumodel() | |||||
{ | |||||
SubMenuName = "用户管理", | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | |||||
ToggleWindowPath = "Pages.View.UserManagerView" | |||||
}); | |||||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||||
{ | |||||
MainMenuIcon = "", | |||||
MainMenuName = "用户管理", | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }, | |||||
Alias = "User Management", | |||||
subMenumodels = UserManager, | |||||
}); | |||||
#endregion | |||||
} | |||||
private void DataInit() | |||||
{ | |||||
} | |||||
} | |||||
} |
@@ -1,10 +0,0 @@ | |||||
using System.Windows; | |||||
[assembly: ThemeInfo( | |||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | |||||
//(used if a resource is not found in the page, | |||||
// or application resource dictionaries) | |||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | |||||
//(used if a resource is not found in the page, | |||||
// app, or any theme specific resource dictionaries) | |||||
)] |
@@ -1,35 +0,0 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | |||||
<PropertyGroup> | |||||
<OutputType>WinExe</OutputType> | |||||
<TargetFramework>net6.0-windows</TargetFramework> | |||||
<Nullable>enable</Nullable> | |||||
<UseWPF>true</UseWPF> | |||||
<ApplicationIcon>hbl.ico</ApplicationIcon> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<Content Include="hbl.ico" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" /> | |||||
<Compile Remove="Views\View\**" /> | |||||
<EmbeddedResource Remove="Views\View\**" /> | |||||
<None Remove="Views\View\**" /> | |||||
<Page Remove="Views\View\**" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<Folder Include="Views\" /> | |||||
<Folder Include="ViewModels\" /> | |||||
<Folder Include="Server\" /> | |||||
<Folder Include="Model\" /> | |||||
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<PackageReference Include="BPA.Communication" Version="1.0.107" /> | |||||
</ItemGroup> | |||||
</Project> |
@@ -1,21 +0,0 @@ | |||||
global using System; | |||||
global using System.Collections.Generic; | |||||
global using System.Collections.ObjectModel; | |||||
global using System.Configuration; | |||||
global using System.Data; | |||||
global using System.Linq; | |||||
global using System.Threading; | |||||
global using System.Threading.Tasks; | |||||
global using System.Windows; | |||||
global using System.Diagnostics; | |||||
global using System.IO; | |||||
global using System.Drawing; | |||||
global using System.Windows.Media; | |||||
global using BPA.Helper; | |||||
global using BPA.Communication; | |||||
global using BPASmartClient.CustomResource.Pages.Enums; | |||||
global using BPASmartClient.CustomResource.Pages.Model; | |||||
global using BPASmartClient.CustomResource.Pages.View; | |||||
global using BPASmartClient.CustomResource.Pages.ViewModel; | |||||
@@ -1,12 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.TourismCollege.Viewmodels | |||||
{ | |||||
internal class ItemStorageViewModel | |||||
{ | |||||
} | |||||
} |
@@ -1,12 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.TourismCollege.ViewModels | |||||
{ | |||||
public class RecipeManageViewModel | |||||
{ | |||||
} | |||||
} |
@@ -1,57 +0,0 @@ | |||||
<UserControl x:Class="BPASmartClient.TourismCollege.Views.ItemStorageView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.TourismCollege.Views" | |||||
mc:Ignorable="d" | |||||
d:DesignHeight="450" d:DesignWidth="800"> | |||||
<Grid> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="200" /> | |||||
<ColumnDefinition Width="1*" /> | |||||
</Grid.ColumnDefinitions> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="0.3*" /> | |||||
<RowDefinition Height="0.7*" /> | |||||
</Grid.RowDefinitions> | |||||
<!--#region 入库电子称状态 --> | |||||
<StackPanel> | |||||
<TextBlock Text="{Binding Weight,StringFormat=当前重量:{0}g}" Width="200"/> | |||||
</StackPanel> | |||||
<!--#endregion--> | |||||
<!--#region 入库操作 --> | |||||
<StackPanel Grid.Row="1" Margin="5"> | |||||
<TextBlock Text="入库名称:"/> | |||||
<ComboBox /> | |||||
<Button Content="入库" Margin="0,10"/> | |||||
</StackPanel> | |||||
<!--#endregion--> | |||||
<!--#region 辅料仓 --> | |||||
<UniformGrid Columns="8" Grid.Column="1" Margin="3" Background="ForestGreen"> | |||||
</UniformGrid> | |||||
<!--#endregion--> | |||||
<!--#region 原料仓 --> | |||||
<ListView Grid.Row="1" Grid.Column="1" Margin="3" BorderThickness="1" > | |||||
<ListView.ItemsPanel> | |||||
<ItemsPanelTemplate> | |||||
<UniformGrid Columns="4" Rows="3" HorizontalAlignment="Left" VerticalAlignment="Top"/> | |||||
</ItemsPanelTemplate> | |||||
</ListView.ItemsPanel> | |||||
<ListView.ItemTemplate> | |||||
<DataTemplate> | |||||
<Border Background="Black"/> | |||||
</DataTemplate> | |||||
</ListView.ItemTemplate> | |||||
</ListView> | |||||
<!--#endregion--> | |||||
</Grid> | |||||
</UserControl> |
@@ -1,28 +0,0 @@ | |||||
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.Navigation; | |||||
using System.Windows.Shapes; | |||||
namespace BPASmartClient.TourismCollege.Views | |||||
{ | |||||
/// <summary> | |||||
/// ItemStorageView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class ItemStorageView : UserControl | |||||
{ | |||||
public ItemStorageView() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -1,18 +0,0 @@ | |||||
<UserControl x:Class="BPASmartClient.TourismCollege.Views.RecipeManageView" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.TourismCollege.Views" | |||||
mc:Ignorable="d" | |||||
d:DesignHeight="450" d:DesignWidth="800"> | |||||
<Grid> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="50" /> | |||||
<RowDefinition Height="1*" /> | |||||
</Grid.RowDefinitions> | |||||
<!--#region 操作栏 --> | |||||
<!--#endregion--> | |||||
</Grid> | |||||
</UserControl> |
@@ -1,29 +0,0 @@ | |||||
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.Navigation; | |||||
using System.Windows.Shapes; | |||||
namespace BPASmartClient.TourismCollege.Views | |||||
{ | |||||
/// <summary> | |||||
/// RecipeManageView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class RecipeManageView : UserControl | |||||
{ | |||||
public RecipeManageView() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -45,7 +45,7 @@ | |||||
<ProjectReference Include="..\BPASmartClient.MorkT_Container\BPASmartClient.MorkT_Container.csproj" /> | <ProjectReference Include="..\BPASmartClient.MorkT_Container\BPASmartClient.MorkT_Container.csproj" /> | ||||
<ProjectReference Include="..\BPASmartClient.MorkT_HQ\BPASmartClient.MorkTHQ.csproj" /> | <ProjectReference Include="..\BPASmartClient.MorkT_HQ\BPASmartClient.MorkTHQ.csproj" /> | ||||
<ProjectReference Include="..\BPASmartClient.SCChip\BPASmartClient.SCChip.csproj" /> | <ProjectReference Include="..\BPASmartClient.SCChip\BPASmartClient.SCChip.csproj" /> | ||||
<ProjectReference Include="..\BPASmartClient.Tourism\BPASmartClient.MorkCL.csproj" /> | |||||
<ProjectReference Include="..\BPASmartClient.MorkCL\BPASmartClient.MorkCL.csproj" /> | |||||
<ProjectReference Include="..\BPASmartClient.ViewModel\BPASmartClient.ViewModel.csproj" /> | <ProjectReference Include="..\BPASmartClient.ViewModel\BPASmartClient.ViewModel.csproj" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
@@ -162,7 +162,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkMV1", "B | |||||
EndProject | EndProject | ||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.FoodStationTest", "BPASmartClient.FoodStationTest\BPASmartClient.FoodStationTest.csproj", "{82D5C479-7C38-41D6-8B42-24D4EC32D94F}" | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.FoodStationTest", "BPASmartClient.FoodStationTest\BPASmartClient.FoodStationTest.csproj", "{82D5C479-7C38-41D6-8B42-24D4EC32D94F}" | ||||
EndProject | EndProject | ||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkCL", "BPASmartClient.Tourism\BPASmartClient.MorkCL.csproj", "{52F2D7ED-6520-45EF-BCC4-565E5267973B}" | |||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkCL", "BPASmartClient.MorkCL\BPASmartClient.MorkCL.csproj", "{918B73A6-B6FF-46FE-8C96-8474A5BD648B}" | |||||
EndProject | EndProject | ||||
Global | Global | ||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
@@ -1518,26 +1518,26 @@ Global | |||||
{82D5C479-7C38-41D6-8B42-24D4EC32D94F}.Release|x64.Build.0 = Release|Any CPU | {82D5C479-7C38-41D6-8B42-24D4EC32D94F}.Release|x64.Build.0 = Release|Any CPU | ||||
{82D5C479-7C38-41D6-8B42-24D4EC32D94F}.Release|x86.ActiveCfg = Release|Any CPU | {82D5C479-7C38-41D6-8B42-24D4EC32D94F}.Release|x86.ActiveCfg = Release|Any CPU | ||||
{82D5C479-7C38-41D6-8B42-24D4EC32D94F}.Release|x86.Build.0 = Release|Any CPU | {82D5C479-7C38-41D6-8B42-24D4EC32D94F}.Release|x86.Build.0 = Release|Any CPU | ||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Debug|ARM.Build.0 = Debug|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Debug|ARM64.Build.0 = Debug|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Debug|x64.Build.0 = Debug|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Debug|x86.ActiveCfg = Debug|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Debug|x86.Build.0 = Debug|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Release|ARM.ActiveCfg = Release|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Release|ARM.Build.0 = Release|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Release|ARM64.ActiveCfg = Release|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Release|ARM64.Build.0 = Release|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Release|x64.ActiveCfg = Release|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Release|x64.Build.0 = Release|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Release|x86.ActiveCfg = Release|Any CPU | |||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B}.Release|x86.Build.0 = Release|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Debug|ARM.Build.0 = Debug|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Debug|ARM64.Build.0 = Debug|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Debug|x64.Build.0 = Debug|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Debug|x86.ActiveCfg = Debug|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Debug|x86.Build.0 = Debug|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Release|ARM.ActiveCfg = Release|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Release|ARM.Build.0 = Release|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Release|ARM64.ActiveCfg = Release|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Release|ARM64.Build.0 = Release|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Release|x64.ActiveCfg = Release|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Release|x64.Build.0 = Release|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Release|x86.ActiveCfg = Release|Any CPU | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B}.Release|x86.Build.0 = Release|Any CPU | |||||
EndGlobalSection | EndGlobalSection | ||||
GlobalSection(SolutionProperties) = preSolution | GlobalSection(SolutionProperties) = preSolution | ||||
HideSolutionNode = FALSE | HideSolutionNode = FALSE | ||||
@@ -1613,7 +1613,7 @@ Global | |||||
{CB3E9835-2FF2-4A76-A0EE-0819EEC8CAE7} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | {CB3E9835-2FF2-4A76-A0EE-0819EEC8CAE7} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | ||||
{2D2200CF-7A66-40EA-998A-F0CE9BC2B3BB} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | {2D2200CF-7A66-40EA-998A-F0CE9BC2B3BB} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | ||||
{82D5C479-7C38-41D6-8B42-24D4EC32D94F} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | {82D5C479-7C38-41D6-8B42-24D4EC32D94F} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | ||||
{52F2D7ED-6520-45EF-BCC4-565E5267973B} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | |||||
{918B73A6-B6FF-46FE-8C96-8474A5BD648B} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | |||||
EndGlobalSection | EndGlobalSection | ||||
GlobalSection(ExtensibilityGlobals) = postSolution | GlobalSection(ExtensibilityGlobals) = postSolution | ||||
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC} | SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC} | ||||