package com.tsi.comm.server.dto;

import com.tsi.comm.server.protocol.enums.eLightsStatus;
import com.tsi.comm.server.protocol.enums.eLightsType;
import com.tsi.comm.server.protocol.enums.eTimeReliability;
import com.tsi.common.utils.StringUtils;
import lombok.Data;
import lombok.ToString;

@Data
@ToString
public class TsiCvimStatus {
    protected eLightsType lightsType;
    protected eTimeReliability timeReliability;
    protected boolean readyPedestrianSignal;
    protected boolean unProtectedSignal;
    protected eLightsStatus lightsStatus;
    protected int totalSeconds;
    protected int remainingSeconds;
    protected int directionCode;

    public void copy(TsiCvimStatus statusTmp) {
        statusTmp.lightsType = this.lightsType;
        statusTmp.timeReliability = this.timeReliability;
        statusTmp.readyPedestrianSignal = this.readyPedestrianSignal;
        statusTmp.unProtectedSignal = this.unProtectedSignal;
        statusTmp.lightsStatus = this.lightsStatus;
        statusTmp.totalSeconds = this.totalSeconds;
        statusTmp.remainingSeconds = this.remainingSeconds;
        statusTmp.directionCode = this.directionCode;
    }


    public String toDataString() {
        return    this.lightsType.getValue()
                + this.timeReliability.getValue()
                + StringUtils.getString(this.readyPedestrianSignal)
                + StringUtils.getString(this.unProtectedSignal)
                + this.lightsStatus.getValue()
                + ","
                + this.totalSeconds
                + ","
                + this.remainingSeconds
                + ","
                + this.directionCode;
    }
}
