Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1d6c2a99c9 | ||
![]() |
380a5e6b7c | ||
![]() |
4000c331ac |
@ -17,22 +17,22 @@ public static class ServiceExtensions
|
|||||||
services.AddSingleton<ISqlSugarClient>(s =>
|
services.AddSingleton<ISqlSugarClient>(s =>
|
||||||
{
|
{
|
||||||
//#if RELEASE
|
//#if RELEASE
|
||||||
// SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig()
|
|
||||||
// {
|
|
||||||
// DbType = DbType.SqlServer,
|
|
||||||
// ConnectionString = connectionString,
|
|
||||||
// IsAutoCloseConnection = true,
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
//#elif DEBUG
|
|
||||||
SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig()
|
SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
DbType = DbType.Sqlite,
|
DbType = DbType.SqlServer,
|
||||||
ConnectionString = "Data Source=hyosung.db",
|
ConnectionString = connectionString,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
InitKeyType = InitKeyType.Attribute
|
}
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
//#elif DEBUG
|
||||||
|
//SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig()
|
||||||
|
// {
|
||||||
|
// DbType = DbType.Sqlite,
|
||||||
|
// ConnectionString = "Data Source=hyosung.db",
|
||||||
|
// IsAutoCloseConnection = true,
|
||||||
|
// InitKeyType = InitKeyType.Attribute
|
||||||
|
// }
|
||||||
|
//);
|
||||||
//#endif
|
//#endif
|
||||||
return sqlSugar;
|
return sqlSugar;
|
||||||
});
|
});
|
||||||
@ -50,14 +50,13 @@ public static class ServiceExtensions
|
|||||||
|
|
||||||
public static void UseHyosungData(this IServiceProvider provider)
|
public static void UseHyosungData(this IServiceProvider provider)
|
||||||
{
|
{
|
||||||
var db = provider.GetRequiredService<ISqlSugarClient>();
|
//var db = provider.GetRequiredService<ISqlSugarClient>();
|
||||||
db.DbMaintenance.CreateDatabase();
|
//db.DbMaintenance.CreateDatabase();
|
||||||
db.CodeFirst.InitTables(typeof(VarietyEntity),
|
//db.CodeFirst.InitTables(typeof(VarietyEntity),
|
||||||
typeof(PalletEntity),
|
// typeof(PalletEntity),
|
||||||
typeof(ScannedYarnEntity),
|
// typeof(ScannedYarnEntity),
|
||||||
typeof(TrayEntity),
|
// typeof(TrayEntity),
|
||||||
typeof(AgvBinEntity),
|
// typeof(AgvBinEntity),
|
||||||
typeof(DictEntity)
|
// typeof(DictEntity));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -53,22 +53,23 @@ public class ReportExportService(
|
|||||||
{
|
{
|
||||||
DataTable dt = new DataTable();
|
DataTable dt = new DataTable();
|
||||||
dt.Columns.Add("LOT");
|
dt.Columns.Add("LOT");
|
||||||
dt.Columns.Add("DTEX_FILA");
|
dt.Columns.Add("DEN");
|
||||||
dt.Columns.Add("总个数/垛");
|
dt.Columns.Add("总个数/垛");
|
||||||
dt.Columns.Add("生产时间");
|
dt.Columns.Add("生产时间");
|
||||||
dt.Columns.Add("机台");
|
dt.Columns.Add("机台");
|
||||||
dt.Columns.Add("班次");
|
dt.Columns.Add("班次");
|
||||||
|
dt.Columns.Add("码垛时间");
|
||||||
for (int i = 1; i <= yarns.Count; i++)
|
for (int i = 1; i <= yarns.Count; i++)
|
||||||
{
|
{
|
||||||
if (i == 1)
|
if (i == 1)
|
||||||
{
|
{
|
||||||
dt.Rows.Add(yarns[i - 1].Lot, tray.DtexFila, yarns.Count, yarns[i - 1].ProduceTime,
|
dt.Rows.Add(yarns[i - 1].Lot, tray.DenFila, yarns.Count, yarns[i - 1].ProduceTime,
|
||||||
yarns[i - 1].Machine, yarns[i - 1].WorkShift);
|
yarns[i - 1].Machine, yarns[i - 1].WorkShift, yarns[i - 1].StackTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dt.Rows.Add(yarns[i - 1].Lot, tray.DtexFila, " ", yarns[i - 1].ProduceTime,
|
dt.Rows.Add(yarns[i - 1].Lot, tray.DenFila, " ", yarns[i - 1].ProduceTime,
|
||||||
yarns[i - 1].Machine, yarns[i - 1].WorkShift);
|
yarns[i - 1].Machine, yarns[i - 1].WorkShift,yarns[i - 1].StackTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ public class HyosungRuntime(
|
|||||||
|
|
||||||
public async Task StartAsync(CancellationToken token)
|
public async Task StartAsync(CancellationToken token)
|
||||||
{
|
{
|
||||||
//reportExportService.ExportNoExportAsync();
|
reportExportService.ExportNoExportAsync();
|
||||||
//启动扫码服务
|
//启动扫码服务
|
||||||
// await hyosungScannerService.StartAsync(token);
|
await hyosungScannerService.StartAsync(token);
|
||||||
// await printer.StartAsync(token);
|
await printer.StartAsync(token);
|
||||||
//最后启动PLC服务
|
//最后启动PLC服务
|
||||||
hyosungPlcService.OnPlcRequestScanProduct += OnPlcRequestScanProduct;
|
hyosungPlcService.OnPlcRequestScanProduct += OnPlcRequestScanProduct;
|
||||||
hyosungPlcService.OnPlcRequestScanFixture += OnPlcRequestScanFixture;
|
hyosungPlcService.OnPlcRequestScanFixture += OnPlcRequestScanFixture;
|
||||||
@ -52,7 +52,7 @@ public class HyosungRuntime(
|
|||||||
hyosungPlcService.OnRequestPrintLabel += OnPlcRequestPrintLabel;
|
hyosungPlcService.OnRequestPrintLabel += OnPlcRequestPrintLabel;
|
||||||
hyosungPlcService.OnRequestGetPrintLableOption += OnRequestGetPrintLabel;
|
hyosungPlcService.OnRequestGetPrintLableOption += OnRequestGetPrintLabel;
|
||||||
hyosungPlcService.OnRequestScanEntry += OnPlcRequestScanEntry;
|
hyosungPlcService.OnRequestScanEntry += OnPlcRequestScanEntry;
|
||||||
// await hyosungPlcService.StartAsync(token);
|
await hyosungPlcService.StartAsync(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnPlcRequestScanEntry(int arg)
|
private async Task OnPlcRequestScanEntry(int arg)
|
||||||
@ -204,10 +204,10 @@ public class HyosungRuntime(
|
|||||||
{
|
{
|
||||||
await trayService.StorageAsync(info.TrayCode);
|
await trayService.StorageAsync(info.TrayCode);
|
||||||
|
|
||||||
|
reportExportService.ExportSampleAsync(info.TrayCode);
|
||||||
await hyosungAgvService.StorageAsync(info.TrayCode);
|
await hyosungAgvService.StorageAsync(info.TrayCode);
|
||||||
//标志下线已完成
|
//标志下线已完成
|
||||||
await hyosungPlcService.LeaveCompletedAsync();
|
await hyosungPlcService.LeaveCompletedAsync();
|
||||||
await reportExportService.ExportSampleAsync(info.TrayCode);
|
|
||||||
logger.LogInformation($"plc leaving production line success");
|
logger.LogInformation($"plc leaving production line success");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -16,8 +16,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HyosungTester", "HyosungTes
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Seyounth.Hyosung", "Seyounth.Hyosung\Seyounth.Hyosung.csproj", "{16C5CC9B-FEA9-4B1E-805F-C6DBF5865DC0}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Seyounth.Hyosung", "Seyounth.Hyosung\Seyounth.Hyosung.csproj", "{16C5CC9B-FEA9-4B1E-805F-C6DBF5865DC0}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{7501BD09-1C80-49A5-AA06-C4254F666407}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -41,15 +41,15 @@ public partial class HomeViewModel : ObservableObject
|
|||||||
_yarnCarSide = new();
|
_yarnCarSide = new();
|
||||||
_yarnCarSide.Add("正面");
|
_yarnCarSide.Add("正面");
|
||||||
_yarnCarSide.Add("反面");
|
_yarnCarSide.Add("反面");
|
||||||
// _varieties = new ObservableCollection<Variety>(varietyService.GetAll());
|
_varieties = new ObservableCollection<Variety>(varietyService.GetAll());
|
||||||
DispatcherTimer timer = new DispatcherTimer();
|
DispatcherTimer timer = new DispatcherTimer();
|
||||||
// timer = new DispatcherTimer();
|
timer = new DispatcherTimer();
|
||||||
// // 设置定时器间隔,这里设置为 1 秒,可根据实际需求调整
|
// 设置定时器间隔,这里设置为 1 秒,可根据实际需求调整
|
||||||
// timer.Interval = TimeSpan.FromSeconds(1);
|
timer.Interval = TimeSpan.FromSeconds(1);
|
||||||
// // 为定时器的 Tick 事件添加处理方法
|
// 为定时器的 Tick 事件添加处理方法
|
||||||
// timer.Tick += Timer_Tick;
|
timer.Tick += Timer_Tick;
|
||||||
// // 启动定时器
|
// 启动定时器
|
||||||
// timer.Start();
|
timer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Timer_Tick(object? sender, EventArgs e)
|
private void Timer_Tick(object? sender, EventArgs e)
|
||||||
|
@ -32,15 +32,6 @@
|
|||||||
<DockPanel>
|
<DockPanel>
|
||||||
|
|
||||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
|
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
|
||||||
<Menu Padding="0,0,30,0">
|
|
||||||
<MenuItem
|
|
||||||
Header="Admin">
|
|
||||||
<MenuItem
|
|
||||||
Header="Item 1" />
|
|
||||||
<MenuItem
|
|
||||||
Header="Item 2" />
|
|
||||||
</MenuItem>
|
|
||||||
</Menu>
|
|
||||||
<Button x:Name="One" Margin="-20,-20,10,-20"
|
<Button x:Name="One" Margin="-20,-20,10,-20"
|
||||||
Content="_"
|
Content="_"
|
||||||
Command="{Binding ViewModel.MinimizeCommand}" />
|
Command="{Binding ViewModel.MinimizeCommand}" />
|
||||||
@ -115,38 +106,6 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem>
|
|
||||||
<TabItem.Header>
|
|
||||||
<StackPanel
|
|
||||||
Width="auto"
|
|
||||||
Height="auto">
|
|
||||||
<materialDesign:PackIcon
|
|
||||||
Width="24"
|
|
||||||
Height="24"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Kind="Label" />
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Text="标签管理" />
|
|
||||||
</StackPanel>
|
|
||||||
</TabItem.Header>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem>
|
|
||||||
<TabItem.Header>
|
|
||||||
<StackPanel
|
|
||||||
Width="auto"
|
|
||||||
Height="auto">
|
|
||||||
<materialDesign:PackIcon
|
|
||||||
Width="24"
|
|
||||||
Height="24"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Kind="Storage" />
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Text="入库管理" />
|
|
||||||
</StackPanel>
|
|
||||||
</TabItem.Header>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem>
|
<TabItem>
|
||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
|
@ -1,91 +0,0 @@
|
|||||||
<Page x:Class="Seyounth.Hyosung.Views.Pages.LabelManagementViewPage"
|
|
||||||
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:Seyounth.Hyosung.Views.Pages"
|
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="800" d:DesignWidth="1500"
|
|
||||||
d:DataContext="{d:DesignInstance local:LabelManagementViewPage,
|
|
||||||
IsDesignTimeCreatable=True}">
|
|
||||||
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<ToolBarTray>
|
|
||||||
<ToolBar ClipToBounds="False"
|
|
||||||
Style="{StaticResource MaterialDesignToolBar}">
|
|
||||||
<ComboBox Margin="8"
|
|
||||||
FontSize="20"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Width="400"
|
|
||||||
materialDesign:HintAssist.Hint="请选择查询条件"
|
|
||||||
materialDesign:TextFieldAssist.HasClearButton="False"
|
|
||||||
IsEditable="False"
|
|
||||||
ItemsSource="{Binding ViewModel.Varieties}"
|
|
||||||
DisplayMemberPath="Code"
|
|
||||||
Style="{StaticResource MaterialDesignOutlinedComboBox}">
|
|
||||||
</ComboBox>
|
|
||||||
<Button Content="{materialDesign:PackIcon Kind=Search}" />
|
|
||||||
<Separator />
|
|
||||||
<TextBox Margin="8"
|
|
||||||
Width="100"
|
|
||||||
FontSize="20"
|
|
||||||
HorizontalContentAlignment="Left"
|
|
||||||
materialDesign:HintAssist.Hint="LOT"
|
|
||||||
Style="{StaticResource MaterialDesignOutlinedTextBox}" />
|
|
||||||
<Button Content="{materialDesign:PackIcon Kind=Search}" />
|
|
||||||
<Separator />
|
|
||||||
<DatePickerTextBox>
|
|
||||||
|
|
||||||
</DatePickerTextBox>
|
|
||||||
<Button x:Name="TrayManagerButton"
|
|
||||||
Content="{materialDesign:PackIcon Kind=ShippingPallet}"
|
|
||||||
ToolTip="托盘/隔板管理" />
|
|
||||||
</ToolBar>
|
|
||||||
</ToolBarTray>
|
|
||||||
<DataGrid Margin="10" x:Name="LabelManagementDataGrid"
|
|
||||||
Grid.Row="1"
|
|
||||||
ItemsSource="{Binding ViewModel.Labels}"
|
|
||||||
AutoGenerateColumns="False"
|
|
||||||
CanUserAddRows="False"
|
|
||||||
CanUserDeleteRows="False"
|
|
||||||
CanUserReorderColumns="False"
|
|
||||||
CanUserResizeRows="False"
|
|
||||||
CanUserSortColumns="False"
|
|
||||||
SelectionMode="Extended"
|
|
||||||
SelectionUnit="CellOrRowHeader"
|
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
RowDetailsVisibilityMode="VisibleWhenSelected">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTextColumn Header="LOT"
|
|
||||||
Binding="{Binding Code}"
|
|
||||||
Width="80" />
|
|
||||||
<DataGridTextColumn Header="品类"
|
|
||||||
Binding="{Binding Variety.Code}"
|
|
||||||
Width="120" />
|
|
||||||
<DataGridTextColumn Header="条码"
|
|
||||||
Binding="{Binding Variety.Code}"
|
|
||||||
Width="400" />
|
|
||||||
<DataGridTextColumn Header="数量"
|
|
||||||
Binding="{Binding Quantity}"
|
|
||||||
Width="*" />
|
|
||||||
<DataGridTextColumn Header="控制号"
|
|
||||||
Binding="{Binding Status}"
|
|
||||||
Width="*" />
|
|
||||||
<DataGridTextColumn Header="贴标时间"
|
|
||||||
Binding="{Binding Tray}"
|
|
||||||
Width="*" />
|
|
||||||
<DataGridCheckBoxColumn Header="已发布"
|
|
||||||
Binding="{Binding Pallet}"
|
|
||||||
Width="80" />
|
|
||||||
<DataGridTextColumn Header="操作"
|
|
||||||
Binding="{Binding Pallet}"
|
|
||||||
Width="140" />
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</Grid>
|
|
||||||
</Page>
|
|
@ -1,11 +0,0 @@
|
|||||||
using System.Windows.Controls;
|
|
||||||
|
|
||||||
namespace Seyounth.Hyosung.Views.Pages;
|
|
||||||
|
|
||||||
public partial class LabelManagementViewPage : Page
|
|
||||||
{
|
|
||||||
public LabelManagementViewPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user