| | |
| | | using DevExpress.XtraCharts; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraLayout; |
| | | using System.IO; |
| | | using System.Text; |
| | | using Yw; |
| | |
| | | { |
| | | public partial class IBoxFormDataFilter : DocumentPage |
| | | { |
| | | private string startCode = "[&start&]"; |
| | | private string endCode = "[&end&]"; |
| | | private string paramCode = "[¶m&]"; |
| | | private string getfilterCode = "getfilter"; |
| | | private string savefilterCode = "savefilter"; |
| | | |
| | | public IBoxFormDataFilter() |
| | | { |
| | | InitializeComponent(); |
| | | imageComboBoxEdit1.EditValue = "Flow"; |
| | | InitChart(); |
| | | } |
| | | |
| | | |
| | | public void HideButton() |
| | | { |
| | | //simpleButton1.Visible = simpleButton2.Visible = simpleButton3.Visible = simpleButton4.Visible = false; |
| | | layoutControlItem7.Visibility = layoutControlItem9.Visibility = layoutControlItem8.Visibility = layoutControlItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
| | | } |
| | | private void EboxFormDataFilter_Load(object sender, EventArgs e) |
| | | { |
| | | SendText(startCode + getfilterCode + paramCode + endCode); |
| | | SendText(IBoxHelper.startCode + IBoxHelper.getfilterCode + IBoxHelper.paramCode + IBoxHelper.endCode); |
| | | } |
| | | |
| | | public event EventHandler<string> SendData; |
| | | private void SendText(string content) |
| | | { |
| | | //BluetoothHelper.GetInstance().SendData(content); |
| | | SendData?.Invoke(null, content); |
| | | if (SendData != null) |
| | | { |
| | | SendData?.Invoke(null, content); |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (IBoxHelper.Ping()) |
| | | { |
| | | var smsg = content.Split(new string[] { IBoxHelper.paramCode }, StringSplitOptions.RemoveEmptyEntries); |
| | | if (smsg.Length < 2) |
| | | { |
| | | return; |
| | | } |
| | | switch (smsg[0].Trim()) |
| | | { |
| | | case IBoxHelper.getfilterCode: |
| | | { |
| | | var order = IBoxHelper.HttpGet(content); |
| | | var result = IBoxHelper.GetContent(order); |
| | | if (!string.IsNullOrEmpty(result)) |
| | | { |
| | | var model = JsonHelper.Json2Object<IBoxFilterViewModel>(result); |
| | | BindData(model, false); |
| | | } |
| | | break; |
| | | } |
| | | default: |
| | | IBoxHelper.HttpGet(content); |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBoxHelper.ShowWarning("网络连接失败,请检查网络"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | this.model = model; |
| | | checkEditIsFlow.Checked = model.IsFlowFilter; |
| | | checkEditIsPress.Checked = model.IsPressFilter ; |
| | | checkEditIsPress.Checked = model.IsPressFilter; |
| | | imageComboBoxEdit1_SelectedIndexChanged(null, null); |
| | | } |
| | | private Series _seriesOld, _seriesNew; |
| | |
| | | } |
| | | private void simpleButton2_Click_1(object sender, EventArgs e) |
| | | { |
| | | ReSet(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 修正j |
| | | /// </summary> |
| | | public void ReSet() |
| | | { |
| | | var isControlInput = checkEditIsControlInput.Checked; |
| | | var RValue = double.Parse(textEditRValue.Text); |
| | | var QValue = double.Parse(textEditQValue.Text); |
| | |
| | | IBoxFilterViewModel model = new IBoxFilterViewModel(); |
| | | private void simpleButton4_Click(object sender, EventArgs e) |
| | | { |
| | | Save(); |
| | | } |
| | | |
| | | public void Save() |
| | | { |
| | | model.IsFlowFilter = checkEditIsFlow.Checked; |
| | | model.IsPressFilter = checkEditIsPress.Checked; |
| | | SetValue(); |
| | | SendText(startCode + savefilterCode + paramCode + JsonHelper.Object2Json(model) + endCode); |
| | | SendText(IBoxHelper.startCode + IBoxHelper.savefilterCode + IBoxHelper.paramCode + JsonHelper.Object2Json(model) + IBoxHelper.endCode); |
| | | MessageBoxHelper.ShowInfo("保存成功"); |
| | | } |
| | | |
| | |
| | | |
| | | private void simpleButton1_Click(object sender, EventArgs e) |
| | | { |
| | | Import(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导入 |
| | | /// </summary> |
| | | public void Import() |
| | | { |
| | | #region Load |
| | | ClearChart(); |
| | | |