package type;
import java.util.List;

public class SensorData {
    public enum DataType {
        EEG, ECG_2LEAD, PPG, ECG_12LEAD, MIT_BIH, STETHOSCOPE, SNORE, RESPIRATION, PW_ECG_SL
    }

    public DataType dataType;
    public int packetSn;
    public byte[] leadStatus = new byte[2];
    public long timestamp;
    public List<List<Float>> channelData;
    public AdditionalData additionalData;
    public byte[] rawData;

    // 构造函数
    public SensorData() {
        this.additionalData = new AdditionalData();
    }

    // Getter和Setter方法
    public DataType getDataType() { return dataType; }
    public void setDataType(DataType dataType) { this.dataType = dataType; }
    
    public int getPacketSn() { return packetSn; }
    public void setPacketSn(int packetSn) { this.packetSn = packetSn; }
    
    public byte[] getLeadStatus() { return leadStatus; }
    public void setLeadStatus(byte[] leadStatus) { this.leadStatus = leadStatus; }
    
    public long getTimestamp() { return timestamp; }
    public void setTimestamp(long timestamp) { this.timestamp = timestamp; }
    
    public List<List<Float>> getChannelData() { return channelData; }
    public void setChannelData(List<List<Float>> channelData) { this.channelData = channelData; }
    
    public AdditionalData getAdditionalData() { return additionalData; }
    public void setAdditionalData(AdditionalData additionalData) { this.additionalData = additionalData; }
    
    public byte[] getRawData() { return rawData; }
    public void setRawData(byte[] rawData) { this.rawData = rawData; }

    public static class AdditionalData {
        public int hr;
        public int spo2;
        public float temperature;
        public int gpioState;
        public int movement;
        public int posture;
        public int ambientLight;
        
        // 构造函数
        public AdditionalData() {}
        
        // Getter和Setter方法
        public int getHr() { return hr; }
        public void setHr(int hr) { this.hr = hr; }
        
        public int getSpo2() { return spo2; }
        public void setSpo2(int spo2) { this.spo2 = spo2; }
        
        public float getTemperature() { return temperature; }
        public void setTemperature(float temperature) { this.temperature = temperature; }
        
        public int getGpioState() { return gpioState; }
        public void setGpioState(int gpioState) { this.gpioState = gpioState; }
        
        public int getMovement() { return movement; }
        public void setMovement(int movement) { this.movement = movement; }
        
        public int getPosture() { return posture; }
        public void setPosture(int posture) { this.posture = posture; }
        
        public int getAmbientLight() { return ambientLight; }
        public void setAmbientLight(int ambientLight) { this.ambientLight = ambientLight; }
    }
}
