导航菜单

页面标题

页面副标题

六分钟步行测试管理软件 v1.1.0.2112120029 - StreamDataReviewActivity.java 源代码

正在查看: 六分钟步行测试管理软件 v1.1.0.2112120029 应用的 StreamDataReviewActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package cn.neoprint.padmonitor.ui;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
import cn.neoprint.padmonitor.R;
import cn.neoprint.padmonitor.app.AppGlobal;
import cn.neoprint.padmonitor.data.entity.ReadStreamDataFromHisData;
import cn.neoprint.padmonitor.data.entity.StreamData;
import cn.neoprint.padmonitor.data.entity.StreamDrawLineData;
import cn.neoprint.padmonitor.ui.view.HisDataGridChart;
import cn.neoprint.padmonitor.utils.DateUtils;
import cn.neoprint.padmonitor.utils.FontManager;
import cn.neoprint.padmonitor.utils.constant.ConstDefine;
import cn.neoprint.padmonitor.utils.constant.Constants;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

public class StreamDataReviewActivity extends Activity implements View.OnClickListener, GestureDetector.OnGestureListener, View.OnTouchListener {
    private LinearLayout ParaTypeItem1;
    private LinearLayout ScaleTypeItem;
    public GestureDetector mGestureDetector;
    private TextView m_btnGoback;
    private long m_lSearchTime;
    private SimpleAdapter m_listAdapter;
    private ListView m_listView;
    private TextView m_txHRValue;
    private TextView m_txPRValue;
    private TextView m_txParaType;
    private TextView m_txParaTypeHR;
    private TextView m_txParaTypePR;
    private TextView m_txParaTypeResp;
    private TextView m_txParaTypeSPo2;
    private TextView m_txParaTypeST1;
    private TextView m_txParaTypeST2;
    private TextView m_txParaTypeTemp;
    private TextView m_txRespValue;
    private TextView m_txST1Value;
    private TextView m_txST2Value;
    private TextView m_txScaleType;
    private TextView m_txScaleType5Min;
    private TextView m_txScaleType5S;
    private TextView m_txSearchTime;
    private TextView m_txSpo2Value;
    private TextView m_txTempValue;
    AppGlobal myApp = null;
    private HisDataGridChart m_HisDataGridChart = null;
    private boolean bParaItemShow = false;
    private boolean bScaleItemShow = false;
    private ArrayList<HashMap<String, String>> m_listData = new ArrayList<>();
    private final int m_nShowTimeStage = Constants.AlarmPauseTime.PAUSE_5_MIN;
    private int m_nParaType = 10;
    private int m_nScaleType = 1;
    private int m_nJGTime = 5000;
    private long m_lEndSearchTime = 0;
    private float m_nStartY = -1.0f;
    private float m_nEndY = -1.0f;
    private SimpleDateFormat date_sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    public Handler m_Handler = new Handler();
    public int verticalMinDistance = 20;
    public int minVelocity = 0;
    Runnable SearchDataRunnable = new Runnable() {
        @Override
        public void run() {
            StreamDataReviewActivity.this.GetData();
        }
    };

    @Override
    public boolean onDown(MotionEvent motionEvent) {
        return false;
    }

    @Override
    public void onLongPress(MotionEvent motionEvent) {
    }

    @Override
    public boolean onScroll(MotionEvent motionEvent, MotionEvent motionEvent2, float f, float f2) {
        return false;
    }

    @Override
    public void onShowPress(MotionEvent motionEvent) {
    }

