User:Saheb

From ASCEND
Jump to: navigation, search

I am an undergraduate student from Dhirubhai Ambani Institute of Information and Communication Technology(DA-IICT), Gandhinagar, Gujarat, India. I have been working with ASCEND since Jan 2012. Initially I was involved in Student_Projects#GUI_improvements, but now I am totally involved in canvas-based modeller for ASCEND.

Code branch: saheb-canvas: (for work on the canvas)
Code branch: saheb: (for earlier work on default units of measurement)

GSOC Project

Enhancement of Canvas Based Modeller by implementing feature of custom icons for blocks which will help in better creation of flow charts of the models.

GSOC Project Description

Original Description of the project is present here(Student_Projects#Canvas-based_modeller_for_ASCEND_.28more_work_is_possible.29)

Writing very long models has always been cumbersome, so this is something which takes care of the lazy people. Creating models can be very easy after the implementation of canvas-based modeller. You just have to do some steps in order to create a model of your choice.

a) Clicking icons on the icon editor

b) Creating connections between the icons

c) Enforcing few constraints if any on the blocks

d) Explicitly mentioning values of varibles of the blocks.

After completing this steps, your text-based model will be automatically created and can be solved even with the same ASCEND Solvers.

My project deals with creating customizable icons for the canvas using Gaphas module of Python. Right now canvas creates only rectangles blocks, which are unconstrainted at the moment but I will enforce constriants on them soon. By custom blocks we mean, more intutive user-friendly icons which resmeble the original shape of the model. e.g. We want to put pumps in our station, so in order to create a good-resembling flow chart of working of the station we need pump and not rectangles. If I complete my project successfully we will have custom blocks desired by the user.

GSOC Milestones

a) Implementing constraints on present blocks.

Rectangle should remain a rectangle and should not turn into a square, this will help me in understanding how the constraint solver works in Gaphas.

b) Hard-coding few custom blocks.

Means specifying the geometry and constraints on the blocks directly into the python code. This is for confirming that Gaphas works the way we want with custom blocks or not.

c) Storage of custom icons and costraints

Genrealizing the custom blocks for all user-defined icons and find a way to store this geometry and constraints. It is still an open question of how will we store this specifications externally. Maybe we have to create an icon-editor.

GSOC Weekly Report

Community Bonding Period (Before 21st May) >> Discussed the goals of the project with mentor and community in more details, even had a good conversation with Grivan(past developer working on this project) and griped myself with the tools used by ASCEND.

Week 1 (21st May to 27th May)

  • Getting grip on Gaphas, learn rendering images using cairo and hardcoding pump into the canvas.
Error creating thumbnail: File missing
hardcoded pump into canvas without constraints
Error creating thumbnail: File missing
something wrong with the constraints here, but making progress...

By the end of week I am able to draw images quite well using cairo functions, but Gaphas constraints are troubling me as you can see in the screen shots

Week 2 (28th May to 3rd June)

  • Getting grip on applying constraints on blocks using Gaphas, and make the pump behave in a sane way on scaling.
Error creating thumbnail: File missing
improved constraints, still some issues with the circle exceeding the 'bounding' box.
Error creating thumbnail: File missing
improved constraints using equation constraint, only problem is it changes it location on resizing.

I have got some understanding of constraints, have used them for making the pump look better, but still having problems of relocation when I used EquationConstraint

Week 3 (4th June to 10th June)

  • Improve the handling of pump, creating a new CustomIcon and make sure have used all constraints available and try creating some of your own.
Error creating thumbnail: File missing
almost perfect flexible turbine, only fault is minimum size of inlet constraint is not working
Error creating thumbnail: File missing
errors, faults, due to improper constraints in turbine- minimum inlet length is going less than zero
Error creating thumbnail: File missing
rotation in clockwise and anti direction possible, even flips working properly

I coded the turbine, it looks as desired now. Even some constraints work, but minimum inlet size is not working. Rotation and flips is possible for icons now(about the center), but they loose connection with the canvas there-after

Week 4 and 5 (11th June to 25th June)

Addressing the following problems

a) Relocation of blocks using equation constraints.

b) Multiple blocks on the same time on the canvas

c) Saving and Loading of Canvas.

d) Scaling after rotation and flips.

e) Mimimum Size of inlet in Turbine Custom Icon.

f) Adding ports in the custom icons.

Error creating thumbnail: File missing
temporary version of all icons(pumps turbine and default icons) on the canvas simultaneously

The above goals will be completed gradually during my GSOC project. This week was focused on re-planning of Goals, better understanding of project and feedback questions in IIT-b with Kannan and his team. I met Prof. Kannan personally in Mumbai and discussed my current status of work and my future plans of the project. After a good discussion, we planned few Goals to be completed by mid-term evaluation and than decide to redirect the project or continue in the same direction.

