change - 界面调整

master
wenjy 2 days ago
parent 990d27d32f
commit 1ded801594

@ -96,19 +96,16 @@ namespace SlnMesnac.WPF
{
TcpClient tcpClient = new TcpClient();
var hashcode = tcpClient.GetHashCode();
tcpClient.Setup(new TouchSocketConfig()
.SetRemoteIPHost($"{item.equipIp}:{item.equipPort}"));
item.session = tcpClient;
//tcpClient.Connect();
tcpClient.Connect();
Result result = tcpClient.TryConnect();
if (result.IsSuccess())
{
item.session = tcpClient;
}
var hashcode2 = tcpClient.GetHashCode();
//Result result = tcpClient.TryConnect();
//if (result.IsSuccess())
//{
// item.session = tcpClient;
//}
}
}

@ -25,12 +25,12 @@
<Border Grid.Column="0" Background="#1352B2">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="MESNAC" FontSize="24" Foreground="White" FontFamily="四圆黑" FontWeight="Bold"/>
<TextBlock Text=" 软控" FontSize="24" Foreground="White" FontFamily="四圆黑" FontWeight="Bold"/>
<TextBlock Text=" 海威物联" FontSize="18" Foreground="White" FontFamily="四圆黑" FontWeight="Bold"/>
</StackPanel>
</Border>
<Border Grid.Column="1" Background="Transparent">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="工业高频RFID(测试展示)" FontSize="18" Foreground="White" FontFamily="四圆黑" FontWeight="Bold" Margin="20,0,0,0"/>
<TextBlock Text="工业高频RFID" FontSize="18" Foreground="White" FontFamily="四圆黑" FontWeight="Bold" Margin="20,0,0,0"/>
</StackPanel>
</Border>
<Border Grid.Column="2" Background="#0A56C7">

@ -265,7 +265,7 @@
<Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Border Grid.Row="0" BorderBrush="#1352B2" BorderThickness="10,0,0,0">
<TextBlock Text="产品尺寸mm" Foreground="#1550B7" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20,0,0,0"/>
<TextBlock Text="产品接口" Foreground="#1550B7" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20,0,0,0"/>
</Border>
</Border>

@ -87,25 +87,27 @@ namespace SlnMesnac.WPF.ViewModel.Index
[RelayCommand]
private void ReadEpcCode(string deviceCode)
{
string configKey = string.Empty;
if (deviceCode == "050-B" || deviceCode == "I68")
{
configKey = "I68";
}
else
{
configKey = deviceCode;
}
var rfidConfig = _appConfig.rfidConfig.Where(x => x.equipKey == configKey).FirstOrDefault();
try
{
string configKey = string.Empty;
if (deviceCode == "050-B" || deviceCode == "I68")
{
configKey = "I68";
}
else
{
configKey = deviceCode;
}
var rfidConfig = _appConfig.rfidConfig.Where(x => x.equipKey == configKey).FirstOrDefault();
if (rfidConfig != null)
{
var session = rfidConfig.session as TcpClient;
if (session != null)
{
session.Connect();
var waitClinet = session.CreateWaitingClient(new WaitingOptions()
{
FilterFunc = response =>
@ -172,30 +174,37 @@ namespace SlnMesnac.WPF.ViewModel.Index
NotifiactionType = EnumPromptType.Error
});
}
finally
{
var session = rfidConfig.session as TcpClient;
session.Close();
}
}
[RelayCommand]
private void WriteEpcCode(string deviceCode)
{
string configKey = string.Empty;
if (deviceCode == "050-B" || deviceCode == "I68")
{
configKey = "I68";
}
else
{
configKey = deviceCode;
}
var rfidConfig = _appConfig.rfidConfig.Where(x => x.equipKey == configKey).FirstOrDefault();
try
{
string configKey = string.Empty;
if (deviceCode == "050-B" || deviceCode == "I68")
{
configKey = "I68";
}
else
{
configKey = deviceCode;
}
var rfidConfig = _appConfig.rfidConfig.Where(x => x.equipKey == configKey).FirstOrDefault();
if (rfidConfig != null)
{
var session = rfidConfig.session as TcpClient;
if (session != null)
{
session.Connect();
var waitClinet = session.CreateWaitingClient(new WaitingOptions()
{
FilterFunc = response =>
@ -304,6 +313,12 @@ namespace SlnMesnac.WPF.ViewModel.Index
NotifiactionType = EnumPromptType.Error
});
}
finally
{
var session = rfidConfig.session as TcpClient;
session.Close();
}
}
[RelayCommand]

Loading…
Cancel
Save