示例#1
0
        public string Build(DataCurveTriggerSettings triggerSettings, IHomeSeerHandler homeSeerHandler = null)
        {
            var sb = new StringBuilder();

            sb.AppendLine("<table>");

            var floorDropDown = CreateFloorDropdown(triggerSettings.FloorChosen, triggerSettings.UidString, triggerSettings.UniqueControllerId);
            var roomDropdown  = CreateRoomDropdown(triggerSettings.RoomChosen, triggerSettings.UidString, triggerSettings.UniqueControllerId);

            if (!_floorsRomsAndDevices.RoomExists(triggerSettings.RoomChosen))
            {
                triggerSettings.RoomChosen = "";
            }
            if (!_floorsRomsAndDevices.FloorExists(triggerSettings.FloorChosen))
            {
                triggerSettings.FloorChosen = "";
            }
            var deviceDropdown = CreateDeviceDropdown(triggerSettings.FloorChosen, triggerSettings.RoomChosen, triggerSettings.DeviceIdChosen, triggerSettings.UidString, triggerSettings.UniqueControllerId);
            var timePicker     = CreateTimePicker(triggerSettings.TimeSpanChosen, triggerSettings.UidString, triggerSettings.UniqueControllerId, Constants.TimeSpanKey);
            var ascendingDescendingDropdown = CreateAscendingDescendingDropdown(triggerSettings.AscendingOrDescending, triggerSettings.UidString, triggerSettings.UniqueControllerId);

            sb.AppendLine($"<tr><td>A data curve of device values for the device {floorDropDown} {roomDropdown}  {deviceDropdown} has had {ascendingDescendingDropdown} curve for the last {timePicker}</td></tr>");
            //Future computation ui
            sb.AppendLine(CreateChoicesForFutureComputation(triggerSettings));
            sb.AppendLine("</table>");
            return(sb.ToString());
        }
        public string Build(DataCurveTriggerBSettings triggerSettings, IHomeSeerHandler homeSeerHandler = null)
        {
            var sb = new StringBuilder();

            sb.AppendLine("<table>");

            var floorDropDown = CreateFloorDropdown(triggerSettings.FloorChosen, triggerSettings.UidString, triggerSettings.UniqueControllerId);
            var roomDropdown  = CreateRoomDropdown(triggerSettings.RoomChosen, triggerSettings.UidString, triggerSettings.UniqueControllerId);

            if (!_floorsRoomsAndDevices.RoomExists(triggerSettings.RoomChosen))
            {
                triggerSettings.RoomChosen = "";
            }
            if (!_floorsRoomsAndDevices.FloorExists(triggerSettings.FloorChosen))
            {
                triggerSettings.FloorChosen = "";
            }
            var deviceDropdown = CreateDeviceDropdown(triggerSettings.FloorChosen, triggerSettings.RoomChosen, triggerSettings.DeviceIdChosen, triggerSettings.UidString, triggerSettings.UniqueControllerId);
            var ascendingDescendingDropdown = CreateAscendingDescendingDropdown(triggerSettings.AscendingOrDescending, triggerSettings.UidString, triggerSettings.UniqueControllerId);

            var thresholdDefaultText = "";

            if (triggerSettings.ThresholdValue.HasValue)
            {
                thresholdDefaultText = triggerSettings.ThresholdValue.Value.ToString(CultureInfo.CreateSpecificCulture("en-US"));
            }

            var thresholdValueTextbox = CreateJqTextBox(Constants.ThresholdValueKey, thresholdDefaultText, triggerSettings, 3);

            var numberOfLastDataPointsText = "";

            if (triggerSettings.NumberOfLastMeasurements.HasValue)
            {
                numberOfLastDataPointsText = triggerSettings.NumberOfLastMeasurements.Value.ToString(CultureInfo.CreateSpecificCulture("en-US"));
            }

            var numberOfMeasurementsTextBox = CreateJqTextBox(Constants.NumberOfLastMeasurementsKey, numberOfLastDataPointsText, triggerSettings, 3);

            sb.AppendLine($"<tr><td>The threshold value of {thresholdValueTextbox } has been reached for the device {floorDropDown} {roomDropdown}  {deviceDropdown} and it has had {ascendingDescendingDropdown} curve for the {numberOfMeasurementsTextBox} last measurements</td></tr>");
            sb.AppendLine("</table>");
            return(sb.ToString());
        }