    @Override
    public boolean onSingleTapUp(MotionEvent motionEvent) {
        return false;
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        requestWindowFeature(1);
        AppGlobal appGlobal = (AppGlobal) getApplication();
        this.myApp = appGlobal;
        appGlobal.setSystemBarVisible(this, false);
        setContentView(R.layout.trend_review);
        this.myApp.SetBackgroundLight(this, -255, 78, true);
        setFinishOnTouchOutside(false);
        FontManager.changeFonts((ViewGroup) getWindow().getDecorView(), this, Typeface.createFromAsset(getAssets(), "fonts/MSBlack.ttf"));
        this.mGestureDetector = new GestureDetector(null, this, null);
        long currentTimeMillis = System.currentTimeMillis();
        this.m_lEndSearchTime = currentTimeMillis;
        this.m_lSearchTime = currentTimeMillis - (this.m_nJGTime * Constants.AlarmPauseTime.PAUSE_5_MIN);
        HisDataGridChart hisDataGridChart = (HisDataGridChart) findViewById(R.id.StreamLine);
        this.m_HisDataGridChart = hisDataGridChart;
        hisDataGridChart.setAxisMarginLeft(25.0f);
        this.m_HisDataGridChart.setAxisMarginBottom(12.0f);
        this.m_HisDataGridChart.SetLineColor(getResources().getColor(R.color.ECGclor));
        InitDrawLineGrid();
        TextView textView = (TextView) findViewById(R.id.SearchTime);
        this.m_txSearchTime = textView;
        textView.setOnClickListener(this);
        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(this.m_lSearchTime));
        System.out.println(format);
        this.m_txSearchTime.setText(format);
        TextView textView2 = (TextView) findViewById(R.id.ParaType);
        this.m_txParaType = textView2;
        textView2.setOnClickListener(this);
        TextView textView3 = (TextView) findViewById(R.id.ScaleType);
        this.m_txScaleType = textView3;
        textView3.setOnClickListener(this);
        this.m_txHRValue = (TextView) findViewById(R.id.HRValue);
        this.m_txPRValue = (TextView) findViewById(R.id.PRValue);
        this.m_txSpo2Value = (TextView) findViewById(R.id.Spo2Value);
        this.m_txRespValue = (TextView) findViewById(R.id.RespValue);
        this.m_txTempValue = (TextView) findViewById(R.id.TempValue);
        this.m_txST1Value = (TextView) findViewById(R.id.ST1Value);
        this.m_txST2Value = (TextView) findViewById(R.id.ST2Value);
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.ParaTypeItem);
        this.ParaTypeItem1 = linearLayout;
        linearLayout.setVisibility(4);
        TextView textView4 = (TextView) findViewById(R.id.ItemHR);
        this.m_txParaTypeHR = textView4;
        textView4.setOnClickListener(this);
        TextView textView5 = (TextView) findViewById(R.id.ItemPR);
        this.m_txParaTypePR = textView5;
        textView5.setOnClickListener(this);
        TextView textView6 = (TextView) findViewById(R.id.ItemSPO2);
        this.m_txParaTypeSPo2 = textView6;
        textView6.setOnClickListener(this);
        TextView textView7 = (TextView) findViewById(R.id.ItemResp);
        this.m_txParaTypeResp = textView7;
        textView7.setOnClickListener(this);
        TextView textView8 = (TextView) findViewById(R.id.ItemTemp);
        this.m_txParaTypeTemp = textView8;
        textView8.setOnClickListener(this);
        TextView textView9 = (TextView) findViewById(R.id.ItemST1);
        this.m_txParaTypeST1 = textView9;
        textView9.setOnClickListener(this);
        TextView textView10 = (TextView) findViewById(R.id.ItemST2);
        this.m_txParaTypeST2 = textView10;
        textView10.setOnClickListener(this);
        LinearLayout linearLayout2 = (LinearLayout) findViewById(R.id.ScaleTimeItem);
        this.ScaleTypeItem = linearLayout2;
        linearLayout2.setVisibility(4);
        TextView textView11 = (TextView) findViewById(R.id.Item5S);
        this.m_txScaleType5S = textView11;
        textView11.setOnClickListener(this);
        TextView textView12 = (TextView) findViewById(R.id.Item5Min);
        this.m_txScaleType5Min = textView12;
        textView12.setOnClickListener(this);
        TextView textView13 = (TextView) findViewById(R.id.Btn_goback);
        this.m_btnGoback = textView13;
        textView13.setOnClickListener(this);
        this.m_Handler.postDelayed(this.SearchDataRunnable, 1000L);
        this.m_listView = (ListView) findViewById(R.id.streamListview);
        this.m_listAdapter = new SimpleAdapter(this, this.m_listData, R.layout.stream_listview, new String[]{"time", "HR", "PR", "SpO2", "Resp", "Temp", "ST1", "ST2"}, new int[]{R.id.DateTime, R.id.HRListValue, R.id.PRListValue, R.id.SpO2ListValue, R.id.RespListValue, R.id.TempListValue, R.id.ST1ListValue, R.id.ST2ListValue});
    }

    @Override
    public void finish() {
        super.finish();
        overridePendingTransition(0, R.anim.zoomout);
    }

    public void ShowMessage(int i) {
        View inflate = getLayoutInflater().inflate(R.layout.mytoast, (ViewGroup) null);
        Toast toast = new Toast(getApplicationContext());
        toast.setView(inflate);
        toast.setGravity(17, -150, 0);
        ((TextView) inflate.findViewById(R.id.toastInfo)).setText(i);
        toast.show();
    }

    public int GetPointIdx(int i) {
        String str;
        if (i != 1) {
            str = i != 2 ? "" : ConstDefine.SD_PATH + "/WalkTest/Stream5Minpoint.dat";
        } else {
            str = ConstDefine.SD_PATH + ConstDefine.Stream5SecPoint_FILE_PATH;
        }
        File file = new File(str);
        int length = (int) file.length();
        if (length == 0) {
            return 0;
        }
        byte[] bArr = new byte[length];
        try {
            FileInputStream fileInputStream = new FileInputStream(file);
            fileInputStream.read(bArr);
            fileInputStream.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e2) {
            e2.printStackTrace();
        }
        return (bArr[0] & 255) + ((bArr[1] & 255) * 256) + ((bArr[2] & 255) * 65536) + ((bArr[3] & 255) * 16777216);
    }

    public void GetData() {
        int GetPointIdx = this.m_nScaleType == 1 ? GetPointIdx(1) : 0;
        if (this.m_nScaleType == 2) {
            GetPointIdx = GetPointIdx(2);
        }
        int i = GetPointIdx;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String charSequence = this.m_txSearchTime.getText().toString();
        try {
            this.m_lSearchTime = simpleDateFormat.parse(charSequence).getTime();
            System.out.println(charSequence);
            ReadStreamDataFromHisData readStreamDataFromHisData = new ReadStreamDataFromHisData();
            readStreamDataFromHisData.GetStreamData(this.m_lSearchTime, this.m_nScaleType, Constants.AlarmPauseTime.PAUSE_5_MIN, i);
            if (readStreamDataFromHisData.m_StreamDataList.size() == 0) {
                System.out.println("没有要检索的数据");
                InitDrawLineGrid();
                this.m_HisDataGridChart.DrawBG();
                ShowMessage(R.string.toast_noData);
                this.m_listData.clear();
                this.m_listAdapter.notifyDataSetChanged();
                String format = simpleDateFormat.format(new Date(this.m_lSearchTime));
                System.out.println(format);
                this.m_txSearchTime.setText(format);
                return;
            }
            List<StreamDrawLineData> GetMaxMinYValue = GetMaxMinYValue(readStreamDataFromHisData.m_StreamDataList);
            if (GetMaxMinYValue != null) {
                DrawLine(GetMaxMinYValue);
                RefreshText(readStreamDataFromHisData.m_StreamDataList.get(0));
                RefreshList(readStreamDataFromHisData.m_StreamDataList);
                String format2 = simpleDateFormat.format(new Date(this.m_lSearchTime));
                System.out.println(format2);
                this.m_txSearchTime.setText(format2);
                return;
            }
            InitDrawLineGrid();
            this.m_HisDataGridChart.DrawBG();
            ShowMessage(R.string.toast_noData);
        } catch (ParseException e) {
            e.printStackTrace();
            ShowMessage(R.string.toast_DateFormatError);
        }
    }

    public void RefreshList(List<StreamData> list) {
        this.m_listData.clear();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        for (int i = 0; i < list.size(); i++) {
            String format = simpleDateFormat.format(new Date(list.get(i).datetime));
            HashMap<String, String> hashMap = new HashMap<>();
            hashMap.put("time", format);
            if (list.get(i).nHR != -1) {
                hashMap.put("HR", ((int) list.get(i).nHR) + "");
            } else {
                hashMap.put("HR", "---");
            }
            if (list.get(i).nPR != -1) {
                hashMap.put("PR", ((int) list.get(i).nPR) + "");
            } else {
                hashMap.put("PR", "---");
            }
            if (list.get(i).nSpO2 != -1) {
                hashMap.put("SpO2", ((int) list.get(i).nSpO2) + "");
            } else {
                hashMap.put("SpO2", "---");
            }
            if (list.get(i).nResp != -1) {
                hashMap.put("Resp", ((int) list.get(i).nResp) + "");
            } else {
                hashMap.put("Resp", "---");
            }
            if (list.get(i).nTemp != -1) {
                hashMap.put("Temp", (list.get(i).nTemp / 10.0f) + "");
            } else {
                hashMap.put("Temp", "---");
            }
            if (list.get(i).fST1 != -1) {
                hashMap.put("ST1", (list.get(i).fST1 / 100.0f) + "");
            } else {
                hashMap.put("ST1", "---");
            }
            if (list.get(i).fST2 != -1) {
                hashMap.put("ST2", (list.get(i).fST2 / 100.0f) + "");
            } else {
                hashMap.put("ST2", "---");
            }
            this.m_listData.add(hashMap);
        }
        this.m_listView.setAdapter((ListAdapter) this.m_listAdapter);
        this.m_listAdapter.notifyDataSetChanged();
    }

    public void RefreshText(StreamData streamData) {
        if (streamData.nHR != -1) {
            this.m_txHRValue.setText(((int) streamData.nHR) + "");
        } else {
            this.m_txHRValue.setText("---");
        }
        if (streamData.nPR != -1) {
            this.m_txPRValue.setText(((int) streamData.nPR) + "");
        } else {
            this.m_txPRValue.setText("---");
        }
        if (streamData.nSpO2 != -1) {
            this.m_txSpo2Value.setText(((int) streamData.nSpO2) + "%");
        } else {
            this.m_txSpo2Value.setText("---");
        }
        if (streamData.nResp != -1) {
            this.m_txRespValue.setText(((int) streamData.nResp) + "");
        } else {
            this.m_txRespValue.setText("---");
        }
        if (streamData.nTemp != -1) {
            this.m_txTempValue.setText((streamData.nTemp / 10.0f) + "℃");
        } else {
            this.m_txTempValue.setText("---");
        }
        if (streamData.fST1 != -1) {
            this.m_txST1Value.setText((streamData.fST1 / 100.0d) + "");
        } else {
            this.m_txST1Value.setText("---");
        }
        if (streamData.fST2 != -1) {
            this.m_txST2Value.setText((streamData.fST2 / 100.0d) + "");
        } else {
            this.m_txST2Value.setText("---");
        }
    }

    public List<StreamDrawLineData> GetMaxMinYValue(List<StreamData> list) {
        ArrayList arrayList = new ArrayList();
        int i = 0;
        switch (this.m_nParaType) {
            case 8:
                for (int i2 = 0; i2 < list.size(); i2++) {
                    StreamDrawLineData streamDrawLineData = new StreamDrawLineData();
                    streamDrawLineData.fValue = list.get(i2).nResp;
                    streamDrawLineData.datetime = list.get(i2).datetime;
                    arrayList.add(streamDrawLineData);
                }
                break;
            case 9:
                for (int i3 = 0; i3 < list.size(); i3++) {
                    StreamDrawLineData streamDrawLineData2 = new StreamDrawLineData();
                    streamDrawLineData2.fValue = list.get(i3).nSpO2;
                    streamDrawLineData2.datetime = list.get(i3).datetime;
                    arrayList.add(streamDrawLineData2);
                }
                break;
            case 10:
                for (int i4 = 0; i4 < list.size(); i4++) {
                    StreamDrawLineData streamDrawLineData3 = new StreamDrawLineData();
                    streamDrawLineData3.fValue = list.get(i4).nHR;
                    streamDrawLineData3.datetime = list.get(i4).datetime;
                    arrayList.add(streamDrawLineData3);
                }
                break;
            case 11:
                for (int i5 = 0; i5 < list.size(); i5++) {
                    StreamDrawLineData streamDrawLineData4 = new StreamDrawLineData();
                    streamDrawLineData4.fValue = list.get(i5).nPR;
                    streamDrawLineData4.datetime = list.get(i5).datetime;
                    arrayList.add(streamDrawLineData4);
                }
                break;
            case 12:
                for (int i6 = 0; i6 < list.size(); i6++) {
                    StreamDrawLineData streamDrawLineData5 = new StreamDrawLineData();
                    streamDrawLineData5.fValue = list.get(i6).nTemp / 10.0f;
                    streamDrawLineData5.datetime = list.get(i6).datetime;
                    arrayList.add(streamDrawLineData5);
                }
                break;
            case 13:
                for (int i7 = 0; i7 < list.size(); i7++) {
                    StreamDrawLineData streamDrawLineData6 = new StreamDrawLineData();
                    streamDrawLineData6.fValue = list.get(i7).fST1;
                    streamDrawLineData6.datetime = list.get(i7).datetime;
                    arrayList.add(streamDrawLineData6);
                }
                break;
            case 14:
                for (int i8 = 0; i8 < list.size(); i8++) {
                    StreamDrawLineData streamDrawLineData7 = new StreamDrawLineData();
                    streamDrawLineData7.fValue = list.get(i8).fST2;
                    streamDrawLineData7.datetime = list.get(i8).datetime;
                    arrayList.add(streamDrawLineData7);
                }
                break;
            default:
                return null;
        }
        this.m_nEndY = -1.0f;
        this.m_nStartY = -1.0f;
        while (true) {
            if (i < arrayList.size()) {
                if (((StreamDrawLineData) arrayList.get(i)).fValue != -1.0f) {
                    this.m_nStartY = ((StreamDrawLineData) arrayList.get(i)).fValue;
                    this.m_nEndY = ((StreamDrawLineData) arrayList.get(i)).fValue;
                } else {
                    i++;
                }
            }
        }
        for (int i9 = 1; i9 < arrayList.size(); i9++) {
            if (((StreamDrawLineData) arrayList.get(i9)).fValue != -1.0f) {
                if (this.m_nStartY > ((StreamDrawLineData) arrayList.get(i9)).fValue) {
                    this.m_nStartY = ((StreamDrawLineData) arrayList.get(i9)).fValue;
                }
                if (this.m_nEndY < ((StreamDrawLineData) arrayList.get(i9)).fValue) {
                    this.m_nEndY = ((StreamDrawLineData) arrayList.get(i9)).fValue;
                }
            }
        }
        float f = this.m_nEndY;
        float f2 = f + (0.1f * f);
        this.m_nEndY = f2;
        if (f2 != -1.0f) {
            float f3 = this.m_nStartY;
            if (f3 != -1.0f) {
                if (f3 == f2 && f2 == 0.0f) {
                    this.m_nEndY = f2 + 6.0f;
                }
                return arrayList;
            }
        }
        return null;
    }

    public void InitDrawLineGrid() {
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < 6; i++) {
            arrayList.add("");
        }
        ArrayList arrayList2 = new ArrayList();
        for (int i2 = 0; i2 < 10; i2++) {
            arrayList2.add("");
        }
        this.m_HisDataGridChart.setAxisYTitles(arrayList);
        this.m_HisDataGridChart.setAxisXTitles(arrayList2);
    }

    public void DrawLine(List<StreamDrawLineData> list) {
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < 6; i++) {
            StringBuilder sb = new StringBuilder();
            float f = this.m_nEndY;
            float f2 = this.m_nStartY;
            String sb2 = sb.append((((f - f2) / 5.0f) * i) + f2).append("").toString();
            int indexOf = sb2.indexOf(".");
            if (indexOf != -1) {
                sb2 = sb2.substring(0, indexOf + 2);
            }
            arrayList.add(sb2);
        }
        ArrayList arrayList2 = new ArrayList();
        arrayList2.add("");
        for (int i2 = 1; i2 < 10; i2++) {
            arrayList2.add(new SimpleDateFormat(DateUtils.TIME_FORMAT_SECOND).format(new Date(this.m_lSearchTime + (this.m_nJGTime * 30 * i2))));
        }
        this.m_HisDataGridChart.setAxisYTitles(arrayList);
        this.m_HisDataGridChart.setAxisXTitles(arrayList2);
        this.m_HisDataGridChart.SetXNum(Constants.AlarmPauseTime.PAUSE_5_MIN, r9 * Constants.AlarmPauseTime.PAUSE_5_MIN, this.m_lSearchTime, this.m_nJGTime);
        this.m_HisDataGridChart.SetDataType(0, this.m_nStartY, this.m_nEndY);
        this.m_HisDataGridChart.DrawHisDataLine(list);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        this.m_Handler.removeCallbacks(this.SearchDataRunnable);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.Btn_goback:
                finish();
                break;
            case R.id.Item5Min:
                this.ScaleTypeItem.setVisibility(4);
                this.bParaItemShow = false;
                this.m_nScaleType = 2;
                this.m_txScaleType.setText("5Min");
                this.m_nJGTime = 300000;
                this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
                break;
            case R.id.Item5S:
                this.ScaleTypeItem.setVisibility(4);
                this.bParaItemShow = false;
                this.m_nScaleType = 1;
                this.m_txScaleType.setText("5S");
                this.m_nJGTime = 5000;
                this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
                break;
            case R.id.ItemHR:
                this.ParaTypeItem1.setVisibility(4);
                this.m_txParaType.setText("HR(bpm)");
                this.m_nParaType = 10;
                this.bParaItemShow = false;
                this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
                break;
            case R.id.ItemPR:
                this.ParaTypeItem1.setVisibility(4);
                this.bParaItemShow = false;
                this.m_nParaType = 11;
                this.m_txParaType.setText("PR(bpm)");
                this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
                break;
            case R.id.ItemResp:
                this.ParaTypeItem1.setVisibility(4);
                this.bParaItemShow = false;
                this.m_nParaType = 8;
                this.m_txParaType.setText("Resp(brpm)");
                this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
                break;
            case R.id.ItemSPO2:
                this.ParaTypeItem1.setVisibility(4);
                this.bParaItemShow = false;
                this.m_nParaType = 9;
                this.m_txParaType.setText("SpO2(%)");
                this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
                break;
            case R.id.ItemST1:
                this.ParaTypeItem1.setVisibility(4);
                this.bParaItemShow = false;
                this.m_nParaType = 13;
                this.m_txParaType.setText("ST1(×100mV)");
                this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
                break;
            case R.id.ItemST2:
                this.ParaTypeItem1.setVisibility(4);
                this.bParaItemShow = false;
                this.m_nParaType = 14;
                this.m_txParaType.setText("ST2(×100mV))");
                this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
                break;
            case R.id.ItemTemp:
                this.ParaTypeItem1.setVisibility(4);
                this.bParaItemShow = false;
                this.m_nParaType = 12;
                this.m_txParaType.setText("Temp(℃)");
                this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
                break;
            case R.id.ParaType:
                if (this.bScaleItemShow) {
                    this.ScaleTypeItem.setVisibility(4);
                    this.bScaleItemShow = false;
                }
                this.bParaItemShow = true;
                this.ParaTypeItem1.setVisibility(0);
                break;
            case R.id.ScaleType:
                if (this.bParaItemShow) {
                    this.ParaTypeItem1.setVisibility(4);
                    this.bParaItemShow = false;
                }
                this.bScaleItemShow = true;
                this.ScaleTypeItem.setVisibility(0);
                break;
            case R.id.SearchTime:
                Intent intent = new Intent(this, (Class<?>) DateTimeSelector.class);
                intent.putExtra("nowtime", this.m_lSearchTime);
                startActivityForResult(intent, 3);
                setVisible(false);
                overridePendingTransition(R.anim.zoomin, 0);
                break;
        }
    }

    @Override
    protected void onActivityResult(int i, int i2, Intent intent) {
        if (i != 3) {
            return;
        }
        if (intent == null) {
            setVisible(true);
            return;
        }
        long j = intent.getExtras().getLong("TimeReturn");
        if (j != 0) {
            String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(j));
            System.out.println(format);
            this.m_txSearchTime.setText(format);
            this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
        }
        setVisible(true);
    }

    @Override
    public boolean onTouchEvent(MotionEvent motionEvent) {
        return this.mGestureDetector.onTouchEvent(motionEvent);
    }

    @Override
    public boolean onTouch(View view, MotionEvent motionEvent) {
        return this.mGestureDetector.onTouchEvent(motionEvent);
    }

    @Override
    public boolean onFling(MotionEvent motionEvent, MotionEvent motionEvent2, float f, float f2) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if (motionEvent.getX() - motionEvent2.getX() <= this.verticalMinDistance || Math.abs(f) <= this.minVelocity || Math.abs(motionEvent.getY() - motionEvent2.getY()) >= 100.0f) {
            if (motionEvent2.getX() - motionEvent.getX() <= this.verticalMinDistance || Math.abs(f) <= this.minVelocity || Math.abs(motionEvent.getY() - motionEvent2.getY()) >= 100.0f) {
                return false;
            }
            this.m_lSearchTime -= this.m_nJGTime * Constants.AlarmPauseTime.PAUSE_5_MIN;
            this.m_txSearchTime.setText(simpleDateFormat.format(new Date(this.m_lSearchTime)));
            this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
            return false;
        }
        this.m_lSearchTime += this.m_nJGTime * Constants.AlarmPauseTime.PAUSE_5_MIN;
        long currentTimeMillis = System.currentTimeMillis();
        long j = this.m_lSearchTime;
        long j2 = currentTimeMillis - j;
        int i = this.m_nJGTime;
        if (j2 >= i * Constants.AlarmPauseTime.PAUSE_5_MIN) {
            this.m_lSearchTime = j + (i * Constants.AlarmPauseTime.PAUSE_5_MIN);
            this.m_txSearchTime.setText(simpleDateFormat.format(new Date(this.m_lSearchTime)));
            this.m_Handler.postDelayed(this.SearchDataRunnable, 10L);
            return false;
        }
        this.m_lSearchTime = j - (i * Constants.AlarmPauseTime.PAUSE_5_MIN);
        ShowMessage(R.string.toast_noData);
        return false;
    }
}