Ejemplo n.º 1
0
        private string[] parseChronoData(ECLibData data, int idx)
        {
            bool vmp4        = ECLib.is_vmp4(infos.DeviceCode);
            int  base_offset = idx * data.Infos.NbCols;

            string[] row = new string[0];

            int t_high = data.Buf[base_offset + 0];
            int t_low  = data.Buf[base_offset + 1];
            int ewe    = data.Buf[base_offset + 2];
            int I      = data.Buf[base_offset + 3];
            int cycle  = data.Buf[base_offset + 4];

            long   t_64 = (((long)t_high) << 32) + t_low;
            double time = data.Infos.StartTime + data.Curr.TimeBase * t_64;
            float  f_ewe = 0.0f, f_I = 0.0f;

            if (ECLib.BL_ConvertNumericIntoSingle(ewe, ref f_ewe) == ECLib.ErrorCode.ERR_NOERROR &&
                ECLib.BL_ConvertNumericIntoSingle(I, ref f_I) == ECLib.ErrorCode.ERR_NOERROR)
            {
                row    = new string[4];
                row[0] = time.ToString("F6");
                row[1] = f_ewe.ToString("F6");
                row[2] = f_I.ToString("F6");
                row[3] = cycle.ToString();
            }
            return(row);
        }
Ejemplo n.º 2
0
        private string[] parseOcvData(ECLibData data, int idx)
        {
            bool vmp4        = ECLib.is_vmp4(infos.DeviceCode);
            int  base_offset = idx * data.Infos.NbCols;

            string[] row = vmp4 ? new string[2] : new string[3];

            int  t_high = data.Buf[base_offset + 0];
            int  t_low  = data.Buf[base_offset + 1];
            int  ewe    = data.Buf[base_offset + 2];
            long t_64   = (((long)t_high) << 32) + t_low;

            double time  = data.Infos.StartTime + data.Curr.TimeBase * t_64;
            float  f_ewe = 0.0f;

            if (ECLib.BL_ConvertNumericIntoSingle(ewe, ref f_ewe) == ECLib.ErrorCode.ERR_NOERROR)
            {
                row[0] = time.ToString("F6");
                row[1] = f_ewe.ToString("F6");
                if (!vmp4)
                {
                    // VMP3 sends an additional row of data
                    int   ece   = data.Buf[base_offset + 3];
                    float f_ece = 0.0f;
                    if (ECLib.BL_ConvertNumericIntoSingle(ece, ref f_ece) == ECLib.ErrorCode.ERR_NOERROR)
                    {
                        row[2] = f_ece.ToString("F6");
                    }
                }
            }
            return(row);
        }