Moved files and removed 'Telldus'-prefix from the settings class
This commit is contained in:
parent
19b032a6f6
commit
0bda5edb57
6 changed files with 24 additions and 12 deletions
|
@ -1,10 +1,15 @@
|
||||||
|
FIND_PACKAGE( Qt4 REQUIRED )
|
||||||
|
SET( QT_DONT_USE_QTGUI TRUE )
|
||||||
|
INCLUDE( ${QT_USE_FILE} )
|
||||||
|
|
||||||
SET( telldus-core_SRCS
|
SET( telldus-core_SRCS
|
||||||
|
Controller.cpp
|
||||||
Device.cpp
|
Device.cpp
|
||||||
DeviceIkea.cpp
|
DeviceIkea.cpp
|
||||||
DeviceNexa.cpp
|
DeviceNexa.cpp
|
||||||
DeviceSartano.cpp
|
DeviceSartano.cpp
|
||||||
DeviceWaveman.cpp
|
DeviceWaveman.cpp
|
||||||
settings/TelldusSettings.cpp
|
Settings.cpp
|
||||||
telldus-core.cpp
|
telldus-core.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -13,21 +18,21 @@ SET( telldus-core_HDRS
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (APPLE)
|
IF (APPLE)
|
||||||
SET( telldus-core_TARGET TelldusCore )
|
SET( telldus-core_TARGET TelldusCore )
|
||||||
SET( telldus-core_SRCS
|
SET( telldus-core_SRCS
|
||||||
${telldus-core_SRCS}
|
${telldus-core_SRCS}
|
||||||
win/Device.cpp
|
win/Device.cpp
|
||||||
settings/TelldusSettingsCoreFoundationPreferences.cpp
|
SettingsCoreFoundationPreferences.cpp
|
||||||
)
|
)
|
||||||
ADD_DEFINITIONS(
|
ADD_DEFINITIONS(
|
||||||
-D_MACOSX
|
-D_MACOSX
|
||||||
)
|
)
|
||||||
ELSE (APPLE)
|
ELSE (APPLE)
|
||||||
SET( telldus-core_TARGET telldus-core )
|
SET( telldus-core_TARGET telldus-core )
|
||||||
SET( telldus-core_SRCS
|
SET( telldus-core_SRCS
|
||||||
${telldus-core_SRCS}
|
${telldus-core_SRCS}
|
||||||
linux/Device.cpp
|
linux/Device.cpp
|
||||||
settings/TelldusSettingsConfuse.cpp
|
SettingsConfuse.cpp
|
||||||
)
|
)
|
||||||
ADD_DEFINITIONS(
|
ADD_DEFINITIONS(
|
||||||
-D_LINUX
|
-D_LINUX
|
||||||
|
@ -51,6 +56,7 @@ IF (APPLE)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(${telldus-core_TARGET}
|
TARGET_LINK_LIBRARIES(${telldus-core_TARGET}
|
||||||
${COREFOUNDATION_LIBRARY}
|
${COREFOUNDATION_LIBRARY}
|
||||||
|
${QT_LIBRARIES}
|
||||||
${FTD2XX_LIBRARY}
|
${FTD2XX_LIBRARY}
|
||||||
)
|
)
|
||||||
SET_PROPERTY(TARGET ${telldus-core_TARGET}
|
SET_PROPERTY(TARGET ${telldus-core_TARGET}
|
||||||
|
@ -59,6 +65,7 @@ IF (APPLE)
|
||||||
|
|
||||||
ELSE (APPLE)
|
ELSE (APPLE)
|
||||||
TARGET_LINK_LIBRARIES(${telldus-core_TARGET}
|
TARGET_LINK_LIBRARIES(${telldus-core_TARGET}
|
||||||
|
${QT_LIBRARIES}
|
||||||
confuse
|
confuse
|
||||||
)
|
)
|
||||||
ENDIF (APPLE)
|
ENDIF (APPLE)
|
||||||
|
|
|
@ -21,26 +21,26 @@ Device* TelldusSettings::getDevice(int intDeviceId){
|
||||||
}
|
}
|
||||||
|
|
||||||
//each new brand must be added here
|
//each new brand must be added here
|
||||||
if (strcmp(protocol, "Nexa") == 0){
|
if (strcasecmp(protocol, "arctech") == 0){
|
||||||
char *strHouse = getDeviceParameter(intDeviceId, "nexa_house");
|
char *strHouse = getDeviceParameter(intDeviceId, "nexa_house");
|
||||||
char *strCode = getDeviceParameter(intDeviceId, "nexa_unit");
|
char *strCode = getDeviceParameter(intDeviceId, "nexa_unit");
|
||||||
dev = new DeviceNexa(strHouse, strCode);
|
dev = new DeviceNexa(strHouse, strCode);
|
||||||
free(strHouse);
|
free(strHouse);
|
||||||
free(strCode);
|
free(strCode);
|
||||||
|
|
||||||
} else if (strcmp(protocol, "Waveman") == 0) {
|
} else if (strcasecmp(protocol, "Waveman") == 0) {
|
||||||
char *strHouse = getDeviceParameter(intDeviceId, "nexa_house");
|
char *strHouse = getDeviceParameter(intDeviceId, "nexa_house");
|
||||||
char *strCode = getDeviceParameter(intDeviceId, "nexa_unit");
|
char *strCode = getDeviceParameter(intDeviceId, "nexa_unit");
|
||||||
dev = new DeviceWaveman(strHouse, strCode);
|
dev = new DeviceWaveman(strHouse, strCode);
|
||||||
free(strHouse);
|
free(strHouse);
|
||||||
free(strCode);
|
free(strCode);
|
||||||
|
|
||||||
} else if (strcmp(protocol, "Sartano") == 0) {
|
} else if (strcasecmp(protocol, "Sartano") == 0) {
|
||||||
char *strCode = getDeviceParameter(intDeviceId, "sartano_code");
|
char *strCode = getDeviceParameter(intDeviceId, "sartano_code");
|
||||||
dev = new DeviceSartano(strCode);
|
dev = new DeviceSartano(strCode);
|
||||||
free(strCode);
|
free(strCode);
|
||||||
|
|
||||||
} else if (strcmp(protocol, "Ikea") == 0) {
|
} else if (strcasecmp(protocol, "Ikea") == 0) {
|
||||||
char *strSystem = getDeviceParameter(intDeviceId, "ikea_system");
|
char *strSystem = getDeviceParameter(intDeviceId, "ikea_system");
|
||||||
char *strUnits = getDeviceParameter(intDeviceId, "ikea_units");
|
char *strUnits = getDeviceParameter(intDeviceId, "ikea_units");
|
||||||
char *strFade = getDeviceParameter(intDeviceId, "ikea_fade");
|
char *strFade = getDeviceParameter(intDeviceId, "ikea_fade");
|
|
@ -229,7 +229,11 @@ bool TelldusSettings::setIntSetting(int intDeviceId, const char* name, int value
|
||||||
|
|
||||||
|
|
||||||
bool readConfig(cfg_t **cfg) {
|
bool readConfig(cfg_t **cfg) {
|
||||||
cfg_opt_t parameter_opts[] = {
|
cfg_opt_t controller_opts[] = {
|
||||||
|
CFG_INT("id", -1, CFGF_NONE),
|
||||||
|
};
|
||||||
|
|
||||||
|
cfg_opt_t device_parameter_opts[] = {
|
||||||
//Nexa
|
//Nexa
|
||||||
CFG_STR("nexa_house", 0, CFGF_NONE),
|
CFG_STR("nexa_house", 0, CFGF_NONE),
|
||||||
CFG_STR("nexa_unit", 0, CFGF_NONE),
|
CFG_STR("nexa_unit", 0, CFGF_NONE),
|
||||||
|
@ -248,9 +252,10 @@ bool readConfig(cfg_t **cfg) {
|
||||||
cfg_opt_t device_opts[] = {
|
cfg_opt_t device_opts[] = {
|
||||||
CFG_INT("id", -1, CFGF_NONE),
|
CFG_INT("id", -1, CFGF_NONE),
|
||||||
CFG_STR("name", "Unnamed", CFGF_NONE),
|
CFG_STR("name", "Unnamed", CFGF_NONE),
|
||||||
CFG_STR("protocol", "Nexa", CFGF_NONE),
|
CFG_INT("controller", 0, CFGF_NONE),
|
||||||
|
CFG_STR("protocol", "arctech", CFGF_NONE),
|
||||||
CFG_INT("model", 1, CFGF_NONE),
|
CFG_INT("model", 1, CFGF_NONE),
|
||||||
CFG_SEC("parameters", parameter_opts, CFGF_NONE),
|
CFG_SEC("parameters", device_parameter_opts, CFGF_NONE),
|
||||||
CFG_END()
|
CFG_END()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue