diff --git a/scripts/md-sr.js b/scripts/md-sr.js index 66a50f48398379afefe6da141080472ead37959e..ed3e2b7cc2e3d10cde71d47dfcd43a47b671c97c 100755 --- a/scripts/md-sr.js +++ b/scripts/md-sr.js @@ -864,14 +864,30 @@ function MD_setupSceneResponder(nRoomID, nRoomModeID, bSwitchOffDarkOnly, nTwili system_states_turn_on_absent.push({"name" : "dev." + nTwilightSensorID + ".0", "value" : "1"}); } - else { + else if (nTwilightSensorID == -1) { + // Use default "position of the sun" parameters + lInfo.logln("Use 'sunset to sunrise'"); + // valid values for daynight state: 1 - bright, 2 - dark + // OR true - bright, false - dark + system_states_turn_on_present.push({"name" : "daynight", "value" : false}); + system_states_turn_on_absent.push({"name" : "daynight", "value" : false}); + } + else if (nTwilightSensorID == -2) { // Use default "position of the sun" parameters - lInfo.logln("Use 'sun position'"); + lInfo.logln("Use 'dusk to dawn'"); // valid values for daylight state: 1 - bright, 2 - dark // OR true - bright, false - dark system_states_turn_on_present.push({"name" : "daylight", "value" : false}); system_states_turn_on_absent.push({"name" : "daylight", "value" : false}); } + else { + // Use default "position of the sun" parameters + lInfo.logln("Use 'sunset-1h to sunset+1h'"); + // valid values for daynight_indoors state: 1 - bright, 2 - dark + // OR true - bright, false - dark + system_states_turn_on_present.push({"name" : "daynight_indoors", "value" : false}); + system_states_turn_on_absent.push({"name" : "daynight_indoors", "value" : false}); + } } else { diff --git a/ui/js/main.js b/ui/js/main.js index 6d6aab46300b14228e2cb0b6a77d5d61d28212f0..9d25527b76dcf330d01d4bdd65339b3f48ce6011 100644 --- a/ui/js/main.js +++ b/ui/js/main.js @@ -102,7 +102,7 @@ Ext.define( header : _('Only if dark'), dataIndex : 'onlyDark', xtype : 'textcolumn', - width : 120 + width : 200 }, { header : _('Alarm mode'), dataIndex : 'setAlarm', @@ -658,7 +658,7 @@ Ext.define( arrayObject.modeName = _('Advanced mode'); arrayObject.isOnlyDark = false; arrayObject.onlyDark = _('N/A'); - arrayObject.onlyDarkTwilightID = -1; + arrayObject.onlyDarkTwilightID = -99; arrayObject.isSetAlarm = false arrayObject.setAlarm = _('N/A'); arrayObject.isAutoOff = false; @@ -686,7 +686,11 @@ Ext.define( if (roomData.switchOffDarkCheck) { if (roomData.switchOffDarkSensorID == 0) { - sStringValue = _("Use position of the sun") + sStringValue = _("Calculated: sunset to sunrise (prolonged)") + } else if (roomData.switchOffDarkSensorID == -1) { + sStringValue = _("Calculated: sunset to sunrise") + } else if (roomData.switchOffDarkSensorID == -2) { + sStringValue = _("Calculated: dusk to dawn") } else { for (var yIndex=0;yIndex<me.deviceArray.length;yIndex++) { if (me.deviceArray[yIndex] != null && me.deviceArray[yIndex].dSUID == roomData.switchOffDarkSensorID) { diff --git a/ui/js/mode-dialog-fields.js b/ui/js/mode-dialog-fields.js index 395eb17f4837d6a78841762ab8f6ef85afe0c4bf..a3f23dc05b007f232a55b68cb381c650c93734ab 100644 --- a/ui/js/mode-dialog-fields.js +++ b/ui/js/mode-dialog-fields.js @@ -101,7 +101,9 @@ Ext.define('DSS.component.RoomFields', { /* Switch off - dark only */ var arraySensors = new Array(); - arraySensors.push({"deviceID":0, "deviceName": _("Use position of the sun")}); + arraySensors.push({"deviceID":0, "deviceName": _("Calculated: sunset to sunrise (prolonged)")}); + arraySensors.push({"deviceID":-1, "deviceName": _("Calculated: sunset to sunrise")}); + arraySensors.push({"deviceID":-2, "deviceName": _("Calculated: dusk to dawn")}); var deviceArray=dss.staticDataModel.getAKMDeviceArray(); if (deviceArray != null) @@ -162,7 +164,7 @@ Ext.define('DSS.component.RoomFields', { displayField: 'deviceName', valueField: 'deviceID', fieldLabel : '', - width : 200, + width : 250, margin : '0 0 0 10', listeners:{ 'select': function(objCombo){ @@ -252,7 +254,7 @@ Ext.define('DSS.component.RoomFields', { border : false, defaults: {style: {float: 'left'}}, items : [this.checkAutoOff, this.lblCheckBox3], - width:500 + width:450 }); var oTabPanelR = Ext.create('Ext.panel.Panel', { border : false, @@ -272,7 +274,7 @@ Ext.define('DSS.component.RoomFields', { this.timeSpanAdditional = Ext.create('DSS.component.TimeSpanControl', { fieldLabel : _("Additional switch-off delay after the motion detector did switch off"), - labelWidth : 530, + labelWidth : 480, hideHour : true, margin : '0 0 0 0', width:100, @@ -378,9 +380,13 @@ Ext.define('DSS.component.RoomFields', { var sSwitchOnLight = _("Switch on the light throughout the day"); // Switch on when dark if (!this.checkLight.disabled && this.checkLight.checked) { - if (this.comboSensors.getValue()==0 || this.comboSensors.getValue()==-1) // MD is selected - sSwitchOnLight = _("Switch on the light between sunset and sunrise"); - else // Use position of the sun is selected + if (this.comboSensors.getValue()==0) + sSwitchOnLight = _("Switch on the light between one hour before sunset and one hour after sunrise"); + else if (this.comboSensors.getValue()==-1) + sSwitchOnLight = _("Switch on the light between sunset and sunrise"); + else if (this.comboSensors.getValue()==-2) + sSwitchOnLight = _("Switch on the light between dusk and dawn"); + else // Use position of the sun is selected sSwitchOnLight = _("Switch on the light if it's dark only"); } sLabelText += "<li>"+sSwitchOnLight+"</li>"; diff --git a/ui/locale/templates/motion-detector.pot b/ui/locale/templates/motion-detector.pot index 62e929363597f5ea6797d220bdd1c99f89d8d266..8681bd12302cfb6f9a2c41feff29ea706dda119a 100644 --- a/ui/locale/templates/motion-detector.pot +++ b/ui/locale/templates/motion-detector.pot @@ -130,9 +130,6 @@ msgstr "" msgid "Mode" msgstr "" -msgid "Use position of the sun" -msgstr "" - msgid "Switch on the light if it's dark only" msgstr "" @@ -219,3 +216,18 @@ msgstr "" msgid "Additional Switch-off Delay" msgstr "" + +msgid "Calculated: sunset to sunrise (prolonged)" +msgstr "" + +msgid "Calculated: sunset to sunrise" +msgstr "" + +msgid "Calculated: dusk to dawn" +msgstr "" + +"Switch on the light between one hour before sunset and one hour after sunrise" +msgstr "" + +msgid "Switch on the light between dusk and dawn" +msgstr ""