| | |
| | | pmhigherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | pmhigherView.btnText.TextID = StringId.PM25; |
| | | viewLayout.AddChidren(pmhigherView.FLayoutView()); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | PmAction(this); |
| | | |
| | | }; |
| | | |
| | | |
| | | |
| | | #endregion |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="textInt">文本</param> |
| | | /// <param name="stateValue">编辑之前的状态值,默认为20</param> |
| | | public void InputBoxAction(int textInt, string stateValue = "20") |
| | | public void InputBoxAction(int textInt,string stateValue="20") |
| | | { |
| | | new LogicView.TipPopView { }.InputBox(textInt, stateValue, (value) => |
| | | { |
| | |
| | | public void PmAction(FrameLayout frame, string stateValue = "") |
| | | { |
| | | PublicInterface pmView = new PublicInterface(); |
| | | var pmListStr = pmView.GetViewList("pm25"); |
| | | pmView.SingleSelectionShow(frame, pmListStr, Language.StringByID(StringId.PM25), pmView.GetString("pm25", stateValue) |
| | | var pmListStr = pmView.GetViewList("pm2.5"); |
| | | pmView.SingleSelectionShow(frame, pmListStr, Language.StringByID(StringId.PM25), GetString(stateValue) |
| | | , (text) => |
| | | { |
| | | var value= pmView.GetValue("pm25", text); |
| | | string value = ""; |
| | | if (text == Language.StringByID(StringId.pmyou)) |
| | | { |
| | | value = "10"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.pmliang)) |
| | | { |
| | | value = "50"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.pmqingdu)) |
| | | { |
| | | value = "90"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.pmzhongdu)) |
| | | { |
| | | value = "130"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.pmzhongduwuran)) |
| | | { |
| | | value = "170"; |
| | | } |
| | | AddDic("pm2.5", "=", value); |
| | | }); |
| | | } |
| | |
| | | private void AddDic(string keyValue, string comparator, string value) |
| | | { |
| | | Input input = new Input(); |
| | | input.sid = LogicMethod.CurrLogicMethod.NewSid(); |
| | | input.sid = LogicMethod.NewSid(); |
| | | input.condition_type = "4"; |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "key", keyValue); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", comparator); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "float"); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "value", value); |
| | | LogicMethod.dictionary(dic, "key", keyValue); |
| | | LogicMethod.dictionary(dic, "comparator", comparator); |
| | | LogicMethod.dictionary(dic, "data_type", "float"); |
| | | LogicMethod.dictionary(dic, "value", value); |
| | | input.condition.Add(dic); |
| | | AddCondition(input, keyValue, comparator); |
| | | } |
| | |
| | | /// <param name="input"></param> |
| | | /// <param name="keyValue"></param> |
| | | /// <param name="comparator">比较关系</param> |
| | | private void AddCondition(Input input, string keyValue, string comparator) |
| | | private void AddCondition(Input input, string keyValue,string comparator) |
| | | { |
| | | ///记录索引值 |
| | | int index = -1; |
| | |
| | | Logic.currlogic.input.Add(input); |
| | | } |
| | | |
| | | LogicMethod.CurrLogicMethod.RemoveAllView(); |
| | | LogicMethod.RemoveAllView(); |
| | | AddLogic addLogic = new AddLogic(); |
| | | MainPage.BasePageView.AddChidren(addLogic); |
| | | addLogic.Show(); |
| | |
| | | /// <param name="keyValue"></param> |
| | | /// <param name="comparator">比较关系</param> |
| | | /// <returns></returns> |
| | | private bool ExistKey(List<Dictionary<string, string>> dicList, string keyValue, string comparator) |
| | | private bool ExistKey(List<Dictionary<string, string>> dicList, string keyValue, string comparator) |
| | | { |
| | | for (int i = 0; i < dicList.Count; i++) |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | public string GetString(string strValue) |
| | | { |
| | | string text = ""; |
| | | int intValue = 0; |
| | | if (strValue != "") |
| | | { |
| | | intValue = int.Parse(strValue); |
| | | } |
| | | if (intValue > 0 && intValue < 35) |
| | | { |
| | | text = Language.StringByID(StringId.pmyou); |
| | | } |
| | | else if (intValue > 35 && intValue < 75) |
| | | { |
| | | text = Language.StringByID(StringId.pmliang); |
| | | } |
| | | else if (intValue > 75 && intValue < 115) |
| | | { |
| | | text = Language.StringByID(StringId.pmqingdu); |
| | | } |
| | | else if (intValue > 115 && intValue < 150) |
| | | { |
| | | text = Language.StringByID(StringId.pmzhongdu); |
| | | } |
| | | else if (intValue > 150) |
| | | { |
| | | text = Language.StringByID(StringId.pmzhongduwuran); |
| | | } |
| | | |
| | | return text; |
| | | } |
| | | } |
| | | } |