public void Update( AssetDatas assetDatas ) { _assetDatas = assetDatas; _hasBeenFocused = false; this.Invoke( ( MethodInvoker )delegate { string assetName = _assetDatas.Name.Substring( _assetDatas.Name.IndexOf( '/' ) + 1 ); labelName.Text = "Asset " + assetName; assetLinkToPortal.Text = "View " + assetName + " in the portal"; _ieProcessInfos.Arguments = String.Format( @Resource.PortalAssetLink, assetName ); updateDocumentsTree(); if( _assetDatas.ScadaDatas.Exists ) { labelTemperature.Text = string.Format( Resource.Temperature, _assetDatas.ScadaDatas.Temperature ); labelPressure.Text = string.Format( Resource.Pressure, _assetDatas.ScadaDatas.Pressure ); panelScada.Visible = true; labelScada.Visible = true; labelTemperature.Visible = true; labelPressure.Visible = true; } else { labelTemperature.Text = "Unable to retrieve temperature"; labelPressure.Text = "Unable to retrieve pressure"; } } ); }
public void Update( AssetDatas asset ) { _labels.Clear(); IVRLabel l = _labels.Add( String.Format("{0}\n\nTemperature: {1}°C\nPressure: {2} bar", asset.Name.Substring( asset.Name.IndexOf( '/' ) + 1 ), asset.ScadaDatas.Temperature, asset.ScadaDatas.Pressure), asset.Position ); }
// Get the information about the asset and displays it public void ShowAsset( IVRBranch branch ) { AssetDatas assetDatas = new AssetDatas( branch ); if( _currentAssetView == null ) { _currentAssetView = ( AssetView )AssetDatasViewer.CurrentViewer.UI.OpenForm( typeof( AssetView ) ); _currentAssetView.FormClosing += new FormClosingEventHandler( assetView_Closed ); } mDeleg_DocumentsAndScada = new Deleg( _service.GetAssetDocumentsAndScada ); AsyncCallback callback_DocumentsAndScada = new AsyncCallback( buildAssetView ); mDeleg_DocumentsAndScada.BeginInvoke( assetDatas, callback_DocumentsAndScada, null ); }
protected override void OnFormClosing( FormClosingEventArgs e ) { _assetDatas = null; SDKViewer.ProjectManager.CurrentProject.BranchManager.ClearHighlights(); documentsTree.AfterExpand -= new TreeViewEventHandler( documentsTree_AfterExpand ); documentsTree.AfterCollapse -= new TreeViewEventHandler( documentsTree_AfterCollapse ); documentsTree.BeforeExpand -= new TreeViewCancelEventHandler( documentsTree_BeforeExpand ); documentsTree.MouseDoubleClick -= new MouseEventHandler( documentsTree_MouseDoubleClick ); if( _browser != null ) { _browser.Close(); } ReleaseDevice(); base.OnFormClosing( e ); }
public AssetScadaDatas( AssetDatas asset, string temperature, string pressure ) { _asset = asset; _temperature = temperature; _pressure = pressure; }