import java.io.IOException;

public class UBXTest {

    public static void main(String[] args) throws Exception {
        test();
    }

    public static void test() throws IOException {
        //读取本地数据模拟
       /* FileInputStream fileInputStream = new FileInputStream("2023-02-02-151826.txt");
        int mSize = 0;
        int temp;
        List<Byte> mList = new ArrayList<>();
        FocusCalculator focusCalculator = new FocusCalculator(150,null,null);
        while ((temp = fileInputStream.read()) != -1){
            mList.add((byte)temp); //添加数据
            mSize++;
            if (mList.size() >= 2 && mList.get(mSize - 2) == '\r' && mList.get(mSize - 1) == '\n') {
                byte[] bytes = new byte[mList.size() - 2];
                for (int i = 0; i < bytes.length; i++) {
                    bytes[i] = mList.get(i);
                }
                //提取得到b562数据
                double[] doubles = UBXUtil.dataAnalysis(bytes,16);
                //计算到单次相对位置xyz并记录
                System.out.println(Arrays.toString(doubles));
                focusCalculator.addXyz(doubles);
                mList.clear();
                mSize = 0;
            }
        }
        //融合
        double[] result = focusCalculator.resultB562(null);
        if(result != null){
            System.out.println("result："+ Arrays.toString(result));
        }
        fileInputStream.close();*/
    }

}
