package d.f.a.r2;

import com.seewo.sdk.util.RLog;
import java.util.List;
import jxl.format.Alignment;
import jxl.format.Border;
import jxl.format.BorderLineStyle;
import jxl.format.Colour;
import jxl.format.UnderlineStyle;
import jxl.format.VerticalAlignment;
import jxl.write.Label;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WriteException;

/* JADX INFO: compiled from: JxlUtil.java */
/* JADX INFO: loaded from: classes.dex */
public class w2 {
    public final void a(WritableSheet writableSheet, WritableCellFormat writableCellFormat) {
        try {
            Label label = new Label(0, 0, "当前时间", writableCellFormat);
            Label label2 = new Label(1, 0, "当前温度", writableCellFormat);
            Label label3 = new Label(2, 0, "温度状态", writableCellFormat);
            Label label4 = new Label(3, 0, "老化时间", writableCellFormat);
            writableSheet.addCell(label);
            writableSheet.addCell(label2);
            writableSheet.addCell(label3);
            writableSheet.addCell(label4);
        } catch (WriteException e2) {
            RLog.e("JxlUtil", e2);
        }
    }

    public final void b(List<d.f.a.q1.n.a> list, WritableSheet writableSheet, WritableCellFormat writableCellFormat) throws WriteException {
        int i2 = 0;
        while (i2 < list.size()) {
            int i3 = i2 + 1;
            Label label = new Label(0, i3, d.f.a.q1.n.a.a.format(Long.valueOf(list.get(i2).f3097b)), writableCellFormat);
            Label label2 = new Label(1, i3, list.get(i2).f3098c, writableCellFormat);
            Label label3 = new Label(2, i3, list.get(i2).f3100e, writableCellFormat);
            Label label4 = new Label(3, i3, list.get(i2).f3099d, writableCellFormat);
            writableSheet.addCell(label);
            writableSheet.addCell(label2);
            writableSheet.addCell(label3);
            writableSheet.addCell(label4);
            i2 = i3;
        }
    }

    public final WritableCellFormat c(WritableSheet writableSheet) {
        try {
            WritableFont.FontName fontName = WritableFont.ARIAL;
            WritableFont.BoldStyle boldStyle = WritableFont.NO_BOLD;
            UnderlineStyle underlineStyle = UnderlineStyle.NO_UNDERLINE;
            Colour colour = Colour.BLACK;
            WritableCellFormat writableCellFormat = new WritableCellFormat(new WritableFont(fontName, 12, boldStyle, false, underlineStyle, colour));
            writableCellFormat.setBackground(Colour.WHITE);
            writableCellFormat.setAlignment(Alignment.LEFT);
            writableCellFormat.setVerticalAlignment(VerticalAlignment.CENTRE);
            writableCellFormat.setBorder(Border.ALL, BorderLineStyle.THIN, colour);
            writableCellFormat.setWrap(true);
            writableSheet.setColumnView(0, 38);
            writableSheet.setColumnView(1, 17);
            writableSheet.setColumnView(2, 17);
            return writableCellFormat;
        } catch (WriteException e2) {
            RLog.e("JxlUtil", e2);
            return null;
        }
    }
}
