package com.kfb.kfbv1.dummy;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Helper class for providing sample content for user interfaces created by
 * Android template wizards.
 * <p>
 * TODO: Replace all uses of this class before publishing your app.
 */
public class DummyContent {

    /**
     * An array of sample (dummy) items.
     */
    public static final List<DummyItem> ITEMS = new ArrayList<DummyItem>();

    /**
     * A map of sample (dummy) items, by ID.
     */
    public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();

    private static final int COUNT = 4;

    static {
        // Add some sample items.
        for (int i = 1; i <= COUNT; i++) {
            addItem(createDummyItem(i));
        }
    }

    private static void addItem(DummyItem item) {
        ITEMS.add(item);
        ITEM_MAP.put(item.id, item);
    }

    private static DummyItem createDummyItem(int position) {
        return new DummyItem(String.valueOf(position), "Test1","ON","ERROR","Empty","1","1","1","23.3");
    }

    private static String makeDetails(int position) {
        StringBuilder builder = new StringBuilder();
        builder.append("Details about Item: ").append(position);
        for (int i = 0; i < position; i++) {
            builder.append("\nMore details information here.");
        }
        return builder.toString();
    }

    /**
     * A dummy item representing a piece of content.
     */
    public static class DummyItem {
        public final String id;
        public final String Nazwa;
        public final String Status;
        public String Error;
        public String State;
        public final String s1;
        public final String s2;
        public final String s3;
        public String Temperatura;

        public DummyItem(String id, String aNazwa,String aStatus,String aError,String aState,String aS1,String aS2,String aS3,String aTemperatura) {
            this.id = id;
            this.Nazwa = aNazwa;
            this.State = aState;
            this.Status = aStatus;
            this.Error  = aError;
            this.s1  =aS1;
            this.s2= aS2;
            this.s3 = aS3;
            this.Temperatura = aTemperatura;
        }

        @Override
        public String toString() {
            return Nazwa;
        }
    }
}

