temporary implemented new battery calculations and requirements checks
This commit is contained in:
@@ -101,6 +101,44 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Boolean GetCordonelRequirementInfoFromDbByFANr(String fanr, CordonelRequirements prodRequirements, out string errorMsg)
|
||||
{
|
||||
errorMsg = "";
|
||||
if (null == prodRequirements || string.IsNullOrEmpty(fanr))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var url = ServiceUrls.GetCordonelRequirementByFANrInfoServiceUrl(fanr);
|
||||
var response = LocalWebRequest.GetRequest(url, 30000, out var httpStatus);
|
||||
if (httpStatus == HttpStatusCode.OK && !string.IsNullOrEmpty(response))
|
||||
{
|
||||
var requirements = JsonConvert.DeserializeObject<CordonelRequirements>(response);
|
||||
var type = typeof(CordonelRequirements);
|
||||
foreach (var prop in type.GetProperties())
|
||||
{
|
||||
if (prop.CanWrite)
|
||||
prop.SetValue(prodRequirements, prop.GetValue(requirements, null), null);
|
||||
}
|
||||
|
||||
// For standard requirements the order number has to be set as those are neither PcbId based
|
||||
// nor order number based
|
||||
if (prodRequirements.ProductionOrderNr == null)
|
||||
prodRequirements.ProductionOrderNr = prodRequirements.OuterProductionOrderNr;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
errorMsg = e.Message;
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the calibration results for a meter from a test-bench calibration.
|
||||
/// </summary>
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
8cb55c312de586b683d72cf58c13e2801d10e14b767777d98338d3e1473a1213
|
||||
89102b0142e574de38a9f47d370f3334e5e6c268
|
||||
|
||||
Reference in New Issue
Block a user