package com.njcn.multithread;

import com.njcn.pojo.advanced.PublicData;
import com.njcn.pojo.commons.PubWaveModel.tagWave;
import com.njcn.pojo.commons.WaveData;
import com.njcn.serviceimpl.advanced.ReadWaveCompareDataImpl;
import com.njcn.serviceimpl.commons.WaveServiceImpl;

import java.util.LinkedList;
import java.util.List;

public class GetDrawDataThread extends Thread {
    private ReadWaveCompareDataImpl readWaveCompareData;
    private String fileName;
    private String picIndex; //add by sw 多事件波形对比增加高级算法结果展示
    private PublicData publicData;
    private WaveServiceImpl waveServiceImpl;

    public GetDrawDataThread(WaveServiceImpl waveServiceImpl, ReadWaveCompareDataImpl readWaveCompareData, String fileName, PublicData publicData, String picIndex) {
        super();
        this.waveServiceImpl = waveServiceImpl;
        this.readWaveCompareData = readWaveCompareData;
        this.fileName = fileName;
        this.publicData = publicData;
        this.picIndex = picIndex;
    }

    @Override
    public void run() {
        WaveData waveData = new WaveData();

        try {
            waveData = readWaveCompareData.getWaveData(waveServiceImpl);
        } catch (Exception e) {

        } finally {
            publicData.addData(waveData, fileName, picIndex, readWaveCompareData.getStringPt());
        }
    }
}
