| | |
| | | /// <param name="textSize">显示文本字体大小</param> |
| | | public void SingleSelectionShow(FrameLayout frame, List<string> list, string titleText, string stateText, Action<string> action, int textSize = LogicView.TextSize.text14) |
| | | { |
| | | if (list == null) |
| | | { |
| | | return; |
| | | } |
| | | FrameLayout frameLayout = new FrameLayout |
| | | { |
| | | BackgroundColor = CSS.CSS_Color.viewTrans60lucence, |
| | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 多选择 |
| | | /// </summary> |
| | |
| | | /// <param name="list">显示数据源</param> |
| | | /// <param name="titleText">标题</param> |
| | | /// <param name="action">返回值索引值</param> |
| | | public void FrameOrVv(FrameLayout frame, List<string> list, int titleText, Action<int> action) |
| | | { |
| | | public void FrameOrVv(FrameLayout frame, List<string>list, int titleText,Action<int> action) { |
| | | |
| | | int line = 0; |
| | | if (list.Count == 0 || list.Count > 5) |
| | |
| | | /// <param name="stateList">之前状态数据源</param> |
| | | /// <param name="titleText">标题</param> |
| | | /// <param name="action">返回值索引值</param> |
| | | public void FrameOrVvList(FrameLayout frame, List<string> list, List<string> stateList, int titleText, Action<List<string>> action) |
| | | public void FrameOrVvList(FrameLayout frame, List<string> list,List<string>stateList, int titleText, Action<List<string>> action) |
| | | { |
| | | |
| | | int line = 0; |
| | |
| | | { |
| | | verticalRefresh.AddChidren(checkView.FLayoutView()); |
| | | } |
| | | if (stateList.Contains(strName)) |
| | | { |
| | | if (stateList.Contains(strName)) { |
| | | checkView.btnClick.IsSelected = true; |
| | | checkView.btnCheckIcon.IsSelected = true; |
| | | selecetdList.Add(strName); |
| | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 温湿度组合界面 |
| | | /// </summary> |
| | | /// <param name="frameLayout">父控件</param> |
| | | /// <param name="text1">标题文本1</param> |
| | | /// <param name="text2">标题文本2</param> |
| | | /// <param name="action">回调函数</param> |
| | | public void ViewZuHe(FrameLayout frameLayout, int text1, int text2, Action<int, FrameLayout> action) |
| | | { |
| | | |
| | | FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewMiddle }; |
| | | frameLayout.AddChidren(frame); |
| | | LogicView.TopView topView = new LogicView.TopView(); |
| | | topView.topNameBtn.TextID = StringId.wendu; |
| | | frame.AddChidren(topView.FLayoutView()); |
| | | topView.clickBackBtn.MouseUpEventHandler += (e, sen) => |
| | | { |
| | | frame.RemoveFromParent(); |
| | | }; |
| | | FrameLayout viewLayout = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Width = Application.GetRealWidth(LogicView.TextSize.view375), |
| | | Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64), |
| | | BackgroundColor = CSS.CSS_Color.viewMiddle, |
| | | }; |
| | | frame.AddChidren(viewLayout); |
| | | |
| | | //温,湿度高于 |
| | | LogicView.SelectTypeView temperaturehigherView = new LogicView.SelectTypeView(); |
| | | temperaturehigherView.btnIcon.Visible = false; |
| | | temperaturehigherView.btnText.X = Application.GetRealWidth(16); |
| | | temperaturehigherView.btnLine.X = Application.GetRealWidth(16); |
| | | temperaturehigherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | temperaturehigherView.btnText.TextID = text1; |
| | | viewLayout.AddChidren(temperaturehigherView.FLayoutView()); |
| | | //温,湿度低于 |
| | | LogicView.SelectTypeView temperatureunderView = new LogicView.SelectTypeView(); |
| | | temperatureunderView.frameLayout.Y = temperaturehigherView.frameLayout.Bottom; |
| | | temperatureunderView.btnIcon.Visible = false; |
| | | temperatureunderView.btnText.X = Application.GetRealWidth(16); |
| | | temperatureunderView.btnLine.X = Application.GetRealWidth(16); |
| | | temperatureunderView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | temperatureunderView.btnText.TextID = text2; |
| | | viewLayout.AddChidren(temperatureunderView.FLayoutView()); |
| | | |
| | | //温,湿度高于 |
| | | temperaturehigherView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | action(text1, frame); |
| | | }; |
| | | //温,湿度低于 |
| | | temperatureunderView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | action(text2, frame); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取界面列表 |
| | |
| | | }; |
| | | } |
| | | break; |
| | | case "pm25": |
| | | case "pm2.5": |
| | | { |
| | | list = new List<string> { |
| | | Language.StringByID(StringId.pmyou), |
| | |
| | | Language.StringByID(StringId.pmqingdu), |
| | | Language.StringByID(StringId.pmzhongdu), |
| | | Language.StringByID(StringId.pmzhongduwuran), |
| | | }; |
| | | } |
| | | break; |
| | | case "co2": |
| | | { |
| | | list = new List<string> { |
| | | Language.StringByID(StringId.zhengchang), |
| | | Language.StringByID(StringId.piangao), |
| | | Language.StringByID(StringId.chaobiao), |
| | | }; |
| | | } |
| | | break; |
| | | case "tvoc": |
| | | { |
| | | list = new List<string> { |
| | | Language.StringByID(StringId.zhengchang), |
| | | Language.StringByID(StringId.chaobiao), |
| | | Language.StringByID(StringId.yanzhong), |
| | | }; |
| | | } |
| | | break; |
| | |
| | | } |
| | | |
| | | return stateList; |
| | | } |
| | | /// <summary> |
| | | /// 数值返回文本 |
| | | /// </summary> |
| | | /// <param name="type">类型</param> |
| | | /// <param name="strValue">值</param> |
| | | /// <returns></returns> |
| | | public string GetString(string type, string strValue) |
| | | { |
| | | string text = ""; |
| | | int intValue = 0; |
| | | if (strValue != "") |
| | | { |
| | | intValue = int.Parse(strValue); |
| | | } |
| | | |
| | | switch (type) |
| | | { |
| | | case "pm25": |
| | | { |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | break; |
| | | case "co2": |
| | | { |
| | | |
| | | if (intValue > 0 && intValue < 800) |
| | | { |
| | | text = Language.StringByID(StringId.zhengchang); |
| | | } |
| | | else if (intValue > 800 && intValue < 1100) |
| | | { |
| | | text = Language.StringByID(StringId.piangao); |
| | | } |
| | | else if (intValue > 1100) |
| | | { |
| | | text = Language.StringByID(StringId.chaobiao); |
| | | } |
| | | } |
| | | break; |
| | | case "tvoc": |
| | | { |
| | | |
| | | if (intValue >=1 && intValue <= 3) |
| | | { |
| | | text = Language.StringByID(StringId.zhengchang); |
| | | } |
| | | else if (intValue >=4 && intValue<=6) |
| | | { |
| | | text = Language.StringByID(StringId.chaobiao); |
| | | } |
| | | else if (intValue >= 7 && intValue <= 9) |
| | | { |
| | | text = Language.StringByID(StringId.yanzhong); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | return text; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 本文返回数值返回 |
| | | /// </summary> |
| | | /// <param name="type">类型</param> |
| | | /// <param name="text">文本</param> |
| | | /// <returns></returns> |
| | | public string GetValue(string type, string text) |
| | | { |
| | | string value = ""; |
| | | switch (type) |
| | | { |
| | | case "pm25": |
| | | { |
| | | 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"; |
| | | } |
| | | } |
| | | break; |
| | | case "co2": |
| | | { |
| | | if (text == Language.StringByID(StringId.zhengchang)) |
| | | { |
| | | value = "400"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.piangao)) |
| | | { |
| | | value = "850"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.chaobiao)) |
| | | { |
| | | value = "1200"; |
| | | } |
| | | } |
| | | break; |
| | | case "tvoc": |
| | | { |
| | | if (text == Language.StringByID(StringId.zhengchang)) |
| | | { |
| | | value = "2"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.chaobiao)) |
| | | { |
| | | value = "5"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.yanzhong)) |
| | | { |
| | | value = "8"; |
| | | } |
| | | } |
| | | break; |
| | | |
| | | } |
| | | return value; |
| | | } |
| | | |
| | | |