private void Excute(MethodType methodType, params object[] args) { string methodName = typeof(TEntity).Name.Replace("Contract", "") + "_" + methodType.ToString(); WCFCaller <IStorageManagement> .ExecuteMethod(ServerAddress.CTLAddress, methodName, args);// as List<LMCommandParaTableContract>; }
private TDerivedEntity Excute <TDerivedEntity>(MethodType methodType, params object[] args) { string methodName = typeof(TEntity).Name.Replace("Contract", "") + "_" + methodType.ToString(); return((TDerivedEntity)WCFCaller <IStorageManagement> .ExecuteMethod(ServerAddress.CTLAddress, methodName, args)); }
private async Task MediatorSamplePoints() { try { if (ViewModel is VibrationChannelToken) { var vChannelToken = ViewModel as VibrationChannelToken; var _dataModelProvider = ServiceLocator.Current.GetInstance <DataModelProvider.DataModelProvider>(); if (_dataModelProvider != null) { var vInfo = _dataModelProvider.LMVInfos.Where(o => o.ChannelID == vChannelToken.Channel.ChannelID).SingleOrDefault(); if (vInfo != null) { // "高危", "高警", "正常(高)", "正常(低)", "低警", "低危" FreeformPointLineSeries fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "高危").Single(); vInfo.FormulaHighDanger = string.Empty; vInfo.FormulaHighDanger += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); vInfo.FormulaHighDanger += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); //for (int i = 0; i < fls.SeriesEventMarkers.Count; i++) //{ // //vInfo.FormulaHighDanger += fls.SeriesEventMarkers[i].XValue + "," + fls.SeriesEventMarkers[i].YValue + ";"; // vInfo.FormulaHighDanger += BitConverter.ToString(BitConverter.GetBytes(fls.SeriesEventMarkers[i].XValue)).Replace("-", null); // vInfo.FormulaHighDanger += BitConverter.ToString(BitConverter.GetBytes(fls.SeriesEventMarkers[i].YValue)).Replace("-", null); //} fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "高警").Single(); vInfo.FormulaHighAlert = string.Empty; vInfo.FormulaHighAlert += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); vInfo.FormulaHighAlert += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "正常(高)").Single(); vInfo.FormulaHighNormal = string.Empty; vInfo.FormulaHighNormal += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); vInfo.FormulaHighNormal += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "正常(低)").Single(); vInfo.FormulaLowNormal = string.Empty; vInfo.FormulaLowNormal += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); vInfo.FormulaLowNormal += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "低警").Single(); vInfo.FormulaLowAlert = string.Empty; vInfo.FormulaLowAlert += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); vInfo.FormulaLowAlert += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "低危").Single(); vInfo.FormulaLowDanger = string.Empty; vInfo.FormulaLowDanger += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); vInfo.FormulaLowDanger += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); await Task.Run(() => WCFCaller <IStorageManagement> .ExecuteMethod(ServerAddress.CTLAddress, "LMVInfoTable_Update", vInfo.Contract)); } } } else if (ViewModel is DivFreChannelToken) { var divChannelToken = ViewModel as DivFreChannelToken; var _dataModelProvider = ServiceLocator.Current.GetInstance <DataModelProvider.DataModelProvider>(); if (_dataModelProvider != null) { var vInfo = _dataModelProvider.LMVInfos.Where(o => o.ChannelID == divChannelToken.Channel.ChannelID).SingleOrDefault(); if (vInfo != null) { var divFre = vInfo.DivFres.Where(o => o.FreDescription == divChannelToken.Channel.FreDescription).SingleOrDefault(); if (divFre != null) { FreeformPointLineSeries fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "高危").Single(); divFre.FormulaHighDanger = string.Empty; divFre.FormulaHighDanger += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); divFre.FormulaHighDanger += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "高警").Single(); divFre.FormulaHighAlert = string.Empty; divFre.FormulaHighAlert += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); divFre.FormulaHighAlert += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "正常(高)").Single(); divFre.FormulaHighNormal = string.Empty; divFre.FormulaHighNormal += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); divFre.FormulaHighNormal += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "正常(低)").Single(); divFre.FormulaLowNormal = string.Empty; divFre.FormulaLowNormal += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); divFre.FormulaLowNormal += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "低警").Single(); divFre.FormulaLowAlert = string.Empty; divFre.FormulaLowAlert += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); divFre.FormulaLowAlert += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); fls = m_chart.ViewXY.FreeformPointLineSeries.Where(o => o.Title.Text == "低危").Single(); divFre.FormulaLowDanger = string.Empty; divFre.FormulaLowDanger += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.XValue)).Replace("-", null))); divFre.FormulaLowDanger += string.Concat(fls.SeriesEventMarkers.Select(o => BitConverter.ToString(BitConverter.GetBytes(o.YValue)).Replace("-", null))); await Task.Run(() => WCFCaller <IStorageManagement> .ExecuteMethod(ServerAddress.CTLAddress, "LMDivFreTable_Update", divFre.Contract)); } } } } EventAggregatorService.Instance.EventAggregator.GetEvent <FittingCoeffEvent>().Publish(null); } catch (Exception ex) { EventAggregatorService.Instance.EventAggregator.GetEvent <ThrowExceptionEvent>().Publish(Tuple.Create <string, Exception>("数据回放-传递方程式", ex)); } }