Prev: COM interfacing
Next: Hide wait bar
From: Sebastian Pliefke on 11 Nov 2009 04:13 Hi there In the last days I developed a lot of customized simulink blocks in C to build up an environment for an image processing application in simulink. Thereby I reached several points which limit myself in develop a better HMI for my blocks. Maybe this forum can point to further information of develop customized blocks or can answer my question I wrote below. 1. Is it possible to change the label of the in- or outport at runtime? Sometimes I would like to change the number of in- or outport according to parameter settings. Every time if I change the number of port later on all textual label I insert in the mask dialog doesn't fit anymore. I think I need a function available under c to change the labels of port at runtime. 2. The same question as above I've for the parameter stuff. I developed a block which has a combo box to set up the behaviour of the block. I would like to change the entries of this particular combo box at runtime. Currently I entered all entries in the mask dialog offline. Thx4Help Sebi
From: Ralph Schleicher on 15 Nov 2009 08:25 "Sebastian Pliefke" <sebastian.pliefke(a)magnaelectronics.eu> writes: > 1. Is it possible to change the label of the in- or outport at > runtime? Yes. > Sometimes I would like to change the number of in- or > outport according to parameter settings. set_param(h, 'MaskSelfModifiable', 'on') > Every time if I change the > number of port later on all textual label I insert in the mask dialog > doesn't fit anymore. I think I need a function available under c to > change the labels of port at runtime. You want to do that in Matlab inside of the mask dialog box. > 2. The same question as above I've for the parameter stuff. I > developed a block which has a combo box to set up the behaviour of the > block. Combo box means popup menu in Matlab jargon, right? > I would like to change the entries of this particular combo box > at runtime. Currently I entered all entries in the mask dialog > offline. A popup menu offers a choice. So why do you want to change the choice? You should rethink your user interface. -- Ralph
From: Sebastian Pliefke on 16 Nov 2009 03:30 Hi Ralph Thx for your responce. > > I would like to change the entries of this particular combo box > > at runtime. Currently I entered all entries in the mask dialog > > offline. > > A popup menu offers a choice. So why do you want to change the > choice? You should rethink your user interface. I know it's an uncommon use of the matlab block but I've a serious argument to change the combo entries later on. My Matlab block makes a connection between Matlab and a database where I store several timelines with application data. The number and names of these timelines will varies over the time of the project. The combo element should be the main selection point of which timeline is under investigation. To avoid a rebuilt of the block by every change of the timeline definition I tried to configure the block by themselves using the database. Does anyone know if there is an access point to the combo entries or I waste my time with it? Sebi
From: Ralph Schleicher on 16 Nov 2009 15:33 "Sebastian Pliefke" <sebastian.pliefke(a)magnaelectronics.eu> writes: > I know it's an uncommon use of the matlab block but I've a serious > argument to change the combo entries later on. My Matlab block makes > a connection between Matlab and a database where I store several > timelines with application data. The number and names of these > timelines will varies over the time of the project. The combo element > should be the main selection point of which timeline is under > investigation. To avoid a rebuilt of the block by every change of the > timeline definition I tried to configure the block by themselves using > the database. I see. That makes sense for a small number of timelines. > Does anyone know if there is an access point to the combo entries or I > waste my time with it? If 'i' is the index of the timeline parameter, something like style = get_param(h, 'MaskStyles'); style{i} = 'popup(A|B|C|D|E|F)'; set_param(h, 'MaskStyles', style); should do it. I suppose 'MaskSelfModifiable' has to be 'on', too. -- Ralph Schleicher <http://ralph-schleicher.de> Development * Consulting * Training Mathematical Modeling and Simulation Software Tools
|
Pages: 1 Prev: COM interfacing Next: Hide wait bar |