} //end detect coin public async Task <CoinUtils> detectCoin(CoinUtils cu, int milliSecondsToTimeOut) { cu.generatePan(); var t00 = detectOne(00, cu.cc.nn, cu.cc.sn, cu.cc.an[00], cu.pans[00], cu.getDenomination()); var t01 = detectOne(01, cu.cc.nn, cu.cc.sn, cu.cc.an[01], cu.pans[01], cu.getDenomination()); var t02 = detectOne(02, cu.cc.nn, cu.cc.sn, cu.cc.an[02], cu.pans[02], cu.getDenomination()); var t03 = detectOne(03, cu.cc.nn, cu.cc.sn, cu.cc.an[03], cu.pans[03], cu.getDenomination()); var t04 = detectOne(04, cu.cc.nn, cu.cc.sn, cu.cc.an[04], cu.pans[04], cu.getDenomination()); var t05 = detectOne(05, cu.cc.nn, cu.cc.sn, cu.cc.an[05], cu.pans[05], cu.getDenomination()); var t06 = detectOne(06, cu.cc.nn, cu.cc.sn, cu.cc.an[06], cu.pans[06], cu.getDenomination()); var t07 = detectOne(07, cu.cc.nn, cu.cc.sn, cu.cc.an[07], cu.pans[07], cu.getDenomination()); var t08 = detectOne(08, cu.cc.nn, cu.cc.sn, cu.cc.an[08], cu.pans[08], cu.getDenomination()); var t09 = detectOne(09, cu.cc.nn, cu.cc.sn, cu.cc.an[09], cu.pans[09], cu.getDenomination()); var t10 = detectOne(10, cu.cc.nn, cu.cc.sn, cu.cc.an[10], cu.pans[10], cu.getDenomination()); var t11 = detectOne(11, cu.cc.nn, cu.cc.sn, cu.cc.an[11], cu.pans[11], cu.getDenomination()); var t12 = detectOne(12, cu.cc.nn, cu.cc.sn, cu.cc.an[12], cu.pans[12], cu.getDenomination()); var t13 = detectOne(13, cu.cc.nn, cu.cc.sn, cu.cc.an[13], cu.pans[13], cu.getDenomination()); var t14 = detectOne(14, cu.cc.nn, cu.cc.sn, cu.cc.an[14], cu.pans[14], cu.getDenomination()); var t15 = detectOne(15, cu.cc.nn, cu.cc.sn, cu.cc.an[15], cu.pans[15], cu.getDenomination()); var t16 = detectOne(16, cu.cc.nn, cu.cc.sn, cu.cc.an[16], cu.pans[16], cu.getDenomination()); var t17 = detectOne(17, cu.cc.nn, cu.cc.sn, cu.cc.an[17], cu.pans[17], cu.getDenomination()); var t18 = detectOne(18, cu.cc.nn, cu.cc.sn, cu.cc.an[18], cu.pans[18], cu.getDenomination()); var t19 = detectOne(19, cu.cc.nn, cu.cc.sn, cu.cc.an[19], cu.pans[19], cu.getDenomination()); var t20 = detectOne(20, cu.cc.nn, cu.cc.sn, cu.cc.an[20], cu.pans[20], cu.getDenomination()); var t21 = detectOne(21, cu.cc.nn, cu.cc.sn, cu.cc.an[21], cu.pans[21], cu.getDenomination()); var t22 = detectOne(22, cu.cc.nn, cu.cc.sn, cu.cc.an[22], cu.pans[22], cu.getDenomination()); var t23 = detectOne(23, cu.cc.nn, cu.cc.sn, cu.cc.an[23], cu.pans[23], cu.getDenomination()); var t24 = detectOne(24, cu.cc.nn, cu.cc.sn, cu.cc.an[24], cu.pans[24], cu.getDenomination()); var taskList = new List <Task> { t00, t01, t02, t03, t04, t05, t06, t07, t08, t09, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24 }; await Task.WhenAll(taskList.ToArray()); //Get data from the detection agents for (int i = 0; i < 25; i++) { if (responseArray[i] != null) { cu.setPastStatus(responseArray[i].outcome, i); CoreLogger.Log(cu.cc.sn + " detect:" + i + " " + responseArray[i].fullResponse); } else { cu.setPastStatus("undetected", i); }; // should be pass, fail, error or undetected. } //end for each detection agent cu.setAnsToPansIfPassed(); cu.calculateHP(); // cu.gradeCoin(); // sets the grade and figures out what the file extension should be (bank, fracked, counterfeit, lost cu.calcExpirationDate(); cu.grade(); return(cu); } //end detect coin
} //end importJSON // en d json test public String setJSON(FoundersCloudCoin cc) { const string quote = "\""; const string tab = "\t"; String json = (tab + tab + "{ " + Environment.NewLine); // { json += tab + tab + quote + "nn" + quote + ":" + quote + cc.nn + quote + ", " + Environment.NewLine; // "nn":"1", json += tab + tab + quote + "sn" + quote + ":" + quote + cc.sn + quote + ", " + Environment.NewLine; // "sn":"367544", json += tab + tab + quote + "an" + quote + ": [" + quote; // "an": [" for (int i = 0; (i < 25); i++) { json += cc.an[i]; // 8551995a45457754aaaa44 if (i == 4 || i == 9 || i == 14 || i == 19) { json += quote + "," + Environment.NewLine + tab + tab + tab + quote; //", } else if (i == 24) { // json += "\""; last one do nothing } else { // end if is line break json += quote + ", " + quote; } // end else } // end for 25 ans json += quote + "]," + Environment.NewLine; //"], // End of ans CoinUtils cu = new CoinUtils(cc); cu.calcExpirationDate(); json += tab + tab + quote + "ed" + quote + ":" + quote + cu.cc.ed + quote + "," + Environment.NewLine; // "ed":"9-2016", if (string.IsNullOrEmpty(cc.pown)) { cc.pown = "uuuuuuuuuuuuuuuuuuuuuuuuu"; } //Set pown to unknow if it is not set. json += tab + tab + quote + "pown" + quote + ":" + quote + cc.pown + quote + "," + Environment.NewLine; // "pown":"uuupppppffpppppfuuf", json += tab + tab + quote + "aoid" + quote + ": []" + Environment.NewLine; json += tab + tab + "}" + Environment.NewLine; // Keep expiration date when saving (not a truley accurate but good enought ) return(json); }