Effacer les filtres
Effacer les filtres

How to make a flowchart of an industrial plant in app designer, where you can add or remove equipment.

5 vues (au cours des 30 derniers jours)
How to make a flowchart of an industrial plant in app designer, where you can add or remove equipment.

Réponses (1)

prabhat kumar sharma
prabhat kumar sharma le 22 Jan 2024
Modifié(e) : prabhat kumar sharma le 22 Jan 2024
Hi Jhoni,
I understand that you want to know how to create a flow chart in the app designer, but app designer is not the correct tool for creating the flow charts, while it does not have any such functionality but I have seen state flow getting used for the flow chart creation.
Here is the link you can refer to know more how to create flow charts in state flow: https://mathworks.com/help/stateflow/ug/flow-charts-in-stateflow.html
If you are looking for an app design to achieve flow chart so there could be a workaround possible:
  1. Create an ‘mlapp’
  2. Use the axes component to draw static elements of the flowchart that do not change, like pipes or fixed structures. You can use functions like plot, line, or rectangle to draw these elements.
  3. Define a way to represent equipment, such as using images, shapes, or custom drawings. You can use ‘imagesc’, rectangle, or other plotting functions to add these to the axes.
  4. Add buttons or other controls that let users add or remove equipment. When a user interacts with these controls, the corresponding callback functions will update the flowchart. For adding equipment, you might open a dialog to select the type of equipment and then draw it on the axes. For removing equipment, you might let users select an item on the flowchart and then press a button to delete it.
% Callback function for 'Add Equipment' button
function AddEquipmentButtonPushed(app, event)
equipmentType = 'Pump'; % This could be determined through a dialog
x = 10; % X position where the new equipment should be added
y = 20; % Y position where the new equipment should be added
drawEquipment(app, equipmentType, x, y);
end
% Function to draw equipment on the axes (Added a public function)
function drawEquipment(app, equipmentType, x, y)
switch equipmentType
case 'Pump'
% Draw a rectangle or an image representing a pump
rectangle(app.UIAxes, 'Position', [x, y, 10, 10], 'Curvature', [1, 1], 'FaceColor', 'r');
% Add cases for other types of equipment
end
end
% Callback function for 'Remove Equipment' button
function RemoveEquipmentButtonPushed(app, event)
% Implement logic to remove selected equipment from the axes
% This could involve setting up a way to select equipment on click and then deleting the selected object
end
I hope it helps!

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by