Siticone Liquid Gauge
The SiticoneLiquidGauge is a visually striking control that simulates fluid behavior.
It is designed to visualize levels in tanks, chemical containers, or biological systems.
Key features include realistic wave physics, bubbling effects, vapor particles, and dynamic viscosity simulation.
Liquid Values
Properties for managing liquid capacity and current levels.
| Property | Type | Description & Usage Example |
|---|---|---|
LiquidLevel |
double | tank.LiquidLevel = 75.5; The current volume of liquid. Setting this triggers a smooth filling or draining animation. |
BaseLevel |
double | tank.BaseLevel = 0; The value representing an empty container. |
TopLevel |
double | tank.TopLevel = 500; The value representing a full container (Maximum Capacity). |
Appearance & Themes
Customize the container shape, liquid type, and visual themes.
| Property | Type | Description & Usage Example |
|---|---|---|
LiquidTheme |
SiticoneLiquidTheme |
tank.LiquidTheme = SiticoneLiquidTheme.Oil;
Applies a preset visual style. Options: Water, Oil, Mercury, Lava, Acid, Wine, Honey, Blood.
|
Shape |
ContainerShape |
tank.Shape = ContainerShape.Flask;
Defines the vessel geometry. Options: Rectangle, Cylinder, Flask, Beaker, Bottle.
|
LiquidColor |
Color | tank.LiquidColor = Color.Blue; Base color of the fluid. |
ContainerColor |
Color | tank.ContainerColor = Color.WhiteSmoke; Background color of the empty space in the container. |
Fluid Physics & Effects
Control the simulation parameters for waves, viscosity, and particle systems.
| Property | Type | Description & Usage Example |
|---|---|---|
EnableWaveAnimation |
bool | tank.EnableWaveAnimation = true; Enables the surface wave simulation. |
FlowStyle |
LiquidFlowStyle |
tank.FlowStyle = LiquidFlowStyle.Turbulent;
Determines wave behavior. Options: Smooth, Turbulent, Viscous, Rapid, Gentle.
|
Viscosity |
LiquidViscosity | tank.Viscosity = LiquidViscosity.Thick; Controls how fast the liquid level settles. Affects animation speed. |
ShowBubbles |
bool | tank.ShowBubbles = true; Adds rising air bubbles to the liquid. |
EnableVaporEffect |
bool | tank.EnableVaporEffect = true; Simulates steam or gas rising from the liquid surface (useful for hot liquids). |
Temperature |
float | tank.Temperature = 100; Sets liquid temp. High values trigger vapor; low values may slow animation. |
Public Methods
// Fills the container to TopLevel capacity.
tank.FillContainer(true);
// Drains the container to BaseLevel.
tank.EmptyContainer(true);
// Triggers a splash and ripple effect on the surface.
// Useful when simulating adding objects to the liquid.
tank.CreateSplash();
Events
// 1. LevelChanged Event
// Fires when the LiquidLevel property is updated.
tank.LevelChanged += (s, e) =>
{
Console.WriteLine($"Level: {e.NewLevel} {tank.LiquidUnit}");
};
// 2. LevelAnimationComplete Event
// Fires when the fluid settles at the target level.
tank.LevelAnimationComplete += (s, e) =>
{
if (tank.IsOverflowing())
{
MessageBox.Show("Tank Overflow!");
}
};
Designer & Smart Tags
The control includes a rich Smart Tag menu for rapid prototyping.
| Feature | Description |
|---|---|
Liquid Presets |
Instantly apply complex physical and visual properties:
|
Container Actions |
Fill Container, Empty Container, and Create Splash are available directly in the designer for testing. |
Detailed Usage Examples
Example 1: Chemical Mixer (Acid Theme)
Simulates a bubbling acid tank with a glass flask shape.
private void SetupChemicalTank()
{
acidTank.LiquidTheme = SiticoneLiquidTheme.Acid;
acidTank.Shape = ContainerShape.Flask;
acidTank.ContainerLabel = "H2SO4";
acidTank.LiquidUnit = "mL";
// Enhance effects
acidTank.ShowBubbles = true;
acidTank.EnableVaporEffect = true; // Fumes
acidTank.ShowGlassEffect = true;
}
Example 2: Fuel Gauge (Viscous)
A slow-moving fuel gauge using the Oil theme for realistic viscosity.
private void SetupFuelGauge()
{
fuelTank.LiquidTheme = SiticoneLiquidTheme.Oil;
fuelTank.Shape = ContainerShape.Tank;
fuelTank.ContainerLabel = "DIESEL";
// Slow, thick movement
fuelTank.Viscosity = LiquidViscosity.Thick;
fuelTank.FlowStyle = LiquidFlowStyle.Viscous;
}
public void Refuel()
{
fuelTank.FillContainer();
}
Example 3: Cooling System (Temperature)
A coolant monitor that changes visual state based on temperature.
private void SetupCoolantSystem()
{
coolantTank.LiquidTheme = SiticoneLiquidTheme.Coolant;
coolantTank.ShowTemperatureEffect = true;
}
public void UpdateSystemStatus(double level, float tempCelsius)
{
coolantTank.LiquidLevel = level;
coolantTank.Temperature = tempCelsius;
// If temp is high, vapor will automatically appear due to ShowTemperatureEffect
}