package org.ts.ddcs.DataTemplate.jtTemplate;


import org.ts.ddcs.DataItemTemplate.DataItemTemplateImg;
import org.ts.ddcs.DataItemTemplate.jtDataItemTemplate.JtDataItemTemplateLocation;
import org.ts.ddcs.Tool.BytesHelp;
import io.lettuce.core.StrAlgoArgs;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;

/**
 * 交通808-2019规约数据模板
 * created by swp on 2017/8/23
 *
 * @author dylan
 */
public class JtDataTemplateMultimedia extends JtDataTemplate {


    @Override
    public void Stream() {
        try {
            if (dataLen > 0 && dataLen == dataArea.length) {
                int count = 0;
                //报警

                count += 4;
                //状态

                count += 4;
                //纬度 经度

                byte[] location = BytesHelp.subBytes(this.dataArea, count, dataArea.length-8);
                JtDataItemTemplateLocation itemTemplateLocation = new JtDataItemTemplateLocation();
                itemTemplateLocation.Stream(location);
                this.dataItem = new HashMap<>();
                this.dataItem.put("location", itemTemplateLocation);


            }
        } catch (Exception e) {

        }
    }

}
