From 93ae4b5ed1eb98b3a3ff7fecfaac0f32f86ea81e Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 18 Mar 2022 16:43:13 -0700 Subject: [PATCH] IO-1777 Add in collection of paint threshold values. --- BodyshopUploader/Releases/RELEASES | 4 +++- .../Utils/Decoder/EstimateDecoder.cs | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/BodyshopUploader/Releases/RELEASES b/BodyshopUploader/Releases/RELEASES index 73e57f8..e9a54e2 100644 --- a/BodyshopUploader/Releases/RELEASES +++ b/BodyshopUploader/Releases/RELEASES @@ -60,4 +60,6 @@ D441404BE86E0A676462DD367D4355894C2FFDBA ImEXOnlinePartner-1.0.30-delta.nupkg 62 8F1739F9B7C202F7E2453E7D5027F7422637D206 ImEXOnlinePartner-1.0.31-delta.nupkg 152092 6B3D3A0DD81D6F0C302ACE42DEDDDFC11270DD22 ImEXOnlinePartner-1.0.31-full.nupkg 5609086 9DA03F46A6BB7040C98C7DE9F308562031D790FE ImEXOnlinePartner-1.0.32-delta.nupkg 85634 -3B840B836E8F3F9C15C7F75AE9CE393C42FFB1AA ImEXOnlinePartner-1.0.32-full.nupkg 5607667 \ No newline at end of file +3B840B836E8F3F9C15C7F75AE9CE393C42FFB1AA ImEXOnlinePartner-1.0.32-full.nupkg 5607667 +5C61CDF97FA03C44FF74EE4E2EE4514177CE1326 ImEXOnlinePartner-1.0.33-delta.nupkg 43893 +01123C15D95479FCE91F2C24CCEFEE4F08A6FC8A ImEXOnlinePartner-1.0.33-full.nupkg 5608151 \ No newline at end of file diff --git a/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs b/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs index ead78a9..77db10c 100644 --- a/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs +++ b/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs @@ -765,20 +765,28 @@ namespace BodyshopPartner.Utils.Decoder "MAT_TX_TY5", "MAT_TX_IN5" }); + + dynamic d = new JObject(); + for (int i = 0; i < reader.RecordCount; i++) { var readValues = reader.NextRecord(); + dynamic o = new JObject(); switch (readValues[0].ToString())//Case switch on MATL_TYPE to assign correctly. { //TODO: Import MAXDLR for every type. case "MAPA": + j.rate_mapa = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.? j.tax_paint_mat_rt = float.Parse(readValues[14].ToString()) / 100; + o.cal_maxdlr = float.Parse(readValues[3].ToString()) ; + d.mapa = o; break; case "MASH": j.rate_mash = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.? j.tax_shop_mat_rt = float.Parse(readValues[14].ToString()) / 100; - + o.cal_maxdlr = float.Parse(readValues[3].ToString()); + d.mash = o; break; case "MAHW": //TODO Should the remainder of these be index 7 or 11? j.rate_mahw = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.? @@ -805,6 +813,7 @@ namespace BodyshopPartner.Utils.Decoder } } + j.materials = d; //TODO: There was additional logic in paradox here around the mxdlr being > 0 which it always appears to be. //j.matl_type = readValues[0];//MATL_TYPE @@ -1077,7 +1086,7 @@ namespace BodyshopPartner.Utils.Decoder for (int i = 0; i < reader.RecordCount; i++) { - logger.Debug($"Reading line {i +1}"); + logger.Debug($"Reading line {i + 1}"); var readValues = reader.NextRecord(false); dynamic lin = new JObject(); @@ -1168,7 +1177,8 @@ namespace BodyshopPartner.Utils.Decoder logger.Error(ex, "Unable to open LIN file. Retrying. "); retryNumber++; Thread.Sleep(retrySleep); - }catch(Exception Ex) + } + catch (Exception Ex) { logger.Error(Ex, "Unable to open LIN file. Retrying. Unknown Exception "); retryNumber++;