Changeset 15624
- Timestamp:
- 05/09/12 20:51:01 (11 years ago)
- Files:
-
- 15 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ipk/source.sh4/titanswaptools_lcdpearl1/CONTROL/control
r15385 r15624 1 1 Package: titan-plugin-swaptools-pearllcd 2 Version: 3.03 Description: Treiber fuer Pearl LCD V 3.02 Version: 4.0 3 Description: Treiber fuer Pearl LCD V4.0 4 4 Section: tools 5 5 Priority: optional -
titan/plugins/lcdpearl1/lcdpearl1.c
r15385 r15624 3 3 #include "../../titan/header.h" 4 4 5 #include "lcd_weather.h" 6 5 7 char pluginname[] = "LCD Pearl"; 6 8 char plugindesc[] = "Extensions"; … … 12 14 13 15 struct stimerthread* LCD_Pearl1thread = NULL; 16 14 17 int firststart = 0; 18 19 void weather_getline(FILE* fd, char* fileline) 20 { 21 fgets(fileline, 256, fd); 22 if(fileline[0] == '#' || fileline[0] == '\n') 23 return; 24 if(fileline[strlen(fileline) - 1] == '\n') 25 fileline[strlen(fileline) - 1] = '\0'; 26 if(fileline[strlen(fileline) - 1] == '\r') 27 fileline[strlen(fileline) - 1] = '\0'; 28 } 15 29 16 30 void LCD_start_lcd4linux() … … 38 52 { 39 53 54 struct skin* LCD_Pearl1 = NULL; 55 struct skin* day0_t = NULL; 56 struct skin* day0_i = NULL; 57 struct skin* day1_t = NULL; 58 struct skin* day1_i = NULL; 59 struct skin* day2_t = NULL; 60 struct skin* day2_i = NULL; 61 struct skin* day3_t = NULL; 62 struct skin* day3_i = NULL; 63 struct skin* akttime = NULL; 64 65 40 66 char* tmpstr = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL, *timemerk = NULL, *sendermerk = NULL, *recmerk = NULL; 41 42 struct skin* LCD_Pearl1 = getscreen("LCD_Pearl1"); 43 struct skin* akttime = getscreennode(LCD_Pearl1, "akttime"); 67 FILE *fd = NULL; 68 char *fileline = NULL; 69 int weatherwrite = 0; 70 71 if(ostrcmp(getconfig("lcd_pearl1_plugin_wetter", NULL), "yes") == 0) 72 { 73 LCD_Pearl1 = getscreen("LCD_Pearl1_Wetter"); 74 day0_t = getscreennode(LCD_Pearl1, "day0_t"); 75 day0_i = getscreennode(LCD_Pearl1, "day0_i"); 76 day1_t = getscreennode(LCD_Pearl1, "day1_t"); 77 day1_i = getscreennode(LCD_Pearl1, "day1_i"); 78 day2_t = getscreennode(LCD_Pearl1, "day2_t"); 79 day2_i = getscreennode(LCD_Pearl1, "day2_i"); 80 day3_t = getscreennode(LCD_Pearl1, "day3_t"); 81 day3_i = getscreennode(LCD_Pearl1, "day3_i"); 82 if(file_exist("/tmp/lcdweather") == 1) 83 system("rm /tmp/lcdweather"); 84 } 85 else 86 LCD_Pearl1 = getscreen("LCD_Pearl1"); 87 akttime = getscreennode(LCD_Pearl1, "akttime"); 44 88 45 89 struct skin* LCD_Play = getscreen("LCD_Play"); … … 51 95 struct skin* sreverse = getscreennode(LCD_Play, "reverse"); 52 96 53 struct skin* LCD_MC_Menu = getscreen("LCD_MC_Menu");54 struct skin* akttimemc1 = getscreennode(LCD_MC_Menu, "akttime");97 //struct skin* LCD_MC_Menu = getscreen("LCD_MC_Menu"); 98 //struct skin* akttimemc1 = getscreennode(LCD_MC_Menu, "akttime"); 55 99 56 100 int put = 0, typemerk = 0, type = 0; … … 163 207 if(type == 1) 164 208 { 209 // Wettervorhersage 210 if(ostrcmp(getconfig("lcd_pearl1_plugin_wetter", NULL), "yes") == 0) 211 { 212 if(weatherwrite == 0) 213 { 214 if(weatherthread == NULL) 215 { 216 if(file_exist("/tmp/lcdweather") == 0) 217 weatherthread = addtimer(&lcd_writeweather, START, 10000, 1, NULL, NULL, NULL); 218 else 219 { 220 fileline = malloc(256); 221 if(fileline != NULL) 222 { 223 fd = fopen("/tmp/lcdweather", "r"); 224 if(fd != NULL) 225 { 226 weather_getline(fd, fileline);weather_getline(fd, fileline);weather_getline(fd, fileline); 227 weather_getline(fd, fileline); 228 changetext(day0_t, fileline); 229 weather_getline(fd, fileline); 230 weather_getline(fd, fileline); 231 changepic(day0_i, fileline); 232 233 weather_getline(fd, fileline);weather_getline(fd, fileline); 234 weather_getline(fd, fileline); 235 changetext(day1_t, fileline); 236 weather_getline(fd, fileline); 237 weather_getline(fd, fileline); 238 changepic(day1_i, fileline); 239 240 weather_getline(fd, fileline);weather_getline(fd, fileline); 241 weather_getline(fd, fileline); 242 changetext(day2_t, fileline); 243 weather_getline(fd, fileline); 244 weather_getline(fd, fileline); 245 changepic(day2_i, fileline); 246 247 weather_getline(fd, fileline);weather_getline(fd, fileline); 248 weather_getline(fd, fileline); 249 changetext(day3_t, fileline); 250 weather_getline(fd, fileline); 251 weather_getline(fd, fileline); 252 changepic(day3_i, fileline); 253 fclose(fd); 254 } 255 free(fileline); fileline=NULL; 256 } 257 weatherwrite = 1; 258 } 259 } 260 } 261 } 262 165 263 changetext(akttime, tmpstr); 166 264 drawscreen(LCD_Pearl1, 0); … … 306 404 struct skin* listbox = getscreennode(pearl1_main, "listbox"); 307 405 struct skin* allmenu = getscreennode(pearl1_main, "allmenu"); 406 struct skin* wettervor = getscreennode(pearl1_main, "wettervor"); 308 407 struct skin* b3 = getscreennode(pearl1_main, "b3"); 309 408 struct skin* tmp = NULL; … … 316 415 addchoicebox(allmenu, "yes", _("ja")); 317 416 setchoiceboxselection(allmenu, getconfig("write_fb_to_png", NULL)); 417 418 addchoicebox(wettervor, "no", _("nein")); 419 addchoicebox(wettervor, "yes", _("ja")); 420 setchoiceboxselection(wettervor, getconfig("lcd_pearl1_plugin_wetter", NULL)); 318 421 319 422 if(LCD_Pearl1thread != NULL) … … 337 440 { 338 441 addconfig("write_fb_to_png", allmenu->ret); 442 addconfig("lcd_pearl1_plugin_wetter", wettervor->ret); 443 addconfig("lcd_pearl1_plugin_wetter_ort", "Berlin"); 339 444 restart = 1; 340 445 break; … … 376 481 } 377 482 } 378 return; 379 } 380 483 } -
titan/skins/lcdpearl1/skin.xml
r15385 r15624 2 2 <node bordercol=bordercol scrollbar=auto type=listbox posy=center posx=center name=listbox width=85% height=70%> 3 3 <node name=allmenu type=choicebox parent=listbox valign=middle posx=0 text="alle Menus anzeigen" bordercol=bordercol bordersize=2 width=100% height=25> 4 <node name=wettervor type=choicebox parent=listbox valign=middle posx=0 text="Wettervorhersage" bordercol=bordercol bordersize=2 width=100% height=25> 4 5 <node name=b1 text=SAVE halign=center valign=middle bordercol=green bordersize=2 bordertype=2 posx=0 posy=0 width=150 height=30/> 5 6 <node name=b2 text=EXIT halign=center valign=middle bordercol=exitcol bordersize=2 bordertype=2 posx=160 posy=0 width=150 height=30/> … … 13 14 <node halign=center bordersize=2 progresscol=bordercol bgcol=white halign=left func=getepgakttimeline bordercol=bordercol borderradius=5 name=epgline posy=145 posx=center width=290 height=20/> 14 15 <node halign=center text="" name=akttime fontsize=50 posx=center posy=170 width=320 height=50/> 16 <node halign=center valign=left func=getrec param1=skin name=rec posx=0 posy=220 width=100 height=20/> 17 </screen> 18 19 <screen halign=center fontcol=fontcol fontsize=30 name=LCD_Pearl1_Wetter posx=0 posy=0 width=320 height=240 bgcol=bgcol> 20 <node fontsize=50 halign=center text="" func=getaktchannelname name=channelname posx=5 posy=3 width=310 height=50 fontcol=fontcol/> 21 <node halign=center func=getepgakttitle bordersize=0 bordercol=bordercol fontsize=20 posx=10 posy=60 width=300 height=20 fontcol=fontcol/> 22 <node halign=center bordersize=2 progresscol=bordercol bgcol=white halign=left func=getepgakttimeline bordercol=bordercol borderradius=5 name=epgline posy=85 posx=center width=290 height=15/> 23 <node halign=center text="" name=akttime fontsize=50 posx=center posy=100 width=320 height=50/> 24 <node halign=center text="0 C" name=day0_t fontsize=20 posx=10 posy=160 width=60 height=20/> 25 <node halign=center text="0 C" name=day1_t fontsize=20 posx=100 posy=160 width=60 height=20/> 26 <node halign=center text="0 C" name=day2_t fontsize=20 posx=175 posy=160 width=60 height=20/> 27 <node halign=center text="0 C" name=day3_t fontsize=20 posx=250 posy=160 width=60 height=20/> 28 <node pic=%pluginpath%/lcdpearl1/skin/sunny60.png halign=center name=day0_i posx=10 posy=180 width=60 height=60/> 29 <node pic=%pluginpath%/lcdpearl1/skin/sunny60.png halign=center name=day1_i posx=100 posy=180 width=60 height=60/> 30 <node pic=%pluginpath%/lcdpearl1/skin/sunny60.png halign=center name=day2_i posx=175 posy=180 width=60 height=60/> 31 <node pic=%pluginpath%/lcdpearl1/skin/sunny60.png halign=center name=day3_i posx=250 posy=180 width=60 height=60/> 15 32 <node halign=center valign=left func=getrec param1=skin name=rec posx=0 posy=220 width=100 height=20/> 16 33 </screen>
Note: See TracChangeset
for help on using the changeset viewer.