/// <summary> /// This method fetches the most recent 100 measurements for the selected part. Please have a look at the other properties inside /// the filter class to understand all possibilities of filtering. /// </summary> private async Task updateMeasurements2CheckDemoReport(PathInformation partPath, string serialNumber) { SimpleMeasurement[] _Measurements = new SimpleMeasurement[0]; try { var sw = System.Diagnostics.Stopwatch.StartNew(); _Measurements = (await _RestDataServiceClient.GetMeasurements(partPath, new MeasurementFilterAttributes { SearchCondition = new GenericSearchAttributeCondition { Attribute = (ushort)14, Operation = Operation.Equal, Value = serialNumber } })).ToArray();// sw.Stop(); foreach (var mes in _Measurements) { mes.SetAttribute((ushort)20057, "已完成"); } if (_Measurements.Count() > 0) { await _RestDataServiceClient.UpdateMeasurements(_Measurements); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
/// <summary> /// This method fetches the most recent 100 measurements for the selected part. Please have a look at the other properties inside /// the filter class to understand all possibilities of filtering. /// </summary> private async Task FetchMeasurements4FileServerIP(PathInformation partPath) { SimpleMeasurement[] _Measurements = new SimpleMeasurement[0]; try { var sw = System.Diagnostics.Stopwatch.StartNew(); _Measurements = (await _RestDataServiceClient.GetMeasurements(partPath, new MeasurementFilterAttributes { LimitResult = 1000 })).ToArray();// sw.Stop(); foreach (var mes in _Measurements) { if (mes.GetAttributeValue((ushort)20028) != null) { if (ownerList.FindAll(n => n == mes.GetAttributeValue((ushort)20028)).Count() == 0) { ownerList.Add(mes.GetAttributeValue((ushort)20028)); comboBox1.Items.Add(mes.GetAttributeValue((ushort)20028)); } } if (mes.GetAttributeValue((ushort)20004) != null) { if (salesList.FindAll(n => n == mes.GetAttributeValue((ushort)20004)).Count() == 0) { salesList.Add(mes.GetAttributeValue((ushort)20004)); comboBox2.Items.Add(mes.GetAttributeValue((ushort)20004)); } } if (mes.GetAttributeValue((ushort)20003) != null) { if (demoEngineerList.FindAll(n => n == mes.GetAttributeValue((ushort)20003)).Count() == 0) { demoEngineerList.Add(mes.GetAttributeValue((ushort)20003)); comboBox3.Items.Add(mes.GetAttributeValue((ushort)20003)); } } if (mes.GetAttributeValue((ushort)1062) != null) { if (customerList.FindAll(n => n == mes.GetAttributeValue((ushort)1062)).Count() == 0) { customerList.Add(mes.GetAttributeValue((ushort)1062)); comboBox4.Items.Add(mes.GetAttributeValue((ushort)1062)); customers.Add(new Customer { name = mes.GetAttributeValue((ushort)1062), province = mes.GetAttributeValue((ushort)20001), city = mes.GetAttributeValue((ushort)20002) }); } } if (mes.GetAttributeValue((ushort)20051) != null) { if (cmmList.FindAll(n => n == mes.GetAttributeValue((ushort)20051)).Count() == 0) { cmmList.Add(mes.GetAttributeValue((ushort)20051)); comboBox7.Items.Add(mes.GetAttributeValue((ushort)20051)); } } if (mes.GetAttributeValue((ushort)20052) != null) { if (sensorList.FindAll(n => n == mes.GetAttributeValue((ushort)20052)).Count() == 0) { sensorList.Add(mes.GetAttributeValue((ushort)20052)); comboBox8.Items.Add(mes.GetAttributeValue((ushort)20052)); } } } listCombobox1 = getComboboxItems(this.comboBox1); //获取Item listCombobox2 = getComboboxItems(this.comboBox2); //获取Item listCombobox3 = getComboboxItems(this.comboBox3); //获取Item listCombobox4 = getComboboxItems(this.comboBox4); //获取Item listCombobox7 = getComboboxItems(this.comboBox7); //获取Item listCombobox8 = getComboboxItems(this.comboBox8); //获取Item } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }