| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.AirSwitchP3: |
| | | //var airSwitchP3Page = new AirSwitchP3Page(function); |
| | | //MainPage.BasePageView.AddChidren(airSwitchP3Page); |
| | | //airSwitchP3Page.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | var airSwitchP3Page = new AirSwitchP3Page(function); |
| | | MainPage.BasePageView.AddChidren(airSwitchP3Page); |
| | | airSwitchP3Page.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.LightSwitch: |
| | | var relayView = new RelayPage(function); |
| | |
| | | historyDataView.AddChidren(myEchartsView_Line); |
| | | |
| | | //EnergyRow(energy, energyListView, index); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Control.Ins.SendReadCommand(device); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | LoadMothed_GetHistoryData(); |
| | | |
| | | } |
| | | |
| | |
| | | }); |
| | | |
| | | var sensorType = device.spk.Split(".")[1]; |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, device.deviceId, "total_electricity"); |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, device.deviceId, "power_a"); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString()); |
| | | if (revertData == null || revertData.Count == 0) { |
| | | #if DEBUG |
| | | List<string> vs = new List<string>() { |
| | | "813","313","213","123", |
| | | "113","213","183","133", |
| | | "133","513","133","413", |
| | | }; |
| | | brokenLine.InitXdataText(vs); |
| | | revertData = new List<EnvironmentalSensorHistor>() |
| | | { |
| | | new EnvironmentalSensorHistor{ fieldValue = "100"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "200"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "300"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "400"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "500"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "400"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "100"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "200"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "300"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "400"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "500"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "400"}, |
| | | }; |
| | | if (device.GetAttribute("ydata") == null) |
| | | { |
| | | device.attributes.Add(new FunctionAttributes() { key = "ydata" }); |
| | | } |
| | | device.SetAttrState("ydata", brokenLine.InitYdataText(device.name, revertData, "#5C62FE") + ", "); |
| | | |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | List<string> vs = new List<string>(); |
| | | if (brokenLine.YvalueText == "") |
| | | { |
| | |
| | | { |
| | | device.attributes.Add(new FunctionAttributes() { key = "ydata" }); |
| | | } |
| | | device.SetAttrState("ydata", brokenLine.InitYdataText(device.name, revertData, device.GetAttrState("color")) + ","); |
| | | device.SetAttrState("ydata", brokenLine.InitYdataText(device.name, revertData, "#5C62FE") + ", "); |
| | | } |
| | | } |
| | | } |
| | | brokenLine.yTitle = Language.StringByID(StringId.EnergyConsumption) + "(kW)"; |
| | |
| | | { |
| | | brokenLine.xTitle = Language.StringByID(StringId.Date); |
| | | } |
| | | var opString = brokenLine.InitOption(); |
| | | var opString = brokenLine.InitOption(30); |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="displayScale">显示比例 0-100,比如设置了30,只显示30%,可以左右拖动显示其他</param> |
| | | /// <returns></returns> |
| | | public string InitOption(int displayScale) |
| | | { |
| | | //组装Value |
| | | var newstring = optionString2.Replace("{0}", XvalueText); |
| | | newstring = newstring.Replace("{1}", YvalueText); |
| | | newstring = newstring.Replace("{10}", xTitle); |
| | | newstring = newstring.Replace("{20}", yTitle); |
| | | newstring = newstring.Replace("{30}", displayScale.ToString()); |
| | | newstring = newstring.Replace(",,", ","); |
| | | return newstring; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 组装x轴文本 |
| | | /// </summary> |
| | | /// <param name="xData"></param> |
| | |
| | | }"; |
| | | #endif |
| | | |
| | | |
| | | |
| | | #if __IOS__ |
| | | public string optionString2 = @"{ |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | grid: { |
| | | top: '10%', |
| | | left: '10%', |
| | | right: '10%', |
| | | bottom: '10%', |
| | | }, |
| | | xAxis: { |
| | | name: '{10}', |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: [{0}], |
| | | axisLabel : { |
| | | fontSize:30, |
| | | }, |
| | | }, |
| | | yAxis: { |
| | | name: '{20}', |
| | | type: 'value', |
| | | axisLabel : { |
| | | fontSize:30, |
| | | }, |
| | | }, |
| | | dataZoom: [{ |
| | | type: 'inside', |
| | | xAxisIndex: 0, |
| | | start: 0, |
| | | end: {30} |
| | | }], |
| | | series: [ |
| | | {1} |
| | | ] |
| | | }"; |
| | | #else |
| | | public string optionString2 = @"{ |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | grid: { |
| | | top: '15%', |
| | | left: '13%', |
| | | right: '12%', |
| | | bottom: '10%', |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: [{0}], |
| | | name: '{10}' |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | name: '{20}' |
| | | }, |
| | | dataZoom: [{ |
| | | type: 'inside', |
| | | xAxisIndex: 0, |
| | | start: 0, |
| | | end: {30} |
| | | }], |
| | | series: [ |
| | | {1} |
| | | ] |
| | | }"; |
| | | #endif |
| | | |
| | | /// <summary> |
| | | /// 颜色列表 |
| | | /// </summary> |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm |