'outdated' property of slmetric.metric.ResultCollection not showing true even though model is changed
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I want to execute the model metric programmatically only if there is change in the model. I am using 'outdated' property of slmetric.metric.ResultCollection to read the information.As per documentation ,outdated property of slmetric.metric.ResultCollection returns true if there is a model change. But its not happening.
I am follwing the below sequence of operation.
- metric_engine = slmetric.Engine();
- setAnalysisRoot(metric_engine,'Root',<model_name>,'RootType', 'Model');
- execute(metric_engine)
2)did some modification in the model manullly(removed some blocks)
3)res_col = getMetrics(metric_engine, 'mathworks.metrics.SimulinkBlockCount');
my expectation is res_col.Outdated should return true as there are model changes after the metrics execution.But its returining false always
Please let me know how to execute the model metric programmatically only if there is change in the mode?
0 Commenti
Risposte (1)
Aneela
il 10 Ott 2024
Hi Abina Ansary,
You should call “execute” after any changes to a metric to ensure that the status of “outdated” property is updated for previously collected metrics.
Refer to the below example:
metric_engine = slmetric.Engine();
setAnalysisRoot(metric_engine,'Root','MySimpleModel','RootType', 'Model');
execute(metric_engine, 'mathworks.metrics.SimulinkBlockCount')
res_col = getMetrics(metric_engine, 'mathworks.metrics.SimulinkBlockCount');
res_col.Outdated ;
% modify the model and save
execute(metric_engine, 'mathworks.metrics.FileCount');
%get block count results and see Outdated == true
res_col = getMetrics(metric_engine, 'mathworks.metrics.SimulinkBlockCount');
res_col.Outdated ;
0 Commenti
Vedere anche
Categorie
Scopri di più su Model Metrics in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!