How to design the icon of a Modelica component? - modelica

Is there any software that allows designing the icon of a Modelica component, and then copy into Dymola?
It is hard to draw the picture in Dymola.
A short summary of the answers, there is 4 software support this task:
OMEdit;
MoVE;
InkSpace;
PowerPoint;

Yes, there is MoVE, but it seems development is stopped.

For some tasks OMEdit is better. Properties of graphical elements are nicely presented in a single dialog and you can easily edit the points of lines and polygons.
As an alternative you can use svg and png files, which can be nicely drawn with Inkscape.

Another option for creating icons and info-graphics is to make them in standard packages for drawing, save them in a proper format (e.g., .png) and then use them. This is what I do with my library.
One way I have done it is with powerpoint and wrote a macro that auto-names them: https://github.com/ORNL-Modelica/TRANSFORM-Library/blob/master/TRANSFORM/Resources/Images/Icons.pptm
Next to that is another one for info slides.
Another one worth a go is something like Inkscape (https://inkscape.org/) and then you can run a command line terminal to loop through them all and generate png/jpgs.

The following platform-independent method, i.e. works with arbitrary Modelica simulation environments, is particularly useful for sophisticated icons:
Use LibreOffice Draw for drawing an Icon
For each drawing, produce an image file in one of the desired format according to quality requirements
Include the image file within standard annotation for icons
Here is an example from the library GenKinetics:
An Icon draw in *.gif format: Inhibition Icon
A component employing the Icon: Port_I.mo

Related

Flutter svg animation and manipulation

I have an SVG asset of a map, in which I have to change the color of some cities depending on the results of a network call. On the web, one normally would add a class to each path, give it some CSS, and toggle that class using JavaScript.
How can I achieve the same effect in flutter?
This can be done with the new version of jovial_svg. It supports embedded stylesheets, so you can use CSS exactly as suggested. Of course, you'd need to re-parse the SVG whenever there's a change, but that's not a big deal here.
Alternately, if it's just one set of cities, you could use SVG's currentColor, and set that value in the appropriate ScalableImage factory. But for your use case, CSS seems like the better way to go.
NOTE: At this exact moment, CSS support is in pre-release, but it should be formally released as 1.1.4 within a couple of days. In the meantime, see https://pub.dev/packages/jovial_svg/versions/1.1.4-rc.3

Mapbox Studio: can you change the style after the fact?

Is it possible to change the base style of a custom style after the fact in Mapbox Studio? If yes, how? I looked around the UI and in the documentation but couldn't find how.
Say I created a private style from the Vintage designer style (for example's sake), then added and customized layers by importing tilesets, can I switch to the another base style (e.g. North Star), or do I need to start a new custom style from the start?
Yes. Mapbox Studio is just a GUI for generating Javascript; it outputs a giant JSON file.
(A Mapbox Style is just a JSON object.)
Each of your data layers is included in that JSON (and can be copied and pasted into another style JSON).
Use these instructions to learn the process:
https://mapbox.com/help/transfer-styles-between-accounts
Hope that helps!

Weston : Customize composition to duplicate window display

I want to be able to duplicate a window at the compositor/window manager level.
That is, when the user open a weston-terminal, I want to display it as 2 windows, and be able to apply movement/rotation to those windows.
To emphasize, I don't want to have 2 weston-terminal open, I really need to duplicate the window's content on screen.
Is that possible with weston and where should I look in the code?
I already compiled it and learned to rotate/move windows using weston-shell.c but don't know where to look after.
This isn't possible with the Weston implementation, in the manner you've described. You'd have to hack your own Weston implementation to do this, such that one client can bind to multiple surfaces.
An alternative to consider is to have a surface and subsurface, and have you client render to both the main surface and the subsurface.

How to obtain larger output window in MATLAB?

I have made a gui in MATLAB wherein I need the window to be fullscreen directly after I run the application. However, this does not happen so, and instead, a smaller window is generated, and as a result, the TABs that I have designed, look out of shape...
http://i42.tinypic.com/iogjfo.jpg
Suggest options as to what could be done in the code to get it to fullscreen like this:
http://i41.tinypic.com/2ufvpf6.jpg
Mathworks has provided some function for doing this: http://www.mathworks.co.uk/support/solutions/en/data/1-3MY8PN/index.html?solution=1-3MY8PN
You can resize the window to make it the size of the screen (though the window will not be "maximized"), without having to download extra files: http://www.mathworks.co.uk/support/solutions/en/data/1-4TEZ9X/index.html?product=SL&solution=1-4TEZ9X
There are lots of matlab examples online, so searching is highly recommended.

Creating GTK Widget Using Expander

I am trying to create GTK Widget like shows in following Images
Is it possible to create it in GTK+ under C,
I tried using GtkExpander but it is not working out ...
Can any one Help....
Stripping the arrow is quite trivial. Just append the following code to you $HOME/.gtkrc-2.0 (or create it if not found):
style "pradeep" {
GtkExpander::expander-size = 0
GtkExpander::expander-spacing = 0
}
widget "*.GtkExpander" style "pradeep"
This is done by customizing the appearance using resource files. You can get the same result programmatically by changing the GtkExpander style properties.
Furthermore, you can connect your own callback to its "activate" signal and switch the background color of the widget whenever is active or not. And a lot more...
Just remember someone loves to have a consistent user interface.
If what you want is to duplicate the look, then there are two very inefficient solutions to the problem:
Write your own GTK theme engine (see Murrine or Clearlooks).
Replace your entire program by a GtkDrawingArea widget and use Cairo to draw exactly the look you want. You'll be on your own then, though, so you'll have to write all your widget placement algorithms, buttons, expanders, menus, and whatnot, from scratch.
GTK isn't really meant for this sort of thing. The whole point of GTK is that you design your user interface with the standard widgets, and they just work with whatever theme, language, or accessibility technologies your users need to use. If you design your own look and there's no way to change it, then someone with color blindness or poor eyesight won't be able to use it. Or the text will get all misaligned if someone uses your application in another language. Or at the very least, maybe someone just likes a black desktop with white lettering, and your application will stick out and look really ugly on that user's computer. If you really need to make it look exactly that way, then probably GTK isn't the right tool for you.