slQuery

버전 1.10.0.1 (301 KB) 작성자: Robert Rasche
easy-as-pie API to Simulink
다운로드 수: 53
업데이트 날짜: 2021/8/10

편집자 메모: This file was selected as MATLAB Central Pick of the Week

slQuery - the "easy-as-pie" API to Simulink

slQuery is a "slickness-layer" ontop of the find_system and get/set_param API-functions and various related features of Simulink. It resulted from several inconveniences i had to deal with, while writing scripts that interact with and modify model structures.

slQuery brings you two major tools that make scripted interaction with models very easy and clean.

  1. slQuery is a query language inspired by CSS/jQuery, XPath and regex that allows searching a Simulink model for groups of blocks that satisfy certain conditions and relations to each other.

  2. slQuery wraps arrays of Simulink block handles into lightweight "proxy objects" that can be used to access block parameters and structural features in a syntactically pleasing way.

Have a look: This small example script shows how to interact with a model using slQuery. It acts on the two plain blocks given on the left side and step-by-step transforms them to become the Simulink logo on the right.

But this only the beginning! For a detailed description of what slQuery allows you to do, go to the documentation and reference pages section.

Installation

slQuery is implemented as a crazily compact single class file, that you just put onto the MATLAB search path somewhere. You can download and install the script in your local scripts folder using the following command.

websave(fullfile(uigetdir, '/slQuery.m'), 'https://raw.githubusercontent.com/arinar/slQuery/master/slQuery.m')

This will give you all the slQuery-features.

To also have the documentation and tests available locally, clone this repositiory or download the .zip and then use the pathtool command to add it to the MATLAB search path.

Bugs or Contributions

Report bugs or missing features of slQuery as well as ideas or code via the project page on github.

Or contact me directly via robert with a circle-a then raschhour followed by the dotcom.

slQuery and TargetLink

At my job, I've been working with the dSPACE TargetLink production code generator a lot. slQuery is to a great extent the result of me recognizing and refining best practices and code patterns for an efficient automation of tedious modelling tasks. Scripting is often the only feasible way to handle systematic changes to our code generation basis models. The TargetLink block data API is in my opinion just as not-slick as the Simulink API and so, more expressive means of interacting with this data were needed as well. Therefore TargetLink has a special place in slQuery's heart.

Both the query language and proxy object magic do support access and manipulation of the TargetLink block data. This access is made possible via the special [tl.〈tab〉.〈prop〉=...] parameters in the query and .tl.〈tab〉.〈prop〉 subscript syntax of the wrapper objects.

slQuery's baby sister project ddQuery provides a similar tooling for the TargetLink Data Dictionary, which is oftentimes even more useful in this context.

인용 양식

Robert Rasche (2024). slQuery (https://github.com/arinar/slQuery), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2022b
R2017b에서 R2022b까지의 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Component-Based Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
1.10.0.1

* line-connect features
* setop-support (like union, ..., ismember) on objects
* eval for block parameter evaluation
* positioncenter, positionsize for position calucations
* pure-ascii library link combinators
* model and subsystem reference support

1.10.0

* line-connect features
* setop-support (like union, ..., ismember) on objects
* eval for block parameter evaluation
* positioncenter, positionsize for position calucations
* pure-ascii library link combinators
* model and subsystem reference support

1.9.0

* fix/add combinator "=" support for phyiscal signal routing
* fix `sel`: now excludes current system (only selected blocks inside
gcs)
* support Two Way Conn blocks in "~>" and "=>" combinators
* better indexing subsasgn by reusing subsref code

1.8.0

* explicit text for hyperlink
* more special port chars in combinator portspecs
* `.sel`-method for instantly wrapping selected blocks in current system
* numeric subsref works for any shape result (X.LineHandles.Outport(1) gives all 1st lines)

1.7.0

add colon-operator for retrieving port- and line-handles of blocks
add basic support for Simscape physical connection modelling
add support for TargetLink properties in query-syntax

1.5.0

ability to reference block parameters of previous selectors
more flexible port/line retrieval with colon-operator

1.4.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.