package org.ts.ddcs.DataTemplate;

import org.ts.ddcs.Log.LogHelper;
import org.ts.ddcs.Tool.BytesHelp;

@SuppressWarnings("all")
public class DataTemplateSzy2012C02 extends DataTemplateSzy2012 {
    private byte[] collectTime;

    @Override
    public String GetViewName() {
        return "链路报";
    }

    @Override
    public byte[] CollectTime() {
        return this.collectTime;
    }

    @Override
    public void Stream() {
        try {
            if (dataLen > 0) {
                // SimpleDateFormat timeFormat = new SimpleDateFormat("yyyyMMddHHmmss");
                // String dt = timeFormat.format(new Date());
                // collectTime =   BytesHelp.subBytes(BytesHelp.hexStr2Bytes(dt),2,dt.length()-2);
                int count = 0;
                byte[] online = BytesHelp.subBytes(this.dataArea, count, 1);
                count += 1;

                //F0 登录，F1 退出登录，F2 在线保持
                LogHelper.info(BytesHelp.byte2HexStr(this.rtuCode) + ":02" + ":" + BytesHelp.byte2HexStr(online));
                if (count != this.dataArea.length) {
                    LogHelper.info("******************* 2F DATA ERROR******************* ");
                }
            }
        } catch (Exception e) {
            LogHelper.error(e);
        }
    }
}
