示例#1
0
        public void InitPres()
        {
            Debuger.PrintLn("_pres of {0} {1} is null its reininitalasing", uid, name);
            _pres = new Pres();

            Page p1 = new Page(5);

            p1.elements.Add(PageElement.NewText("Screen uid:", 0, 0, 1, FontType.fontnormal8px));
            p1.elements.Add(PageElement.NewText(uid.ToString(), 0, 8, 1, FontType.fontnormal8px));
            _pres.pages.Add(p1);

            Page p2 = new Page(5);

            p2.elements.Add(PageElement.NewText("Time Now:", 0, 0, 1, FontType.fontnormal8px));
            p2.elements.Add(PageElement.NewTime(0, 8, 1, FontType.fontnormal8px));
            p2.elements.Add(PageElement.NewDate(32, 8, 1, FontType.fontnormal8px));
            _pres.pages.Add(p2);

            Page p3 = new Page(5);

            p3.elements.Add(PageElement.NewText("Mikołów pm2,5:", 0, 0, 1, FontType.fontnormal8px));
            p3.elements.Add(PageElement.NewSensorPm2_5(444, 0, 8, 1, FontType.fontnormal8px));
            _pres.pages.Add(p3);

            Page p4 = new Page(5);

            p4.elements.Add(PageElement.NewText("Mikołów pm10:", 0, 0, 1, FontType.fontnormal8px));
            p4.elements.Add(PageElement.NewSensorPm10(444, 0, 8, 1, FontType.fontnormal8px));
            _pres.pages.Add(p4);
        }
示例#2
0
        public static PageElement NewText(string text, int x, int y, uint color, FontType font, string uid)
        {
            PageElement pe = NewText(text, x, y, color, font);

            pe.set_uid_for_preview(uid);
            return(pe);
        }
示例#3
0
        public static PageElement NewUid(int x, int y, uint color, FontType font)
        {
            PageElement temp = new PageElement("", x, y, color, font);

            temp.type = ElementType.UID;
            return(temp);
        }
示例#4
0
        public static PageElement NewSensorPressure(int idx, int x, int y, uint color, FontType font)
        {
            PageElement temp = new PageElement("", x, y, color, font);

            temp.type = ElementType.SENSOR_PRESSURE;
            temp.idx  = idx;
            return(temp);
        }
示例#5
0
        public void AddNameTemplateClicked()
        {
            chooseTeamplate = false;
            Page p = new Page(10);

            p.elements.Add(PageElement.NewText(scr.name, 0, 0, 1, FontType.fontnormal8px));
            p.elements.Add(PageElement.NewUid(0, 8, 1, FontType.fontfat8px));
            Pres.pages.Add(p);
        }
示例#6
0
        public void AddElement(Page p)
        {
            PageElement pe = new PageElement("Tekst", 0, 0, 1, FontType.fontnormal8px);

            if (Pres.UnifiedIdx > 0)
            {
                pe.idx = Pres.UnifiedIdx;
            }
            p.elements.Add(pe);
        }
示例#7
0
        public void AddDateTimeTemplateClicked()
        {
            chooseTeamplate = false;
            Page p = new Page(10);

            p.elements.Add(PageElement.NewText("Godzina Data", 0, 0, 1, FontType.fontfat8px));
            p.elements.Add(PageElement.NewTime(0, 8, 1, FontType.fontfat8px));
            p.elements.Add(PageElement.NewDate(40, 8, 1, FontType.fontfat8px));
            Pres.pages.Add(p);
        }
示例#8
0
        public void AddAirQualityTemplateClicked()
        {
            chooseTeamplate = false;
            Page p = new Page(10);

            p.elements.Add(PageElement.NewText("Jakość powietrza", 0, 0, 1, FontType.fontfat8px));
            PageElement pe = PageElement.NewSensorPm10(Pres.UnifiedIdx, 0, 8, 1, FontType.fontfat8px);

            pe.type = ElementType.SENSOR_PM10_STATUS;
            p.elements.Add(pe);
            Pres.pages.Add(p);
        }
示例#9
0
        public static PageElement NewText(string text, int x, int y, uint color, FontType font)
        {
            PageElement temp = new PageElement();

            temp.type  = ElementType.TEXT;
            temp.x     = x;
            temp.y     = y;
            temp.color = color;
            temp.text  = text;
            temp.font  = font;
            return(temp);
        }
示例#10
0
        public void AddPreassureTempTemplateClicked()
        {
            chooseTeamplate = false;
            Page p = new Page(10);

            p.elements.Add(PageElement.NewText("Ciśnie.", 0, 0, 1, FontType.fontfat8px));
            p.elements.Add(PageElement.NewSensorPressure(Pres.UnifiedIdx, 35, 0, 1, FontType.fontfat8px));
            p.elements.Add(PageElement.NewText("Temp.", 0, 8, 1, FontType.fontfat8px));
            PageElement pe = PageElement.NewSensorTemperature(Pres.UnifiedIdx, 35, 8, 1, FontType.fontfat8px);

            p.elements.Add(pe);
            Pres.pages.Add(p);
        }
示例#11
0
        public void AddPM2_5TemplateClicked()
        {
            chooseTeamplate = false;
            Page p = new Page(10);

            p.elements.Add(PageElement.NewText("Pm2.5", 0, 0, 1, FontType.fontfat8px));
            p.elements.Add(PageElement.NewSensorPm2_5(Pres.UnifiedIdx, 35, 0, 1, FontType.fontfat8px));
            p.elements.Add(PageElement.NewText("Pm2.5", 0, 8, 1, FontType.fontfat8px));
            PageElement pe = PageElement.NewSensorPm2_5(Pres.UnifiedIdx, 35, 8, 1, FontType.fontfat8px);

            pe.type = ElementType.SENSOR_PM2_5_PERCENT;
            p.elements.Add(pe);
            Pres.pages.Add(p);
        }
示例#12
0
 public void DeleteElement(Page p, PageElement pe)
 {
     p.elements.Remove(pe);
 }