Exact Goals to be achieved before Mid-Term Evaluation

  1. Parsing of Intutive Graphical Representation String and store them in list of lists(these lists will be co-ordinates which user will mention for polylines and we will draw icons using them).
  2. Normalizing the user-defined co-ordinates to canvas co-ordinates.
  3. Draw the polylines from the normalized co-ordinates.
  4. Doing the same thing for inlet and outlet ports.
  5. Additional improvements to ports labeling can be done to increase usability.

Week 6 (26th June to 1st July)

Error creating thumbnail: File missing
Intuitive Graphical Icons using simple text strings
Error creating thumbnail: File missing
Resizing Enabled by Generalization of normalization factor
Error creating thumbnail: File missing
Improved Graphical Representation with Dynamic Icon Palette
Error creating thumbnail: File missing
Ports in custom icons by GR mechanism in model files, still loses connections on moving

This week was very fruitful:). Did resolve the issues of minimum-inlet length in turbine and relocation-on-resizing, which were troubling from a long time. Even did the task of Simple Intuitive Graphical Representation of the custom icons by writing simple text in model files. I was able to render these shapes in icon palette making it dynamic now.The above screen shot represents the work done.

Week 7 (2nd July to 8th July)

Complete the remaining one additional improvement of adding label to ports, document the entire code written till mid-term and organize it.

a) Port labels should be referring to port/variable names and not numbers.

b) Multiple Items to be deleted simultaneously.

c) Connections to remain after moving in Graphical Icons with self-defined port location.

d) Port labels to be shown for connect-able ports when connection a connector.

e) Enforcing an aspect ratio on the Graphical Blocks.

f) Block labels to be added for Graphical Blocks.

Error creating thumbnail: File missing
Nice initial prototype of port labels when context hovered
Error creating thumbnail: File missing
Improved Port Labels corresponding to port/variable names
Error creating thumbnail: File missing
Block labels added and hovered changed to focused for port labels

Week 8 (9th July to 15th July)

a) Resolving the bugs left out in previous weeks.

b) Deciding direction for the rest of my GSOC project time which will be decided by discussion with John and Kannan.

c) Goals for the next month till August 13th i.e. till GSOC ends.

Mid Term Evaluation passed successfully:):):)

Week 9 -12 : Post Mid-term Evaluation

Error creating thumbnail: File missing
First Making of Brayton_Regen_Reheat_Intercool
Error creating thumbnail: File missing
Self-generated model of above brayton model
Error creating thumbnail: File missing
Description column added to parameter window, left window is before calling "Set Default Values" and right window is after calling "Set Default Values"
Error creating thumbnail: File missing
Here left parameter window is for pump_simple which shows the fixed state and initial value form model file. Right parameter window is for turbine_simple which shows free state and initial value. Lower text file's highlighted text shows syntax for free state and "turbine" MODEL
Error creating thumbnail: File missing
Ports on perimeter of turbine and pump_simple changed to compressor_simple
Error creating thumbnail: File missing
Regenerator Icon created and important parameters added in parameter window
Error creating thumbnail: File missing
Green when connect-able, red when not connect-able and black as default
Error creating thumbnail: File missing
Generic ports using dictionaries(resolving regenerator issue i.e. inlet--outlet and inlet_hot--outlet_hot) using port names and red color removed
Error creating thumbnail: File missing
All blocks in icon palette are custom icons now

Bug Solving

(1) I recently submitted patch for bug 529. Patch is present in the bug reporter, you can check it from the previous link.

Bug 529 - Deleting multiple rows simultaneously from observer tab was a problem, i.e currently when we used to right click after selecting, it used to deselect the selection. Solution was selection should remain static on right clicking and hence user should be able to delete multiple rows simultaneously.It will be quite useful to delete multiple rows after a Study if some rows have failed to solve.


(2) I am currently working on bug 429.

Bug 429 - If there are no preferred units, what is currently used is base SI dimensions and my task is to display smart intuitive units in place of SI dimensions( i.e. N in place of kg*m/s^2). I will use the units present after the Default value in Default statements for instance in force DEFAULT defvalue{N}, and so will have to store the braced text while parsing through it. So the hierarchy after the feature gets implemented will be:

a) User Defined Units.

b) Preferred Units if present in ascend.ini.

c) Smart Intuitive Default Units.

d) Base Dimensions.

Tasks

- Understanding the working of various layers involved.

- Modify the C Layer code and modify the typedesc struct to get default unit included in it.

- Write a CUnit Code to test the initial modification of C layer code.

- Understand the C++ wrapping and SWIG tool.

- Write C++ functions to get the default unit and then pass it to the PyGTK layer.

- Modify test.py to test the final feature.

I have completed first three tasks and looking forward to quickly solve the bug