フィルターのクリア

How to trace the matlab callbacks in stateflow GUI events

1 回表示 (過去 30 日間)
jagpreet  makkad
jagpreet makkad 2015 年 4 月 14 日
編集済み: Alexander Wille 2015 年 6 月 16 日
I am trying to trace the matlab callback functions when creating new stateflow objects, creating new transitions, changing name of States etc.But I could find only solution for normal matlab GUI. Using below command I got the graphical handle of stateflow object: >>obj=sfgco; >>HG=findobj(obj); and using this graphical handle I could call DeleteFcn callback function. >>set(HG,'DeleteFcn','myCallback') when am deleting my object myCallback being called.But I have only three callback functions available.They are DeleteFcn,CreateFcn and ButtonDownFcn.How to find all callback functions are being called by Stateflow objects when creating,dragging,changing name?

採用された回答

Vishnu Nair
Vishnu Nair 2015 年 4 月 16 日
Hi Jagpreet... I think you can listen the property change in the stateflow GUI objects like states,transition etc using handle.listener. >>handle.listener(Obj,'prop','PropertyPostSet',@mycallback) I hope this will work....
  1 件のコメント
jagpreet  makkad
jagpreet makkad 2015 年 4 月 16 日
編集済み: jagpreet makkad 2015 年 4 月 16 日
Thanks vishnu....it's working.....but having problem when i am changing the name of a particular state manually it is not being considered as an event but whn i am changing the name using set command, callback function is being called.....why is it so?? Thank you in advance

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

その他の回答 (1 件)

Vishnu Nair
Vishnu Nair 2015 年 4 月 17 日
Hi Jagpreet. I understand your problem.You can change properties by right click properties as well.But for your intention you have to get help from mathwork team or the expert in matlab stateflow gui design.I hope that you will get this answer.
  1 件のコメント
Alexander Wille
Alexander Wille 2015 年 6 月 16 日
編集済み: Alexander Wille 2015 年 6 月 16 日
I have the same problem. In order to trigger a callback when a state or transition is created or deleted, a property to attach the listener to. But that is not possible because there is no "downtrace"-property from the chart to its states.
We may be having two issues here:
  1. Different behavior when properties change between setting them through the Stateflow GUI or API
  2. The lack of a hook for Stateflow object creation and deletion in the Stateflow API.
I will file a support ticket and keep you posted.
Edit: I considered listening to the "Dirty"-property, but obviously it only changes with the first edit to the Stateflow.Chart or its children. With triggering a model save in the callback, this could serve as the basis of a workaround, but at the cost of saving after every little change, which can affect performance very badly.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by