package com.wd.workoffice.ui.activity.mes;

import android.os.Bundle;
import android.text.TextUtils;
import android.widget.TextView;

import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.mesBean.AnalysisBean;
import com.wd.workoffice.bean.mesBean.MonitorBean;
import com.wd.workoffice.util.WorkUtils;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * author : flexible
 * email : lgd19940421@163.com
 * github: https://github.com/FlexibleXd
 **/
public class MesMonitorDetailActivity extends WorkToolBarActivity {

    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_point)
    TextView tvPoint;
    @BindView(R.id.tv_change)
    TextView tvChange;
    @BindView(R.id.tv_location)
    TextView tvLocation;
    @BindView(R.id.tv_machine)
    TextView tvMachine;
    @BindView(R.id.tv_measure)
    TextView tvMeasure;
    @BindView(R.id.tv_measure_unit)
    TextView tvMeasureUnit;
    @BindView(R.id.tv_point_type)
    TextView tvPointType;
    @BindView(R.id.tv_gap)
    TextView tvGap;
    @BindView(R.id.tv_box)
    TextView tvBox;

    @Override
    protected void initView() {
        ButterKnife.bind(this);
    }


    @Override
    protected void initData() {
        MonitorBean.ListBean info = JSON.parseObject(getIntent().getStringExtra("info"), MonitorBean.ListBean.class);
        tvName.setText(info.getName());
        tvPoint.setText(info.getPointCode());
        tvChange.setText(info.getDescription());
        tvLocation.setText(info.getLocaDesc());
        tvMachine.setText(info.getAssetDesc() );
        tvMeasure.setText(info.getMeterDesc());
        tvMeasureUnit.setText(info.getMeasureUnit());
        tvPointType.setText(TextUtils.equals(info.getPointType(),"1") ? "设备测点" : "环境测点");
        tvGap.setText(info.getSelectTimeType()+"");
        tvBox.setText(info.getCollectbox());
    }


    @Override
    protected void initEvent() {
    }

    @Override
    protected int layoutId() {
        return R.layout.activity_monitor_detail;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
