how to customize the app designer linear gauge to mimic the fluid level gauge?

2 ビュー (過去 30 日間)
Joaquin
Joaquin 2025 年 7 月 14 日
コメント済み: Joaquin 2025 年 7 月 21 日
In absence of a fluid level gauge (it was found in earlier versions of simulink real time instrumentation panels such as in 2018b), how can I modify the linear gauge used in app designer to mimic the functionality of a fluid level gauge? That type of gauge was very useful and for some reason isn't part of the new instrumenation options.
  2 件のコメント
Govind KM
Govind KM 2025 年 7 月 16 日
I cannot see any such "Fluid level gauge" in the components section of App Designer in MATLAB R2018b. The gauge components seem to be the same as present in R2025a.
Could you provide more details on this "Fluid level gauge" and its functionality? Is there a specific reason why the available gauge components in App Designer do not suit your workflow?
Joaquin
Joaquin 2025 年 7 月 16 日
Hi Govind,
Correction, it is MATLAB R2018a. I don't find the fluid level gauge (shown below from 2018a snapshot) in the instrumentation options of appdesigner for version 2022b. I though this can be achieved using the linear gauge found in 2022b but I didn't manage to visually emulate the fluid level gauge from 2018a. thanks

サインインしてコメントする。

回答 (1 件)

Vidhi Agarwal
Vidhi Agarwal 2025 年 7 月 17 日
編集済み: Vidhi Agarwal 2025 年 7 月 17 日
To visually mimic a fluid level gauge using the Linear Gauge in App Designer, you can try the following approach:
  • Use a Vertical Linear Gauge: In App Designer, drag a Linear Gauge onto your canvas.
  • Customize the Appearance: Adjust the "Limits" (minimum and maximum values) to match your fluid level range. Set the "MajorTicks" and "MinorTicks" for suitable graduations. Change the "BackgroundColor" and "ForegroundColor" properties to use blue or another fluid-like color for the bar. Optionally, hide the needle or pointer if you want a solid bar appearance. Add a label or units as needed to indicate the measurement.
The sample code will look like this:
app.LinearGauge.Orientation = 'vertical';
app.LinearGauge.Limits = [0 100]; % Adjust as needed
app.LinearGauge.MajorTicks = 0:20:100;
app.LinearGauge.Value = currentFluidLevel;
app.LinearGauge.ScaleColors = [0 0 1]; % Blue color
app.LinearGauge.ScaleColorLimits = [0 100];
Hope this helps!
  1 件のコメント
Joaquin
Joaquin 2025 年 7 月 21 日
The suggestions only change to the visual characteristics of the gauge; however, the "blue" bar does not indicate the level of the fluid. The red needle does actually show the level for this example (~88%). Also how do I hide the needle?thanks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimscape Fluids についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by