source: titan/plugins/sispmctl/sispmctl.c @ 43368

Last change on this file since 43368 was 41765, checked in by gost, 6 years ago

fix

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#include "../../titan/struct.h"
2#include "../../titan/debug.h"
3#include "../../titan/header.h"
4
5#include "sispmctl.h"
6
7
8char pluginname[] = "GEMBIRD Powermanager";
9char plugindesc[] = "schalten der Steckdosenleiste von GEMBRIT";
10char pluginpic[] = "%pluginpath%/sispmctl/sispmctl.png";
11
12int pluginaktiv = 0;
13//int pluginversion = PLUGINVERSION;
14int pluginversion = 999999;
15
16//wird beim laden ausgefuehrt
17void 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
47void 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
61void start(void)
62{
63        sispmctl_main();
64}
Note: See TracBrowser for help on using the repository browser.