public cashUnit.lppCdmCashUnit returnCashUnitInfo(Form1.spLogBuff spLogLine)
        {
            cashUnit.lppCdmCashUnit lppCdmCashUnit = parseOperations.extractCdmCashUnitInStartExchange(spLogLine);



            return(lppCdmCashUnit);
        }
Ejemplo n.º 2
0
        public static cashUnit.lppCdmCashUnit extractCdmCashUnitInStartExchange(Form1.spLogBuff spLogLine)
        {
            cashUnit.lppCdmCashUnit cdmCashUnit = new cashUnit.lppCdmCashUnit();

            string[] stringSeparators = new string[] { "\r\n" };

            string[] cuParsedArray = spLogLine.csInfo.Split(stringSeparators, StringSplitOptions.None);

            string usCount = (from d in cuParsedArray
                              where d.Contains("usCount = [")
                              select d).First();


            char[] charSeperators = new char[] { ':', ',', '\t', '[', ']' };

            List <cashUnit.lppCdmCashUnit> startExchangeLpplist = new List <cashUnit.lppCdmCashUnit>();

            int cuParsedArrayIndex = 0;

            for (int i = 0; i < Convert.ToInt16(usCount.Split(charSeperators)[1]); i++)
            {
etiket:
                foreach (string spLog in cuParsedArray)
                {
                    if (spLog.Contains("lppList[" + i + "]"))
                    {
                        cashUnit.lppCdmCashUnit startExchangeLpplistObject = new cashUnit.lppCdmCashUnit();

                        startExchangeLpplistObject.usNumber         = Convert.ToInt16(cuParsedArray[cuParsedArrayIndex + 2].Split(charSeperators)[1]);
                        startExchangeLpplistObject.usType           = cuParsedArray[cuParsedArrayIndex + 3].Split(charSeperators)[1];
                        startExchangeLpplistObject.lpszCashUnitName = cuParsedArray[cuParsedArrayIndex + 4].Split(charSeperators)[1];
                        startExchangeLpplistObject.cUnitIDAscii     = cuParsedArray[cuParsedArrayIndex + 5].Split(charSeperators)[1];
                        startExchangeLpplistObject.cUnitIDHex       = splitStringHexArray(cuParsedArray[cuParsedArrayIndex + 6].Split(charSeperators)[1]);
                        startExchangeLpplistObject.cCurrencyIDAscii = cuParsedArray[cuParsedArrayIndex + 7].Split(charSeperators)[1];
                        startExchangeLpplistObject.cCurrencyIDHex   = splitStringHexArray(cuParsedArray[cuParsedArrayIndex + 8].Split(charSeperators)[1]);
                        startExchangeLpplistObject.ulValues         = Convert.ToInt16(cuParsedArray[cuParsedArrayIndex + 9].Split(charSeperators)[1]);
                        startExchangeLpplistObject.ulInitialCount   = Convert.ToInt16(cuParsedArray[cuParsedArrayIndex + 10].Split(charSeperators)[1]);
                        startExchangeLpplistObject.ulCount          = Convert.ToInt16(cuParsedArray[cuParsedArrayIndex + 11].Split(charSeperators)[1]);;
                        startExchangeLpplistObject.ulRejectCount    = Convert.ToInt16(cuParsedArray[cuParsedArrayIndex + 12].Split(charSeperators)[1]);
                        startExchangeLpplistObject.ulMinimum        = Convert.ToInt16(cuParsedArray[cuParsedArrayIndex + 13].Split(charSeperators)[1]);
                        startExchangeLpplistObject.ulMaximum        = Convert.ToInt16(cuParsedArray[cuParsedArrayIndex + 14].Split(charSeperators)[1]);
                        startExchangeLpplistObject.bAppLock         = Convert.ToBoolean(cuParsedArray[cuParsedArrayIndex + 15].Split(charSeperators)[1]);
                        startExchangeLpplistObject.usStatus         = cuParsedArray[cuParsedArrayIndex + 16].Split(charSeperators)[1];
                        startExchangeLpplistObject.usNumPhysicalCUs = Convert.ToInt16(cuParsedArray[cuParsedArrayIndex + 17].Split(charSeperators)[1]);;
                        //List<lppPhysical> lppPhysicalList;
                        startExchangeLpplist.Add(startExchangeLpplistObject);
                        goto etiket;
                    }
                    cuParsedArrayIndex++;
                }
            }

            return(cdmCashUnit);
        }
Ejemplo n.º 3
0
 private void button5_Click_1(object sender, EventArgs e)
 {
     foreach (string str in spLogFileNames)
     {
         spLogBuff[] spLogLines = createFileStreamHeaderSpLogLineArray(str);
         foreach (spLogBuff spLogLine in spLogLines)
         {
             if (spLogLine.csInfo.Contains("WFS_CMD_CDM_START_EXCHANGE") && spLogLine.csInfo.Contains("WFS_EXECUTE_COMPLETE"))
             {
                 cashUnit.lppCdmCashUnit lppCdmCashUnitInStartExchange = parseOperations.extractCdmCashUnitInStartExchange(spLogLine);
             }
         }
     }
 }