This example utilizes the capability of asset modeling. You must have an asset already built in order for this type of script to work. Assets are created in the Views Tile in the Canary Administrator.
In this instance we have created a "Tanks" asset. The dashboard contains two sheets, "General" and "Details". We have selected the Tank asset under the properties menu for the Details screen.
Whenever the Details button is clicked on the General sheet, it loads the Details sheet with that tank's information. The Details button utilizes the "OnClick" function. We need to create a function for each button.

private void SetTankAsset(string asset)
{
Application.Current.Details.AssetInstance = asset;
Application.Current.SetCurrentScreen(Application.Current.Details);
}
public void Tank01_Click(object sender, EventArgs e)
{
SetTankAsset("Tank01");
}
public void Tank02_Click(object sender, EventArgs e)
{
SetTankAsset("Tank02");
}
Comments
0 comments
Please sign in to leave a comment.