vergessen

This commit is contained in:
Roland Drabesch
2022-06-21 12:54:26 +02:00
parent 482e69803d
commit 768d4e110a
28 changed files with 612 additions and 776 deletions
+2 -2
View File
@@ -6,13 +6,13 @@
<appSettings>
<add key="PickingSlot" value="1"/>
<add key="PickingBarcode" value="COM20"/>
<add key="PickingBarcode" value="COM22"/>
<add key="LeakSlot" value="2"/>
<add key="LeakStationId" value="1"/>
<add key="MarriageSlot" value="4"/>
<add key="MarriageBarcode" value="COM21"/>
<add key="MarriageBarcode" value="COM19"/>
</appSettings>
@@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D0C8D887-ED52-40AB-A069-90BCE0E801E2}</ProjectGuid>
<OutputType>WinExe</OutputType>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xylem.Common.Ui.CordonelPreadjustmentUi</RootNamespace>
<AssemblyName>Xylem.Common.Ui.CordonelPreadjustmentUi</AssemblyName>
@@ -99,6 +99,7 @@
<PropertyGroup />
<PropertyGroup />
<PropertyGroup />
<PropertyGroup />
<PropertyGroup>
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>
@@ -100,7 +100,7 @@ namespace CordonelPreadjustmentUi.Processes.Actions
Ok = WriteRegisterSafe(meterctl.Meter, "Samplerate", Register.Genesisflow.SampleRate, pp.Setting.Samplerate);
if (CheckAbort(Ok, meterctl)) { return Ok; }
Ok = WriteRegisterSafe(meterctl.Meter, "Metersize", Register.Genesisflow.MeterSize, pp.Setting.MeterSize.GetHashCode());
Ok = WriteRegisterSafe(meterctl.Meter, "Metersize", Register.Genesisflow.MeterSize, pp.Setting.MeterSize.GetHashCode(), false);
if (CheckAbort(Ok, meterctl)) { return Ok; }
Ok = WriteRegisterSafe(meterctl.Meter, "LED mode", Register.Genesisflow.LedMode, pp.Setting.LedMode.GetHashCode());
@@ -118,7 +118,7 @@ namespace CordonelPreadjustmentUi.Processes.Actions
foreach (var item in dt)
{
Ok = meterctl.Meter.WriteRegisterSafe(item.Key, item.Value);
Ok = meterctl.Meter.WriteRegisterUnsafe(item.Key, item.Value);
if (CheckAbort(Ok, meterctl)) { return Ok; }
}
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Logic.ProductionOrderCore.Csd;
using Xylem.Common.Logic.ProductionOrderCore.Vako;
using Xylem.Common.Logic.SoftwareAccessHelper;
@@ -122,7 +123,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
var sb = new StringBuilder();
sb.AppendLine($" SELECT ");
sb.AppendLine($" CordonelDnDisplayunitDisplaypow10_RegisterIdent as RegisterName, ");
sb.AppendLine($" CAST([CordonelDnDisplayunitDisplaypow10_DisplayPow10] AS varbinary) as RegisterValue ");
sb.AppendLine($" [CordonelDnDisplayunitDisplaypow10_DisplayPow10] as RegisterValue ");
sb.AppendLine($" FROM [Auftrag].[dbo].[CordonelDnDisplayunitDisplaypow10] ");
sb.AppendLine($" where [CordonelDnDisplayunitDisplaypow10_MeterSize] = {MeterSize} ");
sb.AppendLine($" and [CordonelDnDisplayunitDisplaypow10_DisplayUnit] = {DisplayUnits} ");
@@ -138,11 +139,11 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
foreach (DataRow row in MapData.Rows)
{
ret.Add(new ProgrammingParameters(row["RegisterName"].ToString(), (byte[])row["RegisterValue"], ProgrammingSource.Vako));
//ret.Add(new ProgrammingParameters(row["RegisterName"].ToString(), RegisterConverter.ConvertFrom<sbyte>((sbyte)row["RegisterValue"]), ProgrammingSource.Vako));
}
}
var retStr = LocalWebRequest.GetRequest($"http://sla12iis01/csdcore/csdservice/getstampings?CsdIdent={CsdIdent}&GroupId=1&ProductIdent=GNS&ProductDn={rawVako.Dn}&ShowOnlyValidStampings=0", 8000);
var retStr = LocalWebRequest.GetRequest($"http://sla12iis01/csdcore/csdservice/getstampings?CsdIdent={CsdIdent}&GroupId=1&ProductIdent=GNS&ProductDn={rawVako.Dn}&ShowOnlyValidStampings=0", 8000);
var retListRealCsd = JsonConvert.DeserializeObject<List<CsdParameterResult>>(retStr);
if (retListRealCsd.Any())
{
@@ -29,7 +29,6 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
//ret.EncryptionKey = DefEncryptionKey.ToArray();
using (var dataAccess = new SqlDataAccess(connectionString))
@@ -114,6 +114,10 @@
<Project>{0E524D43-7B66-45CD-AA74-41D51AFC3D99}</Project>
<Name>DataPackages</Name>
</ProjectReference>
<ProjectReference Include="..\..\Hardware\WaterMeter\Genesis\Registers\Registers.csproj">
<Project>{F4AAF7E6-7333-4284-B735-E32DEB076C64}</Project>
<Name>Registers</Name>
</ProjectReference>
<ProjectReference Include="..\..\SoftwareAccessHelper\SoftwareAccessHelper.csproj">
<Project>{A33E3C6D-EAAE-4A20-A0EE-F9E6922FD029}</Project>
<Name>SoftwareAccessHelper</Name>
+1 -1
View File
@@ -100,7 +100,7 @@
<Label Content="Warte auf Zähler" Name="lblCurrentProcess" Margin="10,3,10,0" VerticalAlignment="Top" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3" Height="26" />
<DataGrid Name="dgTotalProcess" ItemsSource="{Binding}" AutoGenerateColumns="True" HorizontalAlignment="Left" Margin="10,4,0,5" Width="253" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" Grid.RowSpan="2" SelectionMode="Single" IsReadOnly="True" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" IsEnabled="False"/>
<DockPanel Name="dpSubProcess" Grid.Column="2" Height="218" Margin="10,4,0,0" Grid.Row="4" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="332" Grid.ColumnSpan="2"/>
<DockPanel Name="dpSubProcess" Grid.Column="2" Height="220" Margin="10,4,0,0" Grid.Row="4" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="330" Grid.ColumnSpan="2"/>
<TextBox Name="txtLog" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="7" TextWrapping="Wrap" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,73,10" />
<ProgressBar Name="pbTotalProgress" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="6" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,73,0" />
@@ -136,7 +136,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
Meter.WriteLog($"totalUsed at EOL {totalUsed}");
if (totalUsed > 15)
if (totalUsed > 10)
{
base.currentProcessState = ProductionProcessState.Error;
UserControl.lblText.Content = $"Batterie über 15% entladen";
@@ -117,53 +117,31 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
foreach (var item in myJsonResponse.Where(m => m.Source == ProgrammingSource.Vako))
{
if (!item.RegisterName.Contains("GENESISFLOW_DisplayPow10")
&& !item.RegisterName.ToLower().Contains("apparrangement")
)
if (item.RegisterName.ToLower().Contains("SENSUSRADIO_EncryptionKey".ToLower()))
{
overAllResult.Add(_currentGenesis_WriteRegister(item.RegisterName, item.RegisterValue.ToArray(), true, true));
}
else if (!item.RegisterName.ToLower().Contains("apparrangement"))
{
overAllResult.Add(_currentGenesis_WriteRegister(item.RegisterName, item.RegisterValue.Reverse().ToArray(), true, true));
}
if (item.RegisterName.Contains("pulse"))
{
}
if (item.RegisterName.Contains("GENESISFLOW_DisplayPow10"))
{
overAllResult.Add(_currentGenesis_WriteRegister(item.RegisterName, 253, true, true));
}
}
overAllResult.Add(_currentGenesis_WriteRegister("CUSTOMER_AlarmEnableMask", new byte[] { 0x00, 0x00, 0x80, 0x53 }.Reverse().ToArray(), true, false)); ;
overAllResult.Add(_currentGenesis_WriteRegister("CUSTOMER_AlarmBroadcastMask", new byte[] { 0x00, 0x00, 0x1f, 0xdc }.Reverse().ToArray(), true, false));
overAllResult.Add(_currentGenesis_WriteRegister("CUSTOMER_AlarmVisualMask", new byte[] { 0x00, 0x00, 0x1f, 0xdc }.Reverse().ToArray(), true, false));
foreach (var item in myJsonResponse.Where(m => m.Source == ProgrammingSource.Csd))
{
if (!item.RegisterName.Contains("GENESISFLOW_DisplayPow10")
&& !item.RegisterName.ToLower().Contains("apparrangement")
&& !item.RegisterName.ToLower().Contains("SENSUSRADIO_EncryptionKey")
)
{
overAllResult.Add(_currentGenesis_WriteRegister(item.RegisterName, item.RegisterValue.Reverse().ToArray(), true, true));
}
if (item.RegisterName.Contains("SENSUSRADIO_EncryptionKey"))
if (item.RegisterName.ToLower().Contains("SENSUSRADIO_EncryptionKey".ToLower()))
{
overAllResult.Add(_currentGenesis_WriteRegister(item.RegisterName, item.RegisterValue.ToArray(), true, true));
}
if (item.RegisterName.Contains("pulse"))
else if (!item.RegisterName.ToLower().Contains("apparrangement"))
{
overAllResult.Add(_currentGenesis_WriteRegister(item.RegisterName, item.RegisterValue.Reverse().ToArray(), true, true));
}
if (item.RegisterName.Contains("GENESISFLOW_DisplayPow10"))
{
overAllResult.Add(_currentGenesis_WriteRegister(item.RegisterName, 253, true, true));
}
}
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_ResetAccumulators",
@@ -187,11 +165,8 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_ResetCounter",
(new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, false));
overAllResult.Add(_currentGenesis_WriteRegister("CUSTOMER_AlarmEnableMask", new byte[] { 0x00, 0x00, 0x80, 0x53 }.Reverse().ToArray(), true, false)); ;
overAllResult.Add(_currentGenesis_WriteRegister("CUSTOMER_AlarmBroadcastMask", new byte[] { 0x00, 0x00, 0x1f, 0xdc }.Reverse().ToArray(), true, false));
overAllResult.Add(_currentGenesis_WriteRegister("CUSTOMER_AlarmVisualMask", new byte[] { 0x00, 0x00, 0x1f, 0xdc }.Reverse().ToArray(), true, false));
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_SealDisplay",
@@ -213,7 +188,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
}
else
{
if (cTask.Result.Item1.ToLower().Contains("Metersize".ToLower()) || cTask.Result.Item1.ToLower() == "SENSUSRADIO_MetroRadioLifeTimeCounter".ToLower() || cTask.Result.Item1.ToLower() == "CUSTOMER_LeakFlowThreshold".ToLower() || cTask.Result.Item1.ToLower() == "CUSTOMER_ExcessFlowVolumeThreshold".ToLower())
if (cTask.Result.Item1.ToLower().Contains("Metersize".ToLower()) || cTask.Result.Item1.ToLower() == "SENSUSRADIO_MetroRadioLifeTimeCounter".ToLower() || cTask.Result.Item1.ToLower() == "CUSTOMER_LeakFlowThreshold".ToLower() || cTask.Result.Item1.ToLower() == "CUSTOMER_ExcessFlowVolumeThreshold".ToLower())
{
base.NewStatus($"Warnung!Schreiben des Parameter {cTask.Result.Item1} war nicht erfolgreich");
}
@@ -50,7 +50,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
var useRadio = true;
if (useRadio)
{
if (Meter.StoreAllConfigurations())
if (Meter.StoreAllConfigurations())
{
var writeList = new List<bool>();
@@ -5,10 +5,15 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProductionUiCordonel.UserControls.FinalTest"
mc:Ignorable="d"
d:DesignHeight="260" d:DesignWidth="350" MouseDown="UserControl_MouseDown">
<Grid>
<Label Content="" HorizontalAlignment="Left" Height="25" VerticalAlignment="Top" Width="136" Margin="10,0,0,0"/>
<Label Name="lblDescription" Content="" Margin="10,30,10,10"/>
<TextBox Name="txtHiddenInput" Height="0" Width="0" KeyDown="txtHiddenInput_KeyDown" />
d:DesignHeight="180" d:DesignWidth="320" MouseDown="UserControl_MouseDown" Background="AliceBlue">
<Grid Margin="0,0,0,0">
<Label Content="" HorizontalAlignment="Left" Height="7" VerticalAlignment="Top" Width="264" Margin="10,0,0,0"/>
<Label Name="lblDescription" Content="" Margin="0,0,26,10" HorizontalAlignment="Right" Width="284" Height="129" VerticalAlignment="Bottom"/>
<Label Content="Scanner Input" Margin="0,0,227,144" RenderTransformOrigin="0.5,0.5" MaxHeight="25" FontSize="10" Height="29" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="83" />
<Label Name="lblInput" Background="Beige" Content="" Margin="0,0,74,144" FontSize="10" MaxHeight="25" MouseDown="LblInput_MouseDown" Height="24" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="168"/>
<TextBox Name="txtHiddenInput" KeyDown="txtHiddenInput_KeyDown" Margin="118,29,125,25" Width="0" >
</TextBox>
</Grid>
</UserControl>
@@ -90,8 +90,12 @@ namespace ProductionUiCordonel.UserControls.FinalTest
if (e.Key == Key.Enter)
{
BarcodeInput?.Invoke(sender, e);
BarcodeInput?.Invoke(sender, e);
}
else
{
lblInput.Content = txtHiddenInput.Text;
}
}
@@ -105,5 +109,15 @@ BarcodeInput?.Invoke(sender, e);
}
));
}
private void LblInput_MouseDown(object sender, MouseButtonEventArgs e)
{
this.Dispatcher.Invoke(DispatcherPriority.Send,
new Action(() =>
{
txtHiddenInput.Focus();
}
));
}
}
}
@@ -833,11 +833,6 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
return Request.CreateResponse(HttpStatusCode.OK, file);
}
[Route("AddNewUser"), HttpGet]
public async Task<HttpResponseMessage> AddNewUser(string FullName, string LogInName, string Domain, string HardwareId = null, string PasswordHash = null)
{
@@ -41,7 +41,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
var sb = new StringBuilder();
sb.AppendLine($" SELECT [Id] , lut.[FileID] ,[DataLength] ,[Version] ,[FileCrc] ,[MeterSize] ,[FileContent] FROM[Auftrag].[dbo].[Cordonel_Lut] lut inner join [Auftrag].[dbo].[File] f on lut.FileID = f.FileId");
var dbResult = dataacces.ExecuteQuery(sb.ToString());
@@ -61,7 +61,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
});
}
}
return Request.CreateResponse(HttpStatusCode.OK, true);
@@ -76,697 +76,6 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
});
}
[Route("GetAllBuilderOperator"), HttpGet]
public async Task<HttpResponseMessage> GetAllBuilderOperator()
{
return await Task.Run(() =>
{
try
{
var ret = new System.Collections.Generic.List<UserInformation>();
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var sb = new StringBuilder();
sb.AppendLine($" select UserId, FullName,LogInName, Domain,HardwareId,AccountActive from FWUpdateBuilderUser ");
var dbResult = dataacces.ExecuteQuery(sb.ToString());
foreach (DataRow row in dbResult.Rows)
{
ret.Add(
new UserInformation((int)row["UserId"])
{
FullName = row["FullName"] == DBNull.Value ? "" : (string)row["FullName"],
LogInName = (string)row["LogInName"],
Domain = (string)row["Domain"],
HardwareId = row["HardwareId"] == DBNull.Value ? "" : (string)row["HardwareId"],
AccountActive = (bool)row["AccountActive"],
});
}
return Request.CreateResponse(HttpStatusCode.OK, ret);
}
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("RefreshUsersHardwareId"), HttpGet]
public async Task<HttpResponseMessage> RefreshUsersHardwareId(int id, string HardwareId)
{
return await Task.Run(() =>
{
try
{
var ret = new System.Collections.Generic.List<UserInformation>();
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var sb = new StringBuilder();
sb.AppendLine($" Update FWUpdateUser set HardwareId = '{HardwareId}' where UserId = {id} ");
var dbResult = dataacces.ExecuteQuery(sb.ToString());
return Request.CreateResponse(HttpStatusCode.OK, true);
}
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("RefreshUsersPasswordHash"), HttpGet]
public async Task<HttpResponseMessage> RefreshUsersPasswordHash(int id, string PasswordHash)
{
return await Task.Run(() =>
{
try
{
var ret = new System.Collections.Generic.List<UserInformation>();
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var sb = new StringBuilder();
sb.AppendLine($" Update FWUpdateUser set PasswordHash = '{PasswordHash}' where UserId = {id} ");
var dbResult = dataacces.ExecuteQuery(sb.ToString());
return Request.CreateResponse(HttpStatusCode.OK, true);
}
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("EditUserValidity"), HttpGet]
public async Task<HttpResponseMessage> EditUserValidity(int id, DateTimeOffset? ValidDate = null, bool? AccountActive = null)
{
return await Task.Run(() =>
{
try
{
if (ValidDate.HasValue || AccountActive.HasValue)
{
var ret = new System.Collections.Generic.List<UserInformation>();
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var sb = new StringBuilder();
sb.AppendLine($" Update FWUpdateUser set ");
if (ValidDate.HasValue)
{
sb.AppendLine($" ValidDate = '{ValidDate.Value.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss +00:00")}' ");
}
if (AccountActive.HasValue)
{
if (ValidDate.HasValue)
{
sb.AppendLine($" , ");
}
if (AccountActive.Value)
{
sb.AppendLine($" AccountActive = 1 ");
}
else
{
sb.AppendLine($" AccountActive = 0 ");
}
}
sb.AppendLine($" where UserId = {id} ");
var dbResult = dataacces.ExecuteQuery(sb.ToString());
return Request.CreateResponse(HttpStatusCode.OK, true);
}
}
return Request.CreateResponse(HttpStatusCode.InternalServerError, "no change");
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("GetFileContent"), HttpGet]
public async Task<HttpResponseMessage> GetFileContent(int FileId)
{
return await Task.Run(() =>
{
try
{
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var sb = new StringBuilder();
sb.AppendLine($" SELECT TOP (1) [FileContent] FROM [Auftrag].[dbo].[File] where FileId = {FileId}");
var dbResult = dataacces.ExecuteQuery(sb.ToString());
return Request.CreateResponse(HttpStatusCode.OK, dbResult.Rows[0][0]);
}
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("GetFWUpdateSafeContainers"), HttpGet]
public async Task<HttpResponseMessage> GetFWUpdateSafeContainers(int UserId)
{
return await Task.Run(() =>
{
try
{
var ret = new System.Collections.Generic.List<FwUpdateSafeDb>();
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var sb = new StringBuilder();
sb.AppendLine($" select * from [dbo].[FWUpdateSafeContainer] ");
sb.Append($" where FWUpdateSafeContainer_UserId ={UserId} ");
//FWUpdateSafeContainer_ValidDate >= CURRENT_TIMESTAMP and
var dbResult = dataacces.ExecuteQuery(sb.ToString());
foreach (DataRow row in dbResult.Rows)
{
ret.Add(
new FwUpdateSafeDb()
{
ContainerId = (int)row["FWUpdateSafeContainer_ID"],
Name = (string)row["FWUpdateSafeContainer_Name"],
UserId = (int)row["FWUpdateSafeContainer_UserId"],
FilePartId = (int)row["FWUpdateSafeContainer_FileId"],
ValidDate = (DateTime)row["FWUpdateSafeContainer_ValidDate"]
});
}
}
return Request.CreateResponse(HttpStatusCode.OK, ret);
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("AddPcbIdsToSafe"), HttpPost]
public async Task<HttpResponseMessage> AddPcbIdsToSafe(int ContainerDbId, [FromBody] List<int> PcbIds)
{
return await Task.Run(() =>
{
try
{
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
StringBuilder sb = null;
foreach (var item in PcbIds)
{
if (sb == null)
{
sb = new StringBuilder();
sb.AppendLine($" insert into FWUpdateSafeContainerPcbIds ");
}
else
{
sb.AppendLine($" UNION ");
}
sb.AppendLine($" SELECT {ContainerDbId}, {item}");
}
var dbResult = dataacces.ExecuteQuery(sb.ToString());
return Request.CreateResponse(HttpStatusCode.OK, true);
}
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("GetPcbIdsFromSafe"), HttpGet]
public async Task<HttpResponseMessage> GetPcbIdsFromSafe(int ContainerDbId)
{
return await Task.Run(() =>
{
try
{
var ret = new System.Collections.Generic.List<int>();
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var sb = new StringBuilder();
sb.AppendLine($" select [FWUpdateSafeContainer_PcbId] from [dbo].[FWUpdateSafeContainerPcbIds] ");
sb.Append($" where [FWUpdateSafeContainer_ID] = {ContainerDbId} ");
var dbResult = dataacces.ExecuteQuery(sb.ToString());
foreach (DataRow row in dbResult.Rows)
{
ret.Add((int)row["FWUpdateSafeContainer_PcbId"]);
}
}
return Request.CreateResponse(HttpStatusCode.OK, ret);
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("PostFWUpdateSafeOdd"), HttpPost]
public async Task<HttpResponseMessage> PostFWUpdateSafeOdd(int PUserId, string PFileName, DateTime PValidDate, string PBuilderOperatorName = "none")
{
var inpStrem = HttpContext.Current.Request.GetBufferlessInputStream(true);
var inpHeaders = Request.Content.Headers;
return await Task.Run(async () =>
{
try
{
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var parameters = new List<System.Data.SqlClient.SqlParameter>();
var FileName = new System.Data.SqlClient.SqlParameter("@FileName", SqlDbType.NVarChar, 50);
var UserId = new System.Data.SqlClient.SqlParameter("@UserId", SqlDbType.Int);
var ValidDate = new System.Data.SqlClient.SqlParameter("@ValidDate", SqlDbType.Date);
FileName.Value = PFileName;
UserId.Value = PUserId;
ValidDate.Value = PValidDate;
parameters.Add(ValidDate);
var sb = new StringBuilder();
sb.AppendLine($" Declare @FileID as int ");
sb.AppendLine($" Declare @FileName as NVarChar(50) ");
sb.AppendLine($" Declare @UserId as int ");
sb.AppendLine($" set @FileName = '{PFileName}' ");
sb.AppendLine($" set @UserId = {PUserId} ");
//sb.AppendLine($" INSERT INTO [dbo].[File] ([FileContent], [FileName]) VALUES (@FileContent, @FileName) ;");
//sb.AppendLine($" SELECT @FileID = @@IDENTITY; ");
sb.AppendLine($" INSERT INTO [dbo].[FWUpdateSafeContainer] ([FWUpdateSafeContainer_Name],[FWUpdateSafeContainer_UserId],[FWUpdateSafeContainer_FileId],[FWUpdateSafeContainer_ValidDate])");
sb.AppendLine($" VALUES(@FileName,@UserId,0,@ValidDate); ");
sb.AppendLine($" select @@IDENTITY as ContainerID, @FileID as FilePartId ");
var retDT = dataacces.ExecuteQuery(sb.ToString(), parameters);
var newID = Convert.ToInt32(retDT.Rows[0][0].ToString());
var fileuploadPath = $"C:\\\\Temp\\{newID}\\";
Directory.CreateDirectory(fileuploadPath);
var provider = new MultipartFormDataStreamProvider(fileuploadPath);
var content = new StreamContent(inpStrem);
foreach (var header in inpHeaders)
{
content.Headers.TryAddWithoutValidation(header.Key, header.Value);
}
await content.ReadAsMultipartAsync(provider);
string uploadingFileName = provider.FileData.Select(x => x.LocalFileName).FirstOrDefault();
string originalFileName = String.Concat(fileuploadPath, "\\" + (provider.Contents[0].Headers.ContentDisposition.FileName).Trim(new Char[] { '"' }));
if (File.Exists(originalFileName))
{
File.Delete(originalFileName);
}
File.Move(uploadingFileName, originalFileName);
return Request.CreateResponse(HttpStatusCode.OK, newID);
}
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("GetFWUpdateSafeContainerContent"), HttpGet]
public async Task<HttpResponseMessage> GetFWUpdateSafeContainerContent(int SafeContainerId)
{
return await Task.Run(() =>
{
try
{
var ret = new System.Collections.Generic.List<FwUpdateSafeDb>();
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var sb = new StringBuilder();
sb.AppendLine($" select * from [dbo].[FWUpdateSafeContainer] ");
sb.Append($" where FWUpdateSafeContainer_ValidDate >= CURRENT_TIMESTAMP and FWUpdateSafeContainer_ID ={SafeContainerId} ");
var dbResult = dataacces.ExecuteQuery(sb.ToString());
foreach (DataRow row in dbResult.Rows)
{
var content = new byte[] { };
var filePath = $"C:\\\\Temp\\{(int)row["FWUpdateSafeContainer_ID"]}\\{(string)row["FWUpdateSafeContainer_Name"]}";
if (File.Exists(filePath))
{
content = File.ReadAllBytes(filePath);
}
else
{
content = ASCIIEncoding.ASCII.GetBytes("File Not Found");
}
ret.Add(
new FwUpdateSafeDb()
{
ContainerId = (int)row["FWUpdateSafeContainer_ID"],
Name = (string)row["FWUpdateSafeContainer_Name"],
UserId = (int)row["FWUpdateSafeContainer_UserId"],
FilePartId = (int)row["FWUpdateSafeContainer_FileId"],
ValidDate = (DateTime)row["FWUpdateSafeContainer_ValidDate"],
Content = content
});
}
}
return Request.CreateResponse(HttpStatusCode.OK, ret);
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("PostFWUpdateSafe"), HttpPost]
public async Task<HttpResponseMessage> PostFWUpdateSafe([FromBody] FwUpdateSafeDb fwc)
{
return await Task.Run(() =>
{
try
{
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var parameters = new List<System.Data.SqlClient.SqlParameter>();
var FileContent = new System.Data.SqlClient.SqlParameter("FileContent", SqlDbType.VarBinary);
// var FileName = new System.Data.SqlClient.SqlParameter("FileName", SqlDbType.NVarChar, 50);
var UserId = new System.Data.SqlClient.SqlParameter("UserId", SqlDbType.Int);
var ValidDate = new System.Data.SqlClient.SqlParameter("ValidDate", SqlDbType.Date);
// FileName.Value = fwc.Name;
FileContent.Value = fwc.Content;
UserId.Value = fwc.UserId;
ValidDate.Value = fwc.ValidDate.Date;
//parameters.Add(FileName);
parameters.Add(UserId);
parameters.Add(FileContent);
parameters.Add(ValidDate);
var sb = new StringBuilder();
sb.AppendLine($" Declare @FileID as int ");
sb.AppendLine($" INSERT INTO [dbo].[File] ([FileContent], [FileName]) VALUES (@FileContent, 't') ;");
sb.AppendLine($" SELECT @FileID = @@IDENTITY; ");
sb.AppendLine($" INSERT INTO [dbo].[FWUpdateSafeContainer] ([FWUpdateSafeContainer_Name],[FWUpdateSafeContainer_UserId],[FWUpdateSafeContainer_FileId],[FWUpdateSafeContainer_ValidDate])");
sb.AppendLine($" VALUES('t',@UserId,@FileID,@ValidDate); ");
sb.AppendLine($" select @@IDENTITY as ContainerID, @FileID as FilePartId ");
var retDT = dataacces.ExecuteQuery(sb.ToString(), parameters);
var newID = Convert.ToInt32(retDT.Rows[0][0].ToString());
return Request.CreateResponse(HttpStatusCode.OK, newID);
}
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
public virtual byte[] GetFileBytes(HttpPostedFile uploadedFile)
{
var bytes = new byte[uploadedFile.ContentLength];
uploadedFile.InputStream.Read(bytes, 0, uploadedFile.ContentLength);
return bytes;
}
[Route("PostFWUpdateReportFile"), HttpPost]
public async Task<HttpResponseMessage> PostFWUpdateReportFiles([FromBody] FwUpdateReportDb FileContent)
{
return await Task.Run(() =>
{
try
{
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var parameters = new List<System.Data.SqlClient.SqlParameter>();
var DbFileContent = new System.Data.SqlClient.SqlParameter("@FileContent", SqlDbType.VarBinary);
var DbFileName = new System.Data.SqlClient.SqlParameter("@FileName", SqlDbType.NVarChar, 50);
DbFileName.Value = FileContent.FileName;
DbFileContent.Value = UTF32Encoding.UTF32.GetBytes(JsonConvert.SerializeObject(FileContent));
parameters.Add(DbFileName);
parameters.Add(DbFileContent);
var sb = new StringBuilder();
sb.AppendLine($" Declare @FileID as int ");
sb.AppendLine($" INSERT INTO [dbo].[File] ([FileContent], [FileName]) VALUES (@FileContent, @FileName) ;");
sb.AppendLine($" SELECT @FileID = @@IDENTITY; ");
sb.AppendLine($" INSERT INTO [dbo].[FWUpdateReports] ([FWUpdateReport_Name],[FWUpdateReport_UserId], [FWUpdateReport_FileId],[FWUpdateReport_Date],[FWUpdateReport_PcbId], [FWUpdateReport_OrderNr], [FWUpdateReport_OrderPos]) ");
sb.AppendLine($" VALUES(@FileName,{FileContent.UserId},@FileID,CURRENT_TIMESTAMP, {FileContent.PcbId}, {FileContent.OrderNr}, {FileContent.OrderPos} ); ");
sb.AppendLine($" select @@IDENTITY as FWUpdateReportsId, @FileID as FilePartId ");
var retDT = dataacces.ExecuteQuery(sb.ToString(), parameters);
var newID = Convert.ToInt32(retDT.Rows[0][0].ToString());
return Request.CreateResponse(HttpStatusCode.OK, newID);
}
return Request.CreateResponse(HttpStatusCode.OK, false);
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("GetFWUpdateReportFile"), HttpGet]
public async Task<HttpResponseMessage> GetFWUpdateReportFile(int? PcbId = null, int? UserId = null, int? OrderNr = null, bool WithContent = true)
{
return await Task.Run(() =>
{
try
{
var ret = new System.Collections.Generic.List<FwUpdateReportDb>();
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var sb = new StringBuilder();
sb.AppendLine($" select FWUpdateReport_ID, FWUpdateReport_Name, FWUpdateReport_UserId, FWUpdateReport_FileId, FWUpdateReport_Date, FWUpdateReport_PcbId, FWUpdateReport_OrderNr ");
if (WithContent)
{
sb.Append(", FileContent ");
}
sb.AppendLine($" from [dbo].[FWUpdateReports] r ");
if (WithContent)
{
sb.AppendLine($" inner join [dbo].[File] f on r.FWUpdateReport_FileId = f.FileId ");
}
sb.AppendLine($" where FWUpdateReport_ID > 0 ");
if (PcbId.HasValue)
{
sb.AppendLine($" and FWUpdateReport_PcbId = {PcbId.Value}");
}
if (UserId.HasValue)
{
sb.AppendLine($" and FWUpdateReport_UserId = {UserId.Value}");
}
if (OrderNr.HasValue)
{
sb.AppendLine($" and FWUpdateReport_OrderNr = {OrderNr.Value}");
}
var dbResult = dataacces.ExecuteQuery(sb.ToString());
foreach (DataRow row in dbResult.Rows)
{
var addOBJ = JsonConvert.DeserializeObject<FwUpdateReportDb>(UTF32Encoding.UTF32.GetString((byte[])row["FileContent"]));
addOBJ.FileId = (int)row["FWUpdateReport_ID"];
addOBJ.Date = (DateTime)row["FWUpdateReport_Date"];
ret.Add(addOBJ);
}
}
return Request.CreateResponse(HttpStatusCode.OK, ret);
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
[Route("GetFakeRecoveryFile"), HttpGet]
public async Task<HttpResponseMessage> GetFakeRecoveryFile(int PcbID, int? RadioFrq, string Region, string FlexnetVersion)
{
var file = new RecoverySettings() { PcbID = PcbID, RadioFrequencyMhz = RadioFrq , Region = Region , Release = FlexnetVersion };
file.RecoveryRegisters = new List<ServiceFwUpdate.Common.FwUpdateSafe.RecoveryRegisterItem>();
file.RecoveryRegisters.Add(new ServiceFwUpdate.Common.FwUpdateSafe.RecoveryRegisterItem() { RegisterIdent = "SENSUSRADIO_WakeupInterval", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0x03 }, IsCiritcal = true, ReadbackValue = new byte[] { 0x00, 0x00, 0x00, 0x03 } });
file.RecoveryRegisters.Add(new ServiceFwUpdate.Common.FwUpdateSafe.RecoveryRegisterItem() { RegisterIdent = "GENESISFLOW_SampleRate", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0x02 }, IsCiritcal = true, ReadbackValue = new byte[] { 0x00, 0x00, 0x00, 0x02 } });
file.RecoveryRegisters.Add(new ServiceFwUpdate.Common.FwUpdateSafe.RecoveryRegisterItem() { RegisterIdent = "GENESISFLOW_DisplayPow10", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0xFD }, IsCiritcal = true, ReadbackValue = new byte[] { 0x00, 0x00, 0x00, 0xFD } });
file.RecoveryRegisters.Add(new ServiceFwUpdate.Common.FwUpdateSafe.RecoveryRegisterItem() { RegisterIdent = "CUSTOMER_SerialNumber", WriteValue = new byte[] { 0x01, 0x02, 0x03, 0x04,0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00 }, IsCiritcal = false, ReadbackValue = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00 } });
file.RecoveryRegisters.Add(new ServiceFwUpdate.Common.FwUpdateSafe.RecoveryRegisterItem() { RegisterIdent = "GENESISFLOW_StoreConfiguration", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0x01 }, IsCiritcal = true, ReadbackValue = new byte[] { 0x00, 0x00, 0x00, 0x00 } });
return Request.CreateResponse(HttpStatusCode.OK, file);
}
[Route("AddNewUser"), HttpGet]
public async Task<HttpResponseMessage> AddNewUser(string FullName, string LogInName, string Domain, string HardwareId = null, string PasswordHash = null)
{
return await Task.Run(() =>
{
try
{
var ret = new System.Collections.Generic.List<UserInformation>();
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var sb = new StringBuilder();
sb.AppendLine($" insert into FWUpdateUser ");
sb.AppendLine($" select ");
sb.AppendLine($" '{FullName}', ");
sb.AppendLine($" '{LogInName}', ");
sb.AppendLine($" '{Domain}', ");
sb.AppendLine(string.IsNullOrEmpty(HardwareId) ? "null , " : $"'{HardwareId}' ,");
sb.AppendLine(string.IsNullOrEmpty(PasswordHash) ? "null , " : $"'{PasswordHash}' ,");
sb.AppendLine($" '{DateTimeOffset.UtcNow.ToString("yyyy-MM-dd HH:mm:ss +01:00")}', ");
sb.AppendLine($" '{DateTimeOffset.UtcNow.ToString("yyyy-MM-dd HH:mm:ss +01:00")}', ");
sb.AppendLine($" 0 ");
sb.AppendLine($" select @@IDENTITY ");
var dbResult = dataacces.ExecuteQuery(sb.ToString());
var newID = Convert.ToInt32(dbResult.Rows[0][0].ToString());
return Request.CreateResponse(HttpStatusCode.OK, newID);
}
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
}
});
}
}
}
@@ -111,7 +111,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
}
/// <summary>
/// Get SerialNumber from PcbID
@@ -218,6 +218,52 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
}
[Route("GetSerialNumberFromOrderDataUnMapped"), HttpGet]
public async Task<HttpResponseMessage> GetSerialNumberFromOrderDataUnMapped(int OrderNumber)
{
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var sb = new StringBuilder();
sb.AppendLine($" Declare @OrderNumber int ");
sb.AppendLine($" set @OrderNumber = {OrderNumber} ");
sb.AppendLine($" SELECT top 1 ");
sb.AppendLine($" [SerienNr] ");
sb.AppendLine($" ,aps.[AuftragNr] ");
sb.AppendLine($" ,aps.[PositionNr] ");
sb.AppendLine($" ,[KundeneigeneSerienNr] ");
sb.AppendLine($" ,MapPcbIdToSerialNumber_PcbId ");
sb.AppendLine($" FROM[Auftrag].[dbo].[AuftragPositionSerienNr] ");
sb.AppendLine($" aps ");
sb.AppendLine($" inner join AuftragPosition_Gesamt a on aps.AuftragNr = a.AuftragNr and aps.PositionNr = a.PositionNr ");
sb.AppendLine($" left outer join MapPcbIdToSerialNumber on[SerienNr] = MapPcbIdToSerialNumber_SerialNumber ");
sb.AppendLine($" Where(a.FertigungsauftragNr = @OrderNumber) ");
sb.AppendLine($" and MapPcbIdToSerialNumber_PcbId is null ");
sb.AppendLine($" order by[SerienNr] desc ");
var OrderData = dataacces.ExecuteQuery(sb.ToString());
if (OrderData.Rows.Count != 1)
{
return null;
}
return Request.CreateResponse(HttpStatusCode.OK, OrderData.Rows[0]["SerienNr"].ToString());
}
}
[Route("GetPreMarriageState"), HttpGet]
public async Task<HttpResponseMessage> GetPreMarriageState(string PcbId, string SerialNumber)
{
@@ -88,6 +88,8 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
sb.AppendLine($" SELECT distinct [MapPcbIdToSerialNumber_SerialNumber], mapOrder.CordonelAssignedPicking_FertigungsAuftragsNr ,KundeneigeneSerienNr as CustomerSerialNr ");
sb.AppendLine($" , meter.[Adresse] , Nennweite as Dn ");
sb.AppendLine($" , (SELECT TOP(1) Dn_InternalId FROM CordonelMeterSizes where Dn_VakoID = substring(Identnr.VakoCode, 4, 2)) as NewNennweiteID ");
sb.AppendLine($" , (select top 1 ID from[Auftrag].[dbo].[CordonelMeterCalibrationResults] where PcbId = '{PcbID}' order by date desc) as CalibrationRunID ");
sb.AppendLine($" , (select top 1 StatusFertigung from Auftrag.dbo.AuftragPositionSerienNr a where a.SerienNr = [MapPcbIdToSerialNumber_SerialNumber] order by AnlageDatum desc) as LastProcessState ");
sb.AppendLine($" FROM Auftrag.dbo.Cordonel_AssignedPicking mapOrder ");
@@ -107,7 +109,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
}
var ret = new String[] { MapData.Rows[0]["MapPcbIdToSerialNumber_SerialNumber"].ToString(), MapData.Rows[0]["CordonelAssignedPicking_FertigungsAuftragsNr"].ToString(), MapData.Rows[0]["Adresse"].ToString(), MapData.Rows[0]["CustomerSerialNr"].ToString(), MapData.Rows[0]["CalibrationRunID"].ToString(), MapData.Rows[0]["LastProcessState"].ToString(), MapData.Rows[0]["Dn"].ToString() };
var ret = new String[] { MapData.Rows[0]["MapPcbIdToSerialNumber_SerialNumber"].ToString(), MapData.Rows[0]["CordonelAssignedPicking_FertigungsAuftragsNr"].ToString(), MapData.Rows[0]["Adresse"].ToString(), MapData.Rows[0]["CustomerSerialNr"].ToString(), MapData.Rows[0]["CalibrationRunID"].ToString(), MapData.Rows[0]["LastProcessState"].ToString(), MapData.Rows[0]["Dn"].ToString() , MapData.Rows[0]["NewNennweiteID"].ToString() };
return Request.CreateResponse(HttpStatusCode.OK, ret);
}
+240
View File
@@ -0,0 +1,240 @@
namespace Xylem.Common.Ui.GenesisToolBox
{
partial class FrmMasterMapping
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lblSrn = new System.Windows.Forms.Label();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.piBoQr = new System.Windows.Forms.PictureBox();
this.AuftragsNummer = new System.Windows.Forms.Label();
this.txtOrder = new System.Windows.Forms.TextBox();
this.btnNext = new System.Windows.Forms.Button();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.txtFastPcbid = new System.Windows.Forms.TextBox();
this.txtFastOrder = new System.Windows.Forms.TextBox();
this.PcbId = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtFastSerialnumber = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.piBoQr)).BeginInit();
this.SuspendLayout();
//
// lblSrn
//
this.lblSrn.AutoSize = true;
this.lblSrn.Location = new System.Drawing.Point(13, 59);
this.lblSrn.Name = "lblSrn";
this.lblSrn.Size = new System.Drawing.Size(0, 13);
this.lblSrn.TabIndex = 4;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Location = new System.Drawing.Point(12, 6);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(807, 471);
this.tabControl1.TabIndex = 5;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.piBoQr);
this.tabPage1.Controls.Add(this.lblSrn);
this.tabPage1.Controls.Add(this.AuftragsNummer);
this.tabPage1.Controls.Add(this.txtOrder);
this.tabPage1.Controls.Add(this.btnNext);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(799, 445);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Na Serials";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.button1);
this.tabPage2.Controls.Add(this.label4);
this.tabPage2.Controls.Add(this.txtFastSerialnumber);
this.tabPage2.Controls.Add(this.label2);
this.tabPage2.Controls.Add(this.PcbId);
this.tabPage2.Controls.Add(this.txtFastOrder);
this.tabPage2.Controls.Add(this.txtFastPcbid);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(799, 445);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Add fast mapping";
this.tabPage2.UseVisualStyleBackColor = true;
//
// piBoQr
//
this.piBoQr.Location = new System.Drawing.Point(12, 90);
this.piBoQr.Name = "piBoQr";
this.piBoQr.Size = new System.Drawing.Size(350, 350);
this.piBoQr.TabIndex = 7;
this.piBoQr.TabStop = false;
//
// AuftragsNummer
//
this.AuftragsNummer.AutoSize = true;
this.AuftragsNummer.Location = new System.Drawing.Point(13, 8);
this.AuftragsNummer.Name = "AuftragsNummer";
this.AuftragsNummer.Size = new System.Drawing.Size(85, 13);
this.AuftragsNummer.TabIndex = 6;
this.AuftragsNummer.Text = "AuftragsNummer";
//
// txtOrder
//
this.txtOrder.Location = new System.Drawing.Point(16, 24);
this.txtOrder.Name = "txtOrder";
this.txtOrder.Size = new System.Drawing.Size(129, 20);
this.txtOrder.TabIndex = 5;
//
// btnNext
//
this.btnNext.Location = new System.Drawing.Point(151, 13);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(154, 40);
this.btnNext.TabIndex = 4;
this.btnNext.Text = "Get next free SerialNumber";
this.btnNext.UseVisualStyleBackColor = true;
//
// tabPage3
//
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(799, 445);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "See and Remove Mapping";
this.tabPage3.UseVisualStyleBackColor = true;
//
// txtFastPcbid
//
this.txtFastPcbid.Location = new System.Drawing.Point(77, 20);
this.txtFastPcbid.Name = "txtFastPcbid";
this.txtFastPcbid.Size = new System.Drawing.Size(128, 20);
this.txtFastPcbid.TabIndex = 0;
//
// txtFastOrder
//
this.txtFastOrder.Location = new System.Drawing.Point(77, 46);
this.txtFastOrder.Name = "txtFastOrder";
this.txtFastOrder.Size = new System.Drawing.Size(128, 20);
this.txtFastOrder.TabIndex = 1;
//
// PcbId
//
this.PcbId.AutoSize = true;
this.PcbId.Location = new System.Drawing.Point(13, 23);
this.PcbId.Name = "PcbId";
this.PcbId.Size = new System.Drawing.Size(35, 13);
this.PcbId.TabIndex = 2;
this.PcbId.Text = "PcbId";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 49);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(33, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Order";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(13, 75);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(64, 13);
this.label4.TabIndex = 6;
this.label4.Text = "SerialNumer";
//
// txtFastSerialnumber
//
this.txtFastSerialnumber.Location = new System.Drawing.Point(77, 72);
this.txtFastSerialnumber.Name = "txtFastSerialnumber";
this.txtFastSerialnumber.Size = new System.Drawing.Size(128, 20);
this.txtFastSerialnumber.TabIndex = 4;
//
// button1
//
this.button1.Location = new System.Drawing.Point(15, 98);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(190, 33);
this.button1.TabIndex = 7;
this.button1.Text = "Fast Map";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click_1);
//
// FrmMasterMapping
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1330, 489);
this.Controls.Add(this.tabControl1);
this.Name = "FrmMasterMapping";
this.Text = "FrmMasterMapping";
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.piBoQr)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label lblSrn;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.PictureBox piBoQr;
private System.Windows.Forms.Label AuftragsNummer;
private System.Windows.Forms.TextBox txtOrder;
private System.Windows.Forms.Button btnNext;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtFastSerialnumber;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label PcbId;
private System.Windows.Forms.TextBox txtFastOrder;
private System.Windows.Forms.TextBox txtFastPcbid;
private System.Windows.Forms.TabPage tabPage3;
}
}
@@ -0,0 +1,78 @@
using QRCoder;
using System;
using System.Drawing;
using System.Windows.Forms;
using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.Logic.ProductionOrderCore.TestResults;
using Xylem.Common.Logic.SoftwareAccessHelper;
namespace Xylem.Common.Ui.GenesisToolBox
{
public partial class FrmMasterMapping : Form
{
public FrmMasterMapping()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
var ret = LocalWebRequest.GetRequest("http://10.49.40.25/MeterProcessState/api/Marriage/GetSerialNumberFromOrderDataUnMapped?OrderNumber=" + txtOrder.Text, 80000);
int tmp = 0;
if (int.TryParse(ret.ToString().Trim('\"'), out tmp))
{
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(tmp.ToString(), QRCodeGenerator.ECCLevel.L);
QRCode qrCode = new QRCode(qrCodeData);
Bitmap qrCodeImage = qrCode.GetGraphic(10);
piBoQr.Image = qrCodeImage;
lblSrn.Text = tmp.ToString();
}
else
{
MessageBox.Show("error");
}
}
private void button1_Click_1(object sender, EventArgs e)
{
var ret = LocalWebRequest.PostRequestAsync("http://10.49.40.25/MeterProcessState/api/ProccesState/SetPickingState?PcbId=" + txtFastPcbid.Text + "&FertigungsauftragsNr=" + txtFastOrder.Text, 80000);
if (ret)
{
var url = ServiceUrls.MeterProcessStateUrl();
url = url + $"SetPressureStateDetailed";
var mutedResult = new PressureResultData()
{
Passed = true,
LeakRate = "",
PcbId = txtFastPcbid.Text,
Remark = "fast Map",
Rev = 0,
TesterName = "pc",
TestPressure = "0",
Testpoints = new System.Collections.Generic.List<PressureTestPoints>() { new PressureTestPoints() { Ident = 1, Input = "0" } }
};
ret = LocalWebRequest.PostRequestAsync(url, json: mutedResult);
if (ret)
{
url = $"{ServiceUrls.MarriageServiceUrl()}SetPcbToSerial?PcbId={txtFastPcbid.Text}&SerialNumber={txtFastSerialnumber.Text}&returnMetroData=0";
var retSeri = LocalWebRequest.GetRequest(url, 18000);
if (retSeri.Contains("store"))
{
MessageBox.Show("hat geklappt");
}
}
}
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -155,6 +155,10 @@
<HintPath>..\..\packages\NLog.4.6.7\lib\net40-client\NLog.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="QRCoder, Version=1.4.3.0, Culture=neutral, PublicKeyToken=c4ed5b9ae8358a28, processorArchitecture=MSIL">
<HintPath>..\..\packages\QRCoder.1.4.3\lib\net40\QRCoder.dll</HintPath>
</Reference>
<Reference Include="RestSharp, Version=105.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Reference Include="System" />
<Reference Include="System.Configuration" />
@@ -275,6 +279,12 @@
<Compile Include="FrmMapping.Designer.cs">
<DependentUpon>FrmMapping.cs</DependentUpon>
</Compile>
<Compile Include="FrmMasterMapping.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmMasterMapping.Designer.cs">
<DependentUpon>FrmMasterMapping.cs</DependentUpon>
</Compile>
<Compile Include="FrmPressure.cs">
<SubType>Form</SubType>
</Compile>
@@ -448,6 +458,9 @@
<EmbeddedResource Include="FrmMapping.resx">
<DependentUpon>FrmMapping.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmMasterMapping.resx">
<DependentUpon>FrmMasterMapping.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmPressure.resx">
<DependentUpon>FrmPressure.cs</DependentUpon>
<SubType>Designer</SubType>
Binary file not shown.
+25 -11
View File
@@ -29,6 +29,7 @@
private void InitializeComponent()
{
this.gpGerneral = new System.Windows.Forms.GroupBox();
this.button4 = new System.Windows.Forms.Button();
this.btnLutUpdate = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.btnPressure = new System.Windows.Forms.Button();
@@ -52,7 +53,7 @@
this.BtnFileSplit = new System.Windows.Forms.Button();
this.btnFiles = new System.Windows.Forms.Button();
this.btnLegacyTestApp = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.gpGerneral.SuspendLayout();
this.gpLAA.SuspendLayout();
this.gbDeveloper.SuspendLayout();
@@ -80,6 +81,16 @@
this.gpGerneral.TabStop = false;
this.gpGerneral.Text = "General";
//
// button4
//
this.button4.Location = new System.Drawing.Point(7, 321);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(151, 39);
this.button4.TabIndex = 18;
this.button4.Text = "LUT Managment";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// btnLutUpdate
//
this.btnLutUpdate.Location = new System.Drawing.Point(7, 279);
@@ -193,6 +204,7 @@
//
// gpLAA
//
this.gpLAA.Controls.Add(this.button5);
this.gpLAA.Controls.Add(this.button2);
this.gpLAA.Controls.Add(this.btnPara);
this.gpLAA.Controls.Add(this.btnRegHistory);
@@ -202,7 +214,7 @@
this.gpLAA.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.gpLAA.Location = new System.Drawing.Point(200, 12);
this.gpLAA.Name = "gpLAA";
this.gpLAA.Size = new System.Drawing.Size(181, 290);
this.gpLAA.Size = new System.Drawing.Size(181, 344);
this.gpLAA.TabIndex = 20;
this.gpLAA.TabStop = false;
this.gpLAA.Text = "Production LAA";
@@ -277,7 +289,7 @@
this.gbDeveloper.Controls.Add(this.btnFiles);
this.gbDeveloper.Controls.Add(this.btnLegacyTestApp);
this.gbDeveloper.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.gbDeveloper.Location = new System.Drawing.Point(200, 308);
this.gbDeveloper.Location = new System.Drawing.Point(200, 362);
this.gbDeveloper.Name = "gbDeveloper";
this.gbDeveloper.Size = new System.Drawing.Size(181, 153);
this.gbDeveloper.TabIndex = 21;
@@ -326,15 +338,16 @@
this.btnLegacyTestApp.UseVisualStyleBackColor = true;
this.btnLegacyTestApp.Click += new System.EventHandler(this.btnLegacyTestApp_Click);
//
// button4
// button5
//
this.button4.Location = new System.Drawing.Point(7, 321);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(151, 39);
this.button4.TabIndex = 18;
this.button4.Text = "LUT Managment";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
this.button5.Location = new System.Drawing.Point(6, 290);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(152, 40);
this.button5.TabIndex = 21;
this.button5.Text = "Mapping NA";
this.button5.UseMnemonic = false;
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// FrmMainForm
//
@@ -386,6 +399,7 @@
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
}
}
+8
View File
@@ -382,5 +382,13 @@ namespace Xylem.Common.Ui.GenesisToolBox
form.Closed += Form_Closed;
Hide();
}
private void button5_Click(object sender, EventArgs e)
{
var form = new FrmMasterMapping();
form.Show();
form.Closed += Form_Closed;
Hide();
}
}
}
+2 -5
View File
@@ -313,10 +313,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
return ret;
}
private void BtnAddRow_Click(Object sender, EventArgs e)
{
dgvConfig.Rows.Add(AddRowToGrid());
}
@@ -800,7 +797,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
private void btnAddRow_Click(object sender, EventArgs e)
{
dgvConfig.Rows.Add(AddRowToGrid());
}
}
}
+1
View File
@@ -2,4 +2,5 @@
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net40" />
<package id="NLog" version="4.6.7" targetFramework="net40" />
<package id="QRCoder" version="1.4.3" targetFramework="net40" />
</packages>
@@ -82,7 +82,7 @@ namespace XylemCommonUiLegacyGenCtl
settings.Adjustment = DefaultSettings.DetectedMeterEnum.Always;
settings.FlowAdjustmentTarget = 0.35M;
settings.FlowTesting = DefaultSettings.DetectedMeterEnum.Always;
settings.PreAdjustment = DefaultSettings.DetectedMeterEnum.OnlyforFirstTime;
settings.PreAdjustment = DefaultSettings.DetectedMeterEnum.Always;
settings.Temp = TempSouceType.TempFlansh;
settings.Delay = 10;
settings.Research = false;
@@ -293,6 +293,12 @@ namespace XylemCommonUiLegacyGenCtl
int.TryParse(a[6], out tmp);
Metersize = MeterSizeConverter.ConvertToMeter(tmp);
}
if (!string.IsNullOrEmpty(a[7]))
{
var tmp = 0;
int.TryParse(a[7], out tmp);
Metersize = ((MeterSize)(tmp));
}
if (LastTestBechState <= 20)
{
HyState = null;
@@ -2922,6 +2922,10 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
// create one line per PcbId
foreach (var pcbId in safeInfo.PcbIds)
{
try
{
var row = _dataTableUpdateSafes.NewRow();
row[Resources.StrTableUserValidDate] = safeInfo.ValidDate.DateTime;
@@ -2947,6 +2951,10 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
row[Resources.StrTableUserFullName] = userName;
_dataTableUpdateSafes.Rows.Add(row);
}
catch (Exception exs)
{
}
}
}
@@ -2959,7 +2967,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
FwUpdateSafesInfosStyleSet();
}
catch (Exception)
catch (Exception ex)
{
_processState = ProcessState.Error;
}