diff --git a/Common/.vs/config/applicationhost.config b/Common/.vs/config/applicationhost.config index 1b9332b4..40cde372 100644 --- a/Common/.vs/config/applicationhost.config +++ b/Common/.vs/config/applicationhost.config @@ -155,7 +155,7 @@ - + diff --git a/Common/CordonelAssemblyLine/Model/PickingModel.cs b/Common/CordonelAssemblyLine/Model/PickingModel.cs index 938e4f03..b76306fc 100644 --- a/Common/CordonelAssemblyLine/Model/PickingModel.cs +++ b/Common/CordonelAssemblyLine/Model/PickingModel.cs @@ -601,7 +601,7 @@ namespace CordonelAssemblyLine.Model sbMSG.AppendLine($"Remaining life time in years {genesisStatus.RemainingLifeTimeYears:F2}"); sbMSG.AppendLine($"Totally drained battery load in % {genesisStatus.DrainedBatteryLoadPercent:F2}"); - if (genesisStatus.RemainingLifeTimeYears >= 21) + if (genesisStatus.RemainingLifeTimeYears >= 21 || genesisStatus.DrainedBatteryLoadPercent <= 1) { lblS08Text = $"{genesisStatus.RemainingLifeTimeYears} Jahre"; } diff --git a/Common/CordonelPreadjustmentUi/PreAdjustmentSettingsContainer.cs b/Common/CordonelPreadjustmentUi/PreAdjustmentSettingsContainer.cs index 71c1b662..acf9decf 100644 --- a/Common/CordonelPreadjustmentUi/PreAdjustmentSettingsContainer.cs +++ b/Common/CordonelPreadjustmentUi/PreAdjustmentSettingsContainer.cs @@ -123,7 +123,7 @@ namespace CordonelPreadjustmentUi Double upperTempLimit = 35, Double lowerTempLimit = 15, Double tempDeviationLimit = 1, - Int32 ampTestTofRecordingTime = 2, + Int32 ampTestTofRecordingTime = 6, Double ampTestTriggerValue = 0.5, bool ampTestGenerateLogfiles = true, bool ampTestGenerateMeanValuesFile = true, diff --git a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache index d8b5c8f6..f22623aa 100644 --- a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache +++ b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -1a3d4919c9c702245832d925951f2b7cb72fc333 +5ed75d99ee45ff67821090f1b3dbb001dd9e4fe3 diff --git a/Common/ProductionUiCordonel/ProductionProcesses/Actions/ProductionCheckShippingState.cs b/Common/ProductionUiCordonel/ProductionProcesses/Actions/ProductionCheckShippingState.cs index d104d0ff..67093297 100644 --- a/Common/ProductionUiCordonel/ProductionProcesses/Actions/ProductionCheckShippingState.cs +++ b/Common/ProductionUiCordonel/ProductionProcesses/Actions/ProductionCheckShippingState.cs @@ -1,9 +1,9 @@ -using System; -using System.Windows.Controls; -using System.Windows.Threading; -using Newtonsoft.Json; +using Newtonsoft.Json; using ProductionUiCordonel.ProductionProcesses.Enum; using ProductionUiCordonel.UserControls.FinalTest; +using System; +using System.Windows.Controls; +using System.Windows.Threading; using Xylem.Common.CommonCore.Configuration; using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus; using Xylem.Common.Logic.SoftwareAccessHelper; @@ -113,7 +113,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions // this calculates all life time values if (!GenesisStatusHandler.BuildLifeTimeInformation(Meter, genesisStatus)) { - + UserControl.lblText.Dispatcher.Invoke(DispatcherPriority.Send, new Action(() => { @@ -123,7 +123,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions Meter.WriteLog("Batterie nicht lesbar"); break; } - + //lastFrame Meter.WriteLog($"totalUsed at EOL {genesisStatus.DrainedBatteryLoadPercent:F2}"); if (res[1] == "3212095") @@ -131,13 +131,20 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions currentProcessState = ProductionProcessState.Done; return; } - if (genesisStatus.RemainingLifeTimeYears < 20) + + + if (genesisStatus.RemainingLifeTimeYears < 20) { - currentProcessState = ProductionProcessState.Error; - UserControl.lblText.Content = "Batterie über 10% entladen"; - Meter.WriteLog("Batterie über 10% entladen"); + if (genesisStatus.DrainedBatteryLoadPercent > 1.5) + { + currentProcessState = ProductionProcessState.Error; + UserControl.lblText.Content = "Batterie über 10% entladen"; + Meter.WriteLog("Batterie über 10% entladen"); + } + + } - + if (currentProcessState != ProductionProcessState.Error) { currentProcessState = ProductionProcessState.Done; diff --git a/Common/Service/MeterProcessState/Controllers/EasyAccessControler.cs b/Common/Service/MeterProcessState/Controllers/EasyAccessControler.cs index cf73a39d..5ee28e68 100644 --- a/Common/Service/MeterProcessState/Controllers/EasyAccessControler.cs +++ b/Common/Service/MeterProcessState/Controllers/EasyAccessControler.cs @@ -176,13 +176,15 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers query.AppendLine(" apsn.PositionNr, "); query.AppendLine(" apsn.SerienNr, "); query.AppendLine(" pg.PruefgangNr, "); + query.AppendLine(" pg.PruefstationNr, "); query.AppendLine(" pg.Datum, "); - + query.AppendLine(" pg.Pruefzeit, "); query.AppendLine(" apsn.Wiederholungen, "); query.AppendLine(" apsn.Einbauplatz, "); query.AppendLine(" pg.Nennweite, "); - + query.AppendLine(" idt.Baulaenge, "); + query.AppendLine(" PP1_Soll,PP1_Ist,PP1_Ist_V, "); @@ -206,6 +208,16 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers query.AppendLine(" PP10_Soll,PP10_Ist,PP10_Ist_V, "); query.AppendLine(" pf.PP10_Fehler "); + + for (int p = 1; p <= 3; p++) + { + for (int f = 1; f <= 10 ; f++) + { + query.AppendLine($",pf{p}.PP{f}_Fehler"); + } + } + + query.AppendLine(" from [Auftrag].[dbo].[AuftragPositionSerienNr] apsn "); query.AppendLine(" inner join [Auftrag].[dbo].[AuftragPosition_Gesamt] apg on apg.AuftragNr = apsn.AuftragNr and apg.PositionNr = apsn.PositionNr and apg.Ort = 'L2' "); @@ -213,6 +225,13 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers query.AppendLine(" inner join [Auftrag].[dbo].Prueffehler pf on pg.[Pruefgangnr] = pf.PruefgangNr and pf.SerienNr = apsn.SerienNr "); + query.AppendLine(" left join [Auftrag].[dbo].PrueffehlerGenesisPfade pf1 on pg.[Pruefgangnr] = pf.PruefgangNr and pf.SerienNr = apsn.SerienNr and pf1.[Pfad] = 1 "); + + query.AppendLine(" left join [Auftrag].[dbo].PrueffehlerGenesisPfade pf2 on pg.[Pruefgangnr] = pf.PruefgangNr and pf.SerienNr = apsn.SerienNr and pf2.[Pfad] = 2 "); + + query.AppendLine(" left join [Auftrag].[dbo].PrueffehlerGenesisPfade pf3 on pg.[Pruefgangnr] = pf.PruefgangNr and pf.SerienNr = apsn.SerienNr and pf3.[Pfad] = 3 "); + + query.AppendLine(" left outer join Identnr idt on idt.IdentNr = apg.Identnr "); query.AppendLine(" where apsn.SerienNr in ( "); query.AppendLine(" SELECT "); @@ -227,7 +246,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers query.AppendLine(" group by [MapPcbIdToSerialNumber_SerialNumber] "); query.AppendLine(" having Count(*) < 5) "); query.AppendLine(" "); - query.AppendLine(" and PP3_Fehler is not null "); + query.AppendLine(" and pf.PP3_Fehler is not null "); query.AppendLine(" "); query.AppendLine(" order by apsn.SerienNr desc, apsn.Wiederholungen asc "); @@ -238,7 +257,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers var sb = new StringBuilder(); - sb.Append("AuftragNr;PositionNr;SerienNr;PruefgangNr;Datum;Wiederholungen;Einbauplatz;Nennweite;"); + sb.Append("AuftragNr;PositionNr;SerienNr;PruefgangNr;PruefstationNr;Datum;Pruefzeit;Wiederholungen;Einbauplatz;Nennweite;Baulaenge"); @@ -246,6 +265,17 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers { sb.Append($"PP{i}_Soll [m3/h];PP{i}_Ist[m3/h];PP{i}_Ist_V[l];PP{i}_Fehler[%];"); } + + + for (int p = 1; p <= 3; p++) + { + for (int f = 1; f <= 10; f++) + { + query.AppendLine($",PP{f}_Fehler"); + } + } + + sb.AppendLine(); foreach (var item in dt.Select()) { diff --git a/Common/Service/MeterProcessState/Controllers/ProccesStateController.cs b/Common/Service/MeterProcessState/Controllers/ProccesStateController.cs index 832542ba..e916268f 100644 --- a/Common/Service/MeterProcessState/Controllers/ProccesStateController.cs +++ b/Common/Service/MeterProcessState/Controllers/ProccesStateController.cs @@ -853,7 +853,7 @@ namespace Service.MeterProcessState.Controllers dt = dataAccess.ExecuteQuery(sb.ToString()); - if (dt.Rows.Count == 1 ) + if (dt.Rows.Count == 0 ) { var stat = new GenesisStatus { @@ -882,10 +882,10 @@ namespace Service.MeterProcessState.Controllers ret.SkipRadioParametersCheck = (Boolean)item["SkipRadioParametersCheck"]; ret.OverrideFwCheck = (int)item["OverrideFwCheck"]; ret.OverrideLutCheck = (int)item["OverrideLutCheck"]; - ret.RequiredLifeTimeYearsAssembly = (Double)item["RequiredLifeTimeYearsAssembly"]; - ret.RequiredLifeTimeYearsShipping = (Double)item["RequiredLifeTimeYearsShipping"]; - ret.MaxDrainedBatteryLoadPercent = (Double)item["MaxDrainedBatteryLoadPercent"]; - ret.KitronProductionDate = (DateTime)item["KitronProductionDate"]; + //ret.RequiredLifeTimeYearsAssembly = (Double)item["RequiredLifeTimeYearsAssembly"]; + //ret.RequiredLifeTimeYearsShipping = (Double)item["RequiredLifeTimeYearsShipping"]; + //ret.MaxDrainedBatteryLoadPercent = (Double)item["MaxDrainedBatteryLoadPercent"]; + //ret.KitronProductionDate = (DateTime)item["KitronProductionDate"]; var maxStorageMonths = (Int32)item["MaxStorageMonths"]; ret.ProductionDueDate = ret.KitronProductionDate + TimeSpan.FromDays(30.0 * maxStorageMonths); ret.ApprovalDate = (DateTime)item["ApprovalDate"]; diff --git a/Common/Service/MeterProcessState/Controllers/PushControler.cs b/Common/Service/MeterProcessState/Controllers/PushControler.cs new file mode 100644 index 00000000..f7b98f2a --- /dev/null +++ b/Common/Service/MeterProcessState/Controllers/PushControler.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +using System.Web.Http; +using Xylem.Common.Logic.ServiceCore; + + +namespace Xylem.Common.Service.MeterProcessState.Controllers +{ + [RoutePrefix("api/PushData")] + public class PushDataController : ApiController + { + public static class GlobalConfig + { + public static Lazy connectionString = new Lazy(() + => + System.Configuration.ConfigurationManager.ConnectionStrings["default"].ConnectionString + ); + } + + + + [Route("SetOrderisFinish")] + public async Task SetOrderisFinish(int Auftrag, int Pos) + { + try + { + throw new NotImplementedException("TODO Roland"); + + } + catch (Exception ex) + { + return Request.CreateResponse(HttpStatusCode.InternalServerError, ex.ToString() + "
" + ex.InnerException.ToString()); + } + } + + + + + + } +} \ No newline at end of file diff --git a/Common/Service/MeterProcessState/MeterProcessState.csproj b/Common/Service/MeterProcessState/MeterProcessState.csproj index 52a2f58e..0a8783fd 100644 --- a/Common/Service/MeterProcessState/MeterProcessState.csproj +++ b/Common/Service/MeterProcessState/MeterProcessState.csproj @@ -221,6 +221,7 @@ + diff --git a/Common/Tools/Tools.JsonToXlsHelper/obj/Debug/Tools.JsonToXlsHelper.csproj.CoreCompileInputs.cache b/Common/Tools/Tools.JsonToXlsHelper/obj/Debug/Tools.JsonToXlsHelper.csproj.CoreCompileInputs.cache index 0028f628..133b97f0 100644 --- a/Common/Tools/Tools.JsonToXlsHelper/obj/Debug/Tools.JsonToXlsHelper.csproj.CoreCompileInputs.cache +++ b/Common/Tools/Tools.JsonToXlsHelper/obj/Debug/Tools.JsonToXlsHelper.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -f64d563def603c89cafafa61a3219ba97e1e344c +0d85a5b3a7561b41163c20e5dc7713bcd0d65555 diff --git a/Common/Ui/LegacyGenesisControl/ctlBatch.cs b/Common/Ui/LegacyGenesisControl/ctlBatch.cs index 45cde85a..c59504f0 100644 --- a/Common/Ui/LegacyGenesisControl/ctlBatch.cs +++ b/Common/Ui/LegacyGenesisControl/ctlBatch.cs @@ -228,7 +228,7 @@ namespace XylemCommonUiLegacyGenCtl case BatchState.StartMesurement: var tStartMesurement = Task.Factory.StartNew(() => { return StartMeasurement_Internal(); }); tStartMesurement.ContinueWith(r => { _currentState = r.Result ? BatchState.MeasurementActive : BatchState.Error; }); - + break; case BatchState.MeasurementActive: // wait for signal that the measurement can be stopped @@ -1205,7 +1205,7 @@ namespace XylemCommonUiLegacyGenCtl //this will be used for intermediate tolerance calculation. //ReSharper disable once CompareOfFloatsByEqualityOperator as the rounding will take place in the //Cordonel and only an unequally value needs to be detected - //when Start and Stop Record have diffrent Volumes the meter is ready for test + //when Start and Stop Record have diffrent Volumes the meter is ready for test if (r.DutStartRecord.GetVolumeCm() != r.DutStopRecord.GetVolumeCm()) { _logger.Info($" Meter {meter.Slot} Meter has progress {r.DutVolumeCm}"); @@ -1403,14 +1403,18 @@ namespace XylemCommonUiLegacyGenCtl } } - if (item is GenesisMeter gm) - { - gm.CurrentActionText = "FlowTest"; - } + })); } listOfTasks.ForEach(t => t.Start()); Task.WaitAll(listOfTasks.ToArray()); + foreach (var item in batch.ListOfMeters) + { + if (!IsAdjustment && item is GenesisMeter gm) + { + gm.CurrentActionText = "FlowTest"; + } + } return true; } catch (Exception ex)