IO-1777 Add in collection of paint threshold values.

This commit is contained in:
Patrick Fic
2022-03-18 16:43:13 -07:00
parent ce61e11837
commit 93ae4b5ed1
2 changed files with 16 additions and 4 deletions

View File

@@ -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++;