User:Saheb
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)
Contents
- 1 GSOC Project
- 2 GSOC Project Description
- 3 GSOC Milestones
- 4 GSOC Weekly Report
- 4.1 Week 1 (21st May to 27th May)
- 4.2 Week 2 (28th May to 3rd June)
- 4.3 Week 3 (4th June to 10th June)
- 4.4 Week 4 and 5 (11th June to 25th June)
- 4.5 Exact Goals to be achieved before Mid-Term Evaluation
- 4.6 Week 6 (26th June to 1st July)
- 4.7 Week 7 (2nd July to 8th July)
- 4.8 Week 8 (9th July to 15th July)
- 4.9 Week 9 -12 : Post Mid-term Evaluation
- 5 Bug Solving
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.
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.
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.
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.
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
-
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). -
Normalizing the user-defined co-ordinates to canvas co-ordinates. -
Draw the polylines from the normalized co-ordinates. -
Doing the same thing for inlet and outlet ports. -
Additional improvements to ports labeling can be done to increase usability.
Week 6 (26th June to 1st July)
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.
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
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