1 | #include "../../titan/struct.h" |
---|
2 | #include "../../titan/debug.h" |
---|
3 | #include "../../titan/header.h" |
---|
4 | |
---|
5 | #include "sispmctl.h" |
---|
6 | |
---|
7 | |
---|
8 | char pluginname[] = "GEMBIRD Powermanager"; |
---|
9 | char plugindesc[] = "schalten der Steckdosenleiste von GEMBRIT"; |
---|
10 | char pluginpic[] = "%pluginpath%/sispmctl/sispmctl.png"; |
---|
11 | |
---|
12 | int pluginaktiv = 0; |
---|
13 | //int pluginversion = PLUGINVERSION; |
---|
14 | int pluginversion = 999999; |
---|
15 | |
---|
16 | //wird beim laden ausgefuehrt |
---|
17 | void init(void) |
---|
18 | { |
---|
19 | char* tmpstr = NULL; |
---|
20 | pluginaktiv = 1; |
---|
21 | |
---|
22 | tmpstr = createpluginpath("/sispmctl/skin.xml", 0); |
---|
23 | readscreen(tmpstr, 281, 1); |
---|
24 | |
---|
25 | |
---|
26 | sispmctlconf = createpluginpath("/sispmctl/sispmctl.conf", 0); |
---|
27 | readconfig(sispmctlconf, myconfig); |
---|
28 | |
---|
29 | debug(10, "sispmctl Plugin loaded !!!"); |
---|
30 | |
---|
31 | startextern = 0; |
---|
32 | if( ! file_exist("/mnt/plugin/ps01sispm")) |
---|
33 | sispmctl_start(2); |
---|
34 | else |
---|
35 | startextern = 1; |
---|
36 | |
---|
37 | if(file_exist("/mnt/plugin/pe01sispm")) |
---|
38 | stopextern = 1; |
---|
39 | else |
---|
40 | stopextern = 0; |
---|
41 | |
---|
42 | if(sispmctl_checkthread == NULL) |
---|
43 | sispmctl_checkthread = addtimer(&sispmctl_check_thread, START, 10000, 1, NULL, NULL, NULL); |
---|
44 | } |
---|
45 | |
---|
46 | //wird beim entladen ausgefuehrt |
---|
47 | void deinit(void) |
---|
48 | { |
---|
49 | if(sispmctl_checkthread != NULL) |
---|
50 | sispmctl_checkthread->aktion = STOP; |
---|
51 | if( ! file_exist("/mnt/plugin/pe01sispm")) |
---|
52 | sispmctl_stop(2); |
---|
53 | if(sispmctl_checkthread != NULL) |
---|
54 | sleep(2); |
---|
55 | pluginaktiv = 0; |
---|
56 | debug(10, "sispmctl removed !!!"); |
---|
57 | delmarkedscreen(281); |
---|
58 | } |
---|
59 | |
---|
60 | //wird in der Pluginverwaltung bzw Menue ausfeguehrt |
---|
61 | void start(void) |
---|
62 | { |
---|
63 | sispmctl_main(); |
---|
64 | } |
---|