public static cashUnit.iStoreMoneyEx parseStringIStoreMoneyEx(Form1.spLogBuff spLogLine) { cashUnit.iStoreMoneyEx iStoreMoneyExObject = new cashUnit.iStoreMoneyEx(); string[] stringSeparators = new string[] { "\r\n" }; char[] charSeperators = new char[] { ':', ',', '\t', '[', ']' }; string[] cuParsedArray = spLogLine.csInfo.Split(stringSeparators, StringSplitOptions.None); List <string> iStoreMoneyExList = new List <string>(); List <cashUnit.asInOutCassetteInfo> cassetteInfoList = new List <cashUnit.asInOutCassetteInfo>(); List <cashUnit.iAbArea> acCassetteInfoList = new List <cashUnit.iAbArea>(); List <cashUnit.asDenomInfo> denomInfoList = new List <cashUnit.asDenomInfo>(); List <cashUnit.asDenomInfo> asDenomInfoObjectList = new List <cashUnit.asDenomInfo>(); foreach (string str in cuParsedArray) { if (str.Contains("asInOutCassetteInfo[")) { cashUnit.asInOutCassetteInfo cassetteInfo = new cashUnit.asInOutCassetteInfo(); string[] splittedString = str.Split(charSeperators); cassetteInfo.iCassetteSlotNo = splittedString[4]; cassetteInfo.iNum = Convert.ToInt16(splittedString[6]); cassetteInfoList.Add(cassetteInfo); } else if (str.Contains("iAbAreaA:")) { cashUnit.iAbArea acCassetteInfo = new cashUnit.iAbArea(); string[] splittedStr = str.Split(charSeperators); acCassetteInfo.iAbAreaA = Convert.ToInt16(splittedStr[1]); acCassetteInfo.iAbAreaB = Convert.ToInt16(splittedStr[3]); acCassetteInfo.iAbAreaC = Convert.ToInt16(splittedStr[5]); iStoreMoneyExObject.acCassetteInfoList = acCassetteInfo; } else if (str.Contains("asDenomInfo[")) { cashUnit.asDenomInfo asDenomInfoObject = new cashUnit.asDenomInfo(); string[] asDenomInfoObjectArray = str.Split(charSeperators); asDenomInfoObject.iCode = asDenomInfoObjectArray[4]; asDenomInfoObject.iNum = Convert.ToInt16(asDenomInfoObjectArray[6]); asDenomInfoObjectList.Add(asDenomInfoObject); } else if (str.Contains("iLogicCode:")) { string[] iLogicCode = str.Split(charSeperators); iStoreMoneyExObject.iLogicCode = iLogicCode[1]; } } iStoreMoneyExObject.iStoreMoneyExDateTime = parseOperations.extractDateTimeFromSpLogLine(spLogLine); iStoreMoneyExObject.denomInfoList = asDenomInfoObjectList; iStoreMoneyExObject.cassetteInfoList = cassetteInfoList; return(iStoreMoneyExObject); }
public static cashUnit.iStoreMoneyEx iStoreMoneyExObject(Form1.spLogBuff spLogLine) { cashUnit.iStoreMoneyEx iStoreMoneyExObject = parseOperations.parseStringIStoreMoneyEx(spLogLine); return(iStoreMoneyExObject); }
private void button3_Click(object sender, EventArgs e) { List <cashUnit.iStoreMoneyEx> iStoreMoneyExList = new List <cashUnit.iStoreMoneyEx>(); List <cashUnit.asDenomInfo> asDenomInfoList = new List <cashUnit.asDenomInfo>(); foreach (string str in spLogFileNames) { spLogBuff[] spLogLines = createFileStreamHeaderSpLogLineArray(str); foreach (spLogBuff spLogLine in spLogLines) { if (spLogLine != null) { if (spLogLine.csInfo.Contains("iStoreMoneyEx end") || spLogLine.csInfo.Contains("iStoreMoney,")) { cashUnit.iStoreMoneyEx iStoreMoneyExLine = parseOperations.parseStringIStoreMoneyEx(spLogLine); iStoreMoneyExList.Add(iStoreMoneyExLine); if (iStoreMoneyExLine.cassetteInfoList.Count == 0) { richTextBox1.Text += "Recycle Cassette slot: 0 - Count: 0 \r\n"; } else if (iStoreMoneyExLine.cassetteInfoList.Count != 0) { foreach (cashUnit.asInOutCassetteInfo asInOutCassetteInfo in iStoreMoneyExLine.cassetteInfoList) { richTextBox1.Text += "Recycle Cassette slot: " + asInOutCassetteInfo.iCassetteSlotNo + " - Count: " + asInOutCassetteInfo.iNum + "\r\n"; } } foreach (cashUnit.asDenomInfo asDenomInfo in iStoreMoneyExLine.denomInfoList) { richTextBox1.Text += "NoteId: " + asDenomInfo.iCode + " - " + "Count: " + asDenomInfo.iNum + "\r\n"; asDenomInfoList.Add(asDenomInfo); } richTextBox1.Text += "iLogicCode: " + iStoreMoneyExLine.iLogicCode + "\r\n"; richTextBox1.Text += "Ac-A: " + iStoreMoneyExLine.acCassetteInfoList.iAbAreaA + "\r\n"; richTextBox1.Text += "Ac-B: " + iStoreMoneyExLine.acCassetteInfoList.iAbAreaB + "\r\n"; richTextBox1.Text += "Ac-C: " + iStoreMoneyExLine.acCassetteInfoList.iAbAreaC + "\r\n"; richTextBox1.Text += "Date Time: " + iStoreMoneyExLine.iStoreMoneyExDateTime + "\r\n"; richTextBox1.Text += "--------------------------------------------\r\n"; } else if (spLogLine.csInfo.Contains("iRetract end,") || spLogLine.csInfo.Contains("iRetract,")) { List <cashUnit.asDenomInfo> asDenomInfolistFromiRetractEnd = parseOperations.parseStringIRetractEndForAsDenomInfoList(spLogLine); foreach (cashUnit.asDenomInfo asDenomInfoObject in asDenomInfolistFromiRetractEnd) { asDenomInfoList.Add(asDenomInfoObject); } } } } } List <denomTranslation> noteCurrencyValueAmount = denomTranslation.displayCashInCurrencyValueCount(asDenomInfoList); richTextBox2.Text += "Currency" + ',' + "Value" + ',' + "Count" + ',' + "Amount" + "\r\n"; foreach (denomTranslation noteCurrencyValueAmountElement in noteCurrencyValueAmount) { richTextBox2.Text += noteCurrencyValueAmountElement.denomType + ',' + noteCurrencyValueAmountElement.denomValue + ',' + noteCurrencyValueAmountElement.denomCount + ',' + noteCurrencyValueAmountElement.denomValue * noteCurrencyValueAmountElement.denomCount + "\r\n"; //{noteCurrencyValueAmountElement.denomType // richTextBox2.Text += "Currency: " + noteCurrencyValueAmountElement.denomType + "\r\n"; // richTextBox2.Text += "Value: " + noteCurrencyValueAmountElement.denomValue + "\r\n"; // richTextBox2.Text += "Count: " + noteCurrencyValueAmountElement.denomCount + "\r\n"; // richTextBox2.Text += "Amount: " + noteCurrencyValueAmountElement.denomValue * noteCurrencyValueAmountElement.denomCount + "\r\n"; // //richTextBox2.Text += "Date Time: " + iStoreMoneyExLine.iStoreMoneyExDateTime + "\r\n"; // richTextBox2.Text += "--------------------------------------------\r\n"; } List <denomTranslation> cashInTotalsByCurrency = denomTranslation.cashInTotalsByCurrency(noteCurrencyValueAmount); richTextBox3.Text += "Currency" + ',' + "Amount" + "\r\n"; foreach (denomTranslation cashInTotalElement in cashInTotalsByCurrency) { richTextBox3.Text += cashInTotalElement.denomType + ',' + cashInTotalElement.denomTotal + "\r\n"; } }