软件增加功能:标定时记录上一次的历史电压
This commit is contained in:
@ -90,6 +90,11 @@
|
||||
SelectionChanged="dataGrid_SelectionChanged"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False" FontSize="13">
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu Name="dgmenu1" StaysOpen="true">
|
||||
<MenuItem Header="查询历史电压" Click="MenuItem_Click"/>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="货架编码" Binding="{Binding ShelfCode}"></DataGridTextColumn>
|
||||
|
@ -1,4 +1,5 @@
|
||||
using Ping9719.WpfEx;
|
||||
using HandyControl.Controls;
|
||||
using Ping9719.WpfEx;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@ -14,7 +15,10 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using WCS.Model.ApiModel.StoreInfo;
|
||||
using WCS.Model;
|
||||
using 智能仓储WCS管理系统.ViewModel;
|
||||
using 智能仓储WCS管理系统.Api;
|
||||
|
||||
namespace 智能仓储WCS管理系统
|
||||
{
|
||||
@ -86,5 +90,50 @@ namespace 智能仓储WCS管理系统
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//先获取选中的模组
|
||||
var storeInfo = viewModel.SelectedataGridItem;
|
||||
#region 调用接口 发送指令进行查询
|
||||
try
|
||||
{
|
||||
var body = new QueryStoreInfoHistoryVoltageRequest()
|
||||
{
|
||||
StoreIds = new List<int>() { storeInfo.Id },
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<StoreInfoHistoryVoltageModel>>>(LocalFile.Config.ApiIpHost + "storeInfo/queryStoreInfoHistoryVoltage", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
if (Result.Data == null || Result.Data.Count == 0)
|
||||
{
|
||||
Growl.Success("查询成功!该库位没有历史电压值数据!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Success("查询成功!请查看弹窗内数据!");
|
||||
var window = new StoreInfoHistoryVoltageWindow(Result.Data, storeInfo.StoreCode);
|
||||
window.ShowDialog();
|
||||
}
|
||||
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Success(Result.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Warning("查询失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ namespace 智能仓储WCS管理系统
|
||||
Growl.Success("发送标定指令成功!");
|
||||
this.Close();
|
||||
}
|
||||
else if (Result != null)
|
||||
else if (Result1 != null)
|
||||
{
|
||||
Growl.Error(Result1.Message);
|
||||
}
|
||||
|
27
货架标准上位机/Views/Windows/StoreInfoHistoryVoltageWindow.xaml
Normal file
27
货架标准上位机/Views/Windows/StoreInfoHistoryVoltageWindow.xaml
Normal file
@ -0,0 +1,27 @@
|
||||
<Window x:Class="智能仓储WCS管理系统.StoreInfoHistoryVoltageWindow"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Title="电压历史数据(标定时记录上一次数据)" Height="650" Width="660" ResizeMode="NoResize" FontSize="25"
|
||||
Icon="/Resources/Logo.ico" WindowStartupLocation="CenterScreen" >
|
||||
<Grid Background="AliceBlue">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="库位编码" Name="storeCodeTxt" FontSize="40" HorizontalAlignment="Center"></TextBlock>
|
||||
<DataGrid Grid.Row="1" Name="dataGrid" FontSize="15" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="电压标准值" Binding="{Binding StandardVoltage}" Width="*"/>
|
||||
<DataGridTextColumn Header="电压偏移值" Binding="{Binding OffsetVoltage}" Width="*"/>
|
||||
<DataGridTextColumn Header="电压当前值" Binding="{Binding CurrentVoltage}" Width="*"/>
|
||||
<DataGridTextColumn Header="记录时间" Binding="{Binding CreateTime,StringFormat='yyyy-MM-dd HH:mm:ss'}" Width="1.5*"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Content="关闭" Height="45" FontSize="28" Grid.Row="2" Click="Button_Click"></Button>
|
||||
</Grid>
|
||||
</Window>
|
44
货架标准上位机/Views/Windows/StoreInfoHistoryVoltageWindow.xaml.cs
Normal file
44
货架标准上位机/Views/Windows/StoreInfoHistoryVoltageWindow.xaml.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using HandyControl.Controls;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
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;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel;
|
||||
using WCS.Model.ApiModel.StoreInfo;
|
||||
using WCS.Model.ApiModel.User;
|
||||
using 智能仓储WCS管理系统.Api;
|
||||
|
||||
namespace 智能仓储WCS管理系统
|
||||
{
|
||||
/// <summary>
|
||||
/// CalibrationWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class StoreInfoHistoryVoltageWindow : System.Windows.Window
|
||||
{
|
||||
public StoreInfoHistoryVoltageWindow(List<StoreInfoHistoryVoltageModel> list,string storeCode)
|
||||
{
|
||||
InitializeComponent();
|
||||
dataGrid.ItemsSource = list;
|
||||
this.storeCodeTxt.Text = storeCode;
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
@ -8,8 +8,8 @@
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Company>重庆盟讯电子科技有限公司</Company>
|
||||
<Copyright>Copyright © 2024</Copyright>
|
||||
<AssemblyVersion>1.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0</FileVersion>
|
||||
<AssemblyVersion>1.0.1</AssemblyVersion>
|
||||
<FileVersion>1.0.1</FileVersion>
|
||||
<ApplicationIcon>Resources\Logo.ico</ApplicationIcon>
|
||||
<Authors>重庆盟讯电子科技有限公司</Authors>
|
||||
<Product>智能仓储WCS管理系统</Product>
|
||||
|
Reference in New Issue
Block a user