Browse Source

设备更新

master
pry 2 years ago
parent
commit
6a189c78f2
7 changed files with 53 additions and 56 deletions
  1. +0
    -6
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  2. +37
    -36
      BPASmartClient.CustomResource/RecDictionarys/RecToggleButton.xaml
  3. BIN
     
  4. +1
    -1
      BPASmartClient.DosingProject/ViewModel/RecipeInfosViewModel.cs
  5. +6
    -6
      BPASmartClient.DosingProject/ViewModel/RecipeReceiveViewModel.cs
  6. +5
    -5
      BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceInquire.cs
  7. +4
    -2
      DosingSystem/View/StockControlView.xaml

+ 0
- 6
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj View File

@@ -269,12 +269,6 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Content Include="Videos\Login.mp4">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<Resource Include="Fonts\80号-萌趣小鱼体.ttf" />
<Resource Include="Fonts\font\iconfont.ttf" />


+ 37
- 36
BPASmartClient.CustomResource/RecDictionarys/RecToggleButton.xaml View File

@@ -63,43 +63,44 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid x:Name="gr" Opacity="0.8">
<Border
x:Name="border2"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
HorizontalAlignment="Left"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Background="Red"
BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="15">
<ContentPresenter
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
<Viewbox>
<Grid x:Name="gr" Opacity="0.8">
<Border
x:Name="border2"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
HorizontalAlignment="Left"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>

<Ellipse
Name="ell"
Width="{TemplateBinding Height}"
Height="{TemplateBinding Height}"
Margin="0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Fill="#ddd" />

<TextBlock
Name="tb"
Margin="10,0,10,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="White"
Text="开" />

</Grid>

Background="Red"
BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="15">
<ContentPresenter
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>

<Ellipse
Name="ell"
Width="{TemplateBinding Height}"
Height="{TemplateBinding Height}"
Margin="0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Fill="#ddd" />

<TextBlock
Name="tb"
Margin="10,0,10,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="White"
Text="开" />

</Grid>
</Viewbox>
<ControlTemplate.Triggers>
<!--<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" Value="#FFd2e7f4" />


BIN
View File


+ 1
- 1
BPASmartClient.DosingProject/ViewModel/RecipeInfosViewModel.cs View File

@@ -24,7 +24,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
{
RecipeName = rm.RecipeName;
RecipeCode = rm.RecipeCode;
TrayCode = rm.TrayCode;
//TrayCode = rm.TrayCode;
foreach (var item in rm.RawMaterial)
{
RawMaterialsInfo.Add(item);


+ 6
- 6
BPASmartClient.DosingProject/ViewModel/RecipeReceiveViewModel.cs View File

@@ -29,7 +29,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
public RecipeReceiveViewModel()
{
Recipes = Json<LocalRecipeDataColl>.Data.Recipes;
NewRecipe = new RelayCommand(() =>
{
NewLocalRecipeView NewLocalRecipe = new NewLocalRecipeView();
@@ -76,7 +76,7 @@ namespace BPASmartClient.DosingHKProject.ViewModel
});
NewSimulateRecipe = new RelayCommand(() =>
{
ObservableCollection<RemoteRecipeRawMaterial> RawMaterials = new ObservableCollection<RemoteRecipeRawMaterial>();
ObservableCollection<RemoteRecipeRawMaterial> RawMaterials = new ObservableCollection<RemoteRecipeRawMaterial>();
string recipeName = "配方" + (Json<LocalRecipeDataColl>.Data.Recipes.Count + 1) + "";
go:
string recipeCode = new Random().Next(1000, 9999).ToString();
@@ -105,21 +105,21 @@ namespace BPASmartClient.DosingHKProject.ViewModel
{
RecipeName = recipeName,
RecipeCode = recipeCode,
TrayCode = trayCode,
//TrayCode = trayCode,
RawMaterial = RawMaterials,
});
}

});
ClearAllRecipe = new RelayCommand(() =>
ClearAllRecipe = new RelayCommand(() =>
{
Json<LocalRecipeDataColl>.Data.Recipes.Clear();
});
}
}
public RelayCommand<object> DetailsCommand { get; set; }
public RelayCommand<object> IssueRecipe { get; set; }
public RelayCommand<object> RemoveRecipe { get; set; }
public RelayCommand NewSimulateRecipe { get;set; }
public RelayCommand NewSimulateRecipe { get; set; }
public RelayCommand ClearAllRecipe { get; set; }
public RelayCommand NewRecipe { get; set; }
public ObservableCollection<RemoteRecipeData> Recipes { get; set; }


+ 5
- 5
BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/DeviceInquire.cs View File

@@ -72,7 +72,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
DeviceNum = i + 1,
RunStatus = 1,
Weight = new Random().Next(100, 10000) / 100.0
});

devices.Add(new Devices()
@@ -217,7 +217,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
{
if (Global.DeviceRawMaterials.FirstOrDefault(p => p.RawMaterialName == DeviceName) == null)
{
Global.DeviceRawMaterials.Add(new RawMaterialModel() { RawMaterialName = DeviceName, DeviceIp = ip, RawMaterialSource = 1});
Global.DeviceRawMaterials.Add(new RawMaterialModel() { RawMaterialName = DeviceName, DeviceIp = ip, RawMaterialSource = 1 });
}
}
else
@@ -320,7 +320,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
AlarmHelper<AlarmInfo>.Alarm.EStop2 = deviceStatus.DeviceAlarmCode.Get16bitValue(7);
AlarmHelper<AlarmInfo>.Alarm.SiloUpperLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(8);
AlarmHelper<AlarmInfo>.Alarm.SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9);
Thread.Sleep(10);
}), $"{DeviceName} 开始监听", true);
}
@@ -334,7 +334,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model

public string StatusReset()
{
return this.modbusTcp.Write(DeviceAddress.FinfishStatus, (ushort)1);
return this.modbusTcp.Write(DeviceAddress.FinfishStatus, (ushort)1).ToString();
//var res = modbusTcp.Read(DeviceAddress.RunStatus);
}

@@ -348,7 +348,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
if (modbusTcp.Connected)
{
modbusTcp.SetReal(DeviceAddress.WeightSet, Value);//写入配方量
string returnValue = modbusTcp.Write(DeviceAddress.Start, (ushort)1);//设备启动写入
string returnValue = modbusTcp.Write(DeviceAddress.Start, (ushort)1).ToString();//设备启动写入
if (returnValue.Substring(0, 2) == "成功")
{
MessageLog.GetInstance.ShowRunLog("发送成功" + returnValue);


+ 4
- 2
DosingSystem/View/StockControlView.xaml View File

@@ -76,7 +76,7 @@
<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="6"
Columns="8"
Rows="1" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
@@ -87,12 +87,14 @@
<RowDefinition Height="0.8*" />
<RowDefinition Height="0.2*" />
</Grid.RowDefinitions>

<define:MaterialStock
Margin="35,0,35,0"
IsFaultState="{Binding IsFault}"
IsLayOffState="{Binding IsLayOff}"
IsOpenState="{Binding IsOpen}"
IsRunning="{Binding RunStatus}" />

<Grid Grid.Row="1" VerticalAlignment="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition />
@@ -249,7 +251,7 @@
<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="6"
Columns="8"
Rows="1" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>


Loading…
Cancel
Save