package com.kfb.kfbv1.model;

public class KfbParser {
    public KfbGate dataParser(String aData,KfbGate aGate)
    {
        KfbGate k = aGate;
        int p  =0;
        String[] aa =null;
        float ff = 0;
        KfbMeasure mm;

        p = aData.lastIndexOf("Dane:");
        p = p+5;
        String t = aData.substring(p ,p+384);
        aa = null;
        aa = t.split(",");
        for(int i=0;i<64;i++)
        {
            ff = Float.parseFloat(aa[i]);
            k.getmMeasure().mTemp[i]=ff;
        }
        p = aData.lastIndexOf("Tmax:");
        p = p+5;
        t = aData.substring(p ,p+5);
        k.setmMaxT(t);
        p = aData.lastIndexOf("Stat:");
        p = p+5;
        t = aData.substring(p ,p+1);
        k.setmStat(t);
        p = aData.lastIndexOf("status:");
        p=p+7;
        t = aData.substring(p ,p+6);
        k.setmStatus(t);
        return k;
    }
}
