yoelk / instrumentino

Instrumentino is an open-source modular graphical user interface framework for controlling Arduino based experimental instruments
GNU General Public License v3.0
137 stars 59 forks source link

Discussion: v2 and kivy #10

Closed ghost closed 8 years ago

ghost commented 9 years ago

I skimmed over the kivy book, spent some time working with splitters and the issues posted in Issue #8 , and skimmed over the kivy "garden" (https://github.com/kivy-garden), etc. to get an idea what kivy currently offers in terms of widgets. I'm wondering if a direct v1 -> v2 UI model will actually be harder (i.e. more code) in kivy than making some design changes to make it more "kivy friendly" (less code).

I'm not sure how you'd feel about this but I am curious if you'll come to the same conclusion. It's just something to think about :)

Basically: Kivy is relatively new and is "mobile/touch friendly" so maybe making changes to the v2 UI layout to make it more "single screen friendly" will result in less work to port it over.

Specifically: After seeing how using using dual splitters works to generate the "three areas on a screen" (both the default splitter behaviours and your splitter code in Issue #8 ) in order to make the 3 areas fully resizeable, I'm wondering if the 3 panel screen layout should be simplified to remove the splitters altogether (or maybe just have a dual panel screen with 1 splitter, or use 2 layouts, etc.) as they seem more suited to just split something into 2 areas and not 3. This may ultimately make building and extending the UI "easier".

Given all the above: I'm wondering how much of the current information is actually necessary to have "on screen" at all times. The only thoughts I have at the current moment are:

At minimum make each v1 panel (The Components, The Methods/Sequences, The Commands/Signals) its own independent "full screen" view, then have a common way of switching between views. The benefits of this:

  1. Make it easier to see all the data in a view (especially for the chart).
  2. Make each panel able to contain more data than having to scroll/resize.
  3. Make the user interaction easier (items can be larger and easier to manipulate/select)
  4. It may make it easier to add more views later since everything (design and code) would be based on swapping between single views. "Multi view" could then be added as another "single view" option for personalized combinations of the standard single views for those who want them or have really large screens.
  5. Widget sizes, layout, and behaviour could likely be left "the defaults" and not have to be hand coded. The only time you would have to deal with setting widget size and layout would be when trying to fit >1 view on a screen (like with splitter or just 2 side by side layouts ) as the single view would not initially be special-coded for this. However, odds are most views will comfortably fit in 1/2 a screen (they do today, even the chart) with the default kivy layout/packing so putting 2 views in a screen would probably require little or no additional hand configuring. The kivy widget layout file(s) may be greatly simplified as special widget positioning/handling could be less of a concern, and it may "read better" as each view could be it's own independent high level "section" from the others.

If this were done, I could see this occurring:

The problem with this (I believe) is that there is some information on other views you want to see in the primary view or at all times. So maybe make that other view on top/bottom/side (via Splitter?). It would contain important summary data in other views like the "Method/Sequence" panel and the "Command/Signal" panel. Imagine something that just indicates what method + sequence is currently running, maybe what's going to run next, remaining run time, last 5 commands/responses from Arduino, etc. I still think everything ultimately would benefit from being "independent" single screen views, so this "summary" would be it's own single view (not part of the primary) and the combination of it and the primary would be defined and not 'special' from a layout/access/programming sense. Essentially the combination of these two single views would be "the built in example" of how to make a single view contain multiple views.

Also: I personally like the ideas of having "master controls" like the Stop button available at all times, so maybe that would go in the top menu as well so you wouldn't have to switch to the "primary" view to get to it if you happened to be messing around in another view.

Also: Making the views available/selectable could be done in the "cleanest" or "easiest" way possible as kivy permits so they could be implemented as tabs, menu items, models, etc.. Whatever is the easiest to code against. The same goes for building multi-views.

Well, I wrote a lot so I'll leave it at this for now and see if there's any interest in pursuing the v2 UI in this manner.

yoelk commented 9 years ago

Hi, I'm so happy I finally have someone to discuss such issues with :) I also had similar thoughts of how to arrange the data on screen. changing screens? 1 or two splitters? I still don't know what would be best. In the meanwhile, I finally figured out how to use the 2 splitters in a reliable way. Someone gave me a hint on my stackoverflow question. you can see the discussion here https://groups.google.com/forum/#!topic/kivy-users/PFBtWjFxmCs.

You wrote a lot, and I kind of lost you there. Do you think you could sketch a small mockup of how you think the GUI should look like? I read in the book that pencil http://pencil.evolus.vn/ should be a handy tool for doing that, so you could use that, or anything else.

Here's another suggestion (let's start marking them): _GUIidea1: The most generic approach would be to let the user decide to how many parts should the screen be divided to, and then what view should be in each of the screens If we choose to split the screen area, I think we have to use splitters or something else like accordions or pagelayouts, but I think the splitters are better.

I'll send you the finished multisplitter code when it works

On Fri, Apr 3, 2015 at 9:51 PM, Snarfums notifications@github.com wrote:

I skimmed over the kivy book, spent some time working with splitters and the issues posted in Issue #8 https://github.com/yoelk/Instrumentino/issues/8 , and skimmed over the kivy "garden" (https://github.com/kivy-garden), etc. to get an idea what kivy currently offers in terms of widgets. I'm wondering if a direct v1 -> v2 UI model will actually be harder (i.e. more code) in kivy than making some design changes to make it more "kivy friendly" (less code).

I'm not sure how you'd feel about this but I am curious if you'll come to the same conclusion. It's just something to think about :)

Basically: Kivy is relatively new and is "mobile/touch friendly" so maybe making changes to the v2 UI layout to make it more "single screen friendly" will result in less work to port it over.

Specifically: After seeing how using using dual splitters works to generate the "three areas on a screen" (both the default splitter behaviours and your splitter code in Issue #8 https://github.com/yoelk/Instrumentino/issues/8 ) in order to make the 3 areas fully resizeable, I'm wondering if the 3 panel screen layout should be simplified to remove the splitters altogether (or maybe just have a dual panel screen with 1 splitter, or use 2 layouts, etc.) as they seem more suited to just split something into 2 areas and not 3. This may ultimately make building and extending the UI "easier".

Given all the above: I'm wondering how much of the current information is actually necessary to have "on screen" at all times. The only thoughts I have at the current moment are:

At minimum make each v1 panel (The Components, The Methods/Sequences, The Commands/Signals) its own independent "full screen" view, then have a common way of switching between views. The benefits of this:

  1. Make it easier to see all the data in a view (especially for the chart).
  2. Make each panel able to contain more data than having to scroll/resize.
  3. Make the user interaction easier (items can be larger and easier to manipulate/select)
  4. It may make it easier to add more views later since everything (design and code) would be based on swapping between single views. "Multi view" could then be added as another "single view" option for personalized combinations of the standard single views for those who want them or have really large screens.
  5. Widget sizes, layout, and behaviour could likely be left "the defaults" and not have to be hand coded. The only time you would have to deal with setting widget size and layout would be when trying to fit >1 view on a screen (like with splitter or just 2 side by side layouts ) as the single view would not initially be special-coded for this. However, odds are most views will comfortably fit in 1/2 a screen (they do today, even the chart) with the default kivy layout/packing so putting 2 views in a screen would probably require little or no additional hand configuring. The kivy widget layout file(s) may be greatly simplified as special widget positioning/handling could be less of a concern, and it may "read better" as each view could be it's own independent high level "section" from the others.

If this were done, I could see this occurring:

  • The "primary" view screen (the one normally active/loaded first) would be things a user would likely use to actively monitor and manually control. Things like the items in the Components view like the "Stop" button or the ability to manually set things to a value. Today this would literally be the Components panel.
  • A permanent menu (just like it is in v1, on top)
  • All other views would be selectable from each other.

The problem with this (I believe) is that there is some information on other views you want to see in the primary view or at all times. So maybe make that other view on top/bottom/side (via Splitter?). It would contain important summary data in other views like the "Method/Sequence" panel and the "Command/Signal" panel. Imagine something that just indicates what method + sequence is currently running, maybe what's going to run next, remaining run time, last 5 commands/responses from Arduino, etc. I still think everything ultimately would benefit from being "independent" single screen views, so this "summary" would be it's own single view (not part of the primary) and the combination of it and the primary would be defined and not 'special' from a layout/access/programming sense. Essentially the combination of these two single views would be "the built in example" of how to make a single view contain multiple views.

Also: I personally like the ideas of having "master controls" like the Stop button available at all times, so maybe that would go in the top menu as well so you wouldn't have to switch to the "primary" view to get to it if you happened to be messing around in another view.

Also: Making the views available/selectable could be done in the "cleanest" or "easiest" way possible as kivy permits so they could be implemented as tabs, menu items, models, etc.. Whatever is the easiest to code against. The same goes for building multi-views.

Well, I wrote a lot so I'll leave it at this for now and see if there's any interest in pursuing the v2 UI in this manner.

— Reply to this email directly or view it on GitHub https://github.com/yoelk/Instrumentino/issues/10.

ghost commented 9 years ago

I checked out pencil, but I decided to try using kivy to build the mock ups (might as well learn some more!). I made a Git repository to hold "runnable" kivy example layouts so it will be easier to explain/share/etc. and maybe someone else will find some value too: https://github.com/snarfums/kivy-layout-examples

There are 3 examples I came up with to try to explain what I was talking about above.

All examples attempt to illustrate the ideas of:

  1. Reducing the amount of information on the screen at one time in order to maximize the usability/visibility of the data that is on screen.
  2. Fitting everything on 1 "standard" screen (having some things that are constant and no one would normally want to re-configure) but allowing some easy user configuration (or future expansion) if necessary
  3. Having all the original areas "there" for (hopefully) easier porting to v2 I also didn't mention this, but it is probably important: Since v1 has everything "on screen" and constantly updating/live ( e.g. the data in the chart is always updating and current while the other areas are also updating), I'm betting that porting it over to kivy will be "easier" if all the same data areas are always "live". What I mean by this is: The chart, method widgets have to be created once and always exist "somewhere" but should be hidden from view. If the widget that holds the chart was deleted (removed from view) or disabled then it would no longer hold current data and once it was made active again. To make deleting/disabling widgets contain the last known data + current data would probably require all sorts of additional coding.

In addition, you're dynamically creating widgets (like when methods are added/removed) and if the widget area containing this information was removed (instead of hidden) you would have to do extra work to save the state and rebuild it

"Hiding" kivy widgets appears to be limited to a feature of the layouts (tabs, accordion, splitter, etc.) and the ScreenManager. Using "disable" just makes widgets "grey", and I'm not yet sure how you'd remove widget(s) and store it's state/contents for later use.

So: _GUIidea2: To get around these problems I suggest using the "ScreenManager" widget to contain all the screens of data and then some standard way to just manipulate the screens. Inside those screens could contain whatever layouts are appropriate/desired (splitter/accordion/tabs/etc.).

Note: The internal Python code is going to probably have to reference it a (the ScreenManager) and then the screen by name to manage data, but that may be desired if each panel/screen is an individually referenced "entity" and not a combination of entities to get to the data (e.g. you want to add/update data so you just point to ScreenManager -> "Methods screen" -> widget 2 instead of "main widget -> abc widget. -> ?some tab widget? -> widget 2). This basically means that you would actually have a separate "Methods" screen and a "Sequences" screen and then use kvlang to add the tabbed layout (if you wished, or maybe accordian?) and not combine them as the default.

I haven't looked at the v1 code at all to see how it's done today though so maybe all of this is a moot point.

Anyway, the examples are: ScreenManager1 example: This is the idea of having a "statistics" or summary area available somewhere. Screen visibility control is on the bottom. Visible screen is made as large as possible.

ScreenManager2 example: Having no "statistics" area (dropping the idea as it would be something new and not a direct port of existing functionality) and moving the screen controls to the right side. If the stats idea is desired you could also just add any stats (or whatever, maybe "pause/resume" buttons, etc.) to this area as well below the controls, but formatting/fattening of the area would probably need to be done

ScreenManager3 example: The same as example ScreenManager2, but showing how the "standard/core" screens could be custom built to use Splitters/accordions/etc. for user configuration of special screens. The .kv file has been built a little different using rules (but probably what would be more "real world" usage) to accommodate this.

Note: I tend to be a bit wordy just do a brain dump on this type of stuff and do a single quick read though so please forgive spelling/grammatical errors/incomplete thoughts! :)

yoelk commented 9 years ago

Hi! :) Sorry for not responding sooner. Easter has been very busy. Lot's of visitors in our house. I still couldn't even find time to look at the mockups, but I'm very curious. I hope I can get to it tomorrow.

Joel

On Sun, Apr 5, 2015 at 7:58 PM, Snarfums notifications@github.com wrote:

I checked out pencil, but I decided to try using kivy to build the mock ups (might as well learn some more!). I made a Git repository to hold "runnable" kivy example layouts so it will be easier to explain/share/etc. and maybe someone else will find some value too: https://github.com/snarfums/kivy-layout-examples

There are 3 examples I came up with to try to explain what I was talking about above.

All examples attempt to illustrate the ideas of:

  1. Reducing the amount of information on the screen at one time in order to maximize the usability/visibility of the data that is on screen.
  2. Fitting everything on 1 "standard" screen (having some things that are constant and no one would normally want to re-configure) but allowing some easy user configuration (or future expansion) if necessary
  3. Having all the original areas "there" for (hopefully) easier porting to v2 I also didn't mention this, but it is probably important: Since v1 has everything "on screen" and constantly updating/live ( e.g. the data in the chart is always updating and current while the other areas are also updating), I'm betting that porting it over to kivy will be "easier" if all the same data areas are always "live". What I mean by this is: The chart, method widgets have to be created once and always exist "somewhere" but should be hidden from view. If the widget that holds the chart was deleted (removed from view) or disabled then it would no longer hold current data and once it was made active again. To make deleting/disabling widgets contain the last known data + current data would probably require all sorts of additional coding.

In addition, you're dynamically creating widgets (like when methods are added/removed) and if the widget area containing this information was removed (instead of hidden) you would have to do extra work to save the state and rebuild it

"Hiding" kivy widgets appears to be limited to a feature of the layouts (tabs, accordion, splitter, etc.) and the ScreenManager. Using "disable" just makes widgets "grey", and I'm not yet sure how you'd remove widget(s) and store it's state/contents for later use.

So: To get around these problems I suggest using the "ScreenManager" widget to contain all the screens of data and then some standard way to just manipulate the screens. Inside those screens could contain whatever layouts are appropriate/desired (splitter/accordion/tabs/etc.). The internal Python code is going to probably have to reference it and then the screen by name to manage data, but that may be desired if each panel/screen is an individually referenced "entity" and not a combination. I haven't looked at the v1 code to see how it's done though so maybe all of this is a moot point.

Anyway, the examples are: ScreenManager1: This is the idea of having a "statistics" or summary area available somewhere. Screen visibility control is on the bottom. Visible screen is made as large as possible.

ScreenManager2: Having no "statistics" area (dropping the idea as it would be something new and not a direct port of existing functionality) and moving the screen controls to the right side. If the stats idea is desired you could also just add any stats (or whatever, maybe "pause/resume" buttons, etc.) to this area as well below the controls, but formatting/fattening of the area would probably need to be done

ScreenManager3: The same as example #2 https://github.com/yoelk/Instrumentino/issues/2, but showing how the "standard/core" screens could be custom built to use Splitters/accordions/etc. for user configuration of special screens. The .kv file has been built a little different using rules (but probably what would be more "real world" usage) to accommodate this.

Note: I tend to be a bit wordy just do a brain dump on this type of stuff and do a single quick read though so please forgive spelling/grammatical errors/incomplete thoughts! :)

— Reply to this email directly or view it on GitHub https://github.com/yoelk/Instrumentino/issues/10#issuecomment-89821396.

yoelk commented 9 years ago

Hi again, Eventually yesterday night I looked at the mockups, and was very happy to see your ideas. I think you're a much more experienced GUI programmer than me :), it would have taken me much time to do that.

It made me think, and come up with the following idea, please tell me what you think. I think it's quite clear from the attached mockup (done in Pencil), but here is a textual description: There are 4 different screens to present as I see it:

I guess it doesn't make much sense to divide a Desktop screen to more than 3 parts, so I suggest that we support:

The user can decide which screens he wants to see and how many by checking checkboxes in the View menu.

The view menu can be a small button near the stop button and an activity feed line. For devices that have small screens, we can use the same menu to show "File", "Comm" etc.

Big screen devices can have the natural menus on the top, though I don't know if Kivy lets you create them. Maybe we'd need to make our own menubar, on the top or bottom. Maybe even add an auto-hide option.

What do you think?

On Tue, Apr 7, 2015 at 11:48 PM, Yoel Koenka yoel.koenka@gmail.com wrote:

Hi! :) Sorry for not responding sooner. Easter has been very busy. Lot's of visitors in our house. I still couldn't even find time to look at the mockups, but I'm very curious. I hope I can get to it tomorrow.

Joel

On Sun, Apr 5, 2015 at 7:58 PM, Snarfums notifications@github.com wrote:

I checked out pencil, but I decided to try using kivy to build the mock ups (might as well learn some more!). I made a Git repository to hold "runnable" kivy example layouts so it will be easier to explain/share/etc. and maybe someone else will find some value too: https://github.com/snarfums/kivy-layout-examples

There are 3 examples I came up with to try to explain what I was talking about above.

All examples attempt to illustrate the ideas of:

  1. Reducing the amount of information on the screen at one time in order to maximize the usability/visibility of the data that is on screen.
  2. Fitting everything on 1 "standard" screen (having some things that are constant and no one would normally want to re-configure) but allowing some easy user configuration (or future expansion) if necessary
  3. Having all the original areas "there" for (hopefully) easier porting to v2 I also didn't mention this, but it is probably important: Since v1 has everything "on screen" and constantly updating/live ( e.g. the data in the chart is always updating and current while the other areas are also updating), I'm betting that porting it over to kivy will be "easier" if all the same data areas are always "live". What I mean by this is: The chart, method widgets have to be created once and always exist "somewhere" but should be hidden from view. If the widget that holds the chart was deleted (removed from view) or disabled then it would no longer hold current data and once it was made active again. To make deleting/disabling widgets contain the last known data + current data would probably require all sorts of additional coding.

In addition, you're dynamically creating widgets (like when methods are added/removed) and if the widget area containing this information was removed (instead of hidden) you would have to do extra work to save the state and rebuild it

"Hiding" kivy widgets appears to be limited to a feature of the layouts (tabs, accordion, splitter, etc.) and the ScreenManager. Using "disable" just makes widgets "grey", and I'm not yet sure how you'd remove widget(s) and store it's state/contents for later use.

So: To get around these problems I suggest using the "ScreenManager" widget to contain all the screens of data and then some standard way to just manipulate the screens. Inside those screens could contain whatever layouts are appropriate/desired (splitter/accordion/tabs/etc.). The internal Python code is going to probably have to reference it and then the screen by name to manage data, but that may be desired if each panel/screen is an individually referenced "entity" and not a combination. I haven't looked at the v1 code to see how it's done though so maybe all of this is a moot point.

Anyway, the examples are: ScreenManager1: This is the idea of having a "statistics" or summary area available somewhere. Screen visibility control is on the bottom. Visible screen is made as large as possible.

ScreenManager2: Having no "statistics" area (dropping the idea as it would be something new and not a direct port of existing functionality) and moving the screen controls to the right side. If the stats idea is desired you could also just add any stats (or whatever, maybe "pause/resume" buttons, etc.) to this area as well below the controls, but formatting/fattening of the area would probably need to be done

ScreenManager3: The same as example #2 https://github.com/yoelk/Instrumentino/issues/2, but showing how the "standard/core" screens could be custom built to use Splitters/accordions/etc. for user configuration of special screens. The .kv file has been built a little different using rules (but probably what would be more "real world" usage) to accommodate this.

Note: I tend to be a bit wordy just do a brain dump on this type of stuff and do a single quick read though so please forgive spelling/grammatical errors/incomplete thoughts! :)

— Reply to this email directly or view it on GitHub https://github.com/yoelk/Instrumentino/issues/10#issuecomment-89821396.

ghost commented 9 years ago

Thanks :) I've done some GUI stuff like this in the past (widgets, layout, widget packing, etc.) in perl+Tk and it's somewhat similar. I've also done a little bit of Android development and it's also kinda similar (layouts and widgets via nesting in separate layout files) so I figured I'd give it a shot and see how it went. What's killing me the most so far is the strict enforcement of "properly" indenting the code. I'm used to "2 spaces" not 4 (or none at all when I'm in a hurry :). It's taking some getting used to.

I don't see an attachment (or know how to get to it). Did it post?

Having the user decide what layout to choose (at the click of a button or selector) may be tricky, and I can think of 1 way to do it knowing what I know about kivy today. I'll see if I can find a better or "more proper" way do it. I read some new things that kivy 1.9 can (will be able to?) do around loading widgets/layouts from separate files that might make this type of idea easier but it may have only been something you can only do once at startup. There also may be a "better" way simply because how kivy auto-rearranges the widgets based on available screen size.

Long story short: Sounds cool. I'll look into how this may be done and see if I can get some examples up and running.

I'm not sure about the menu being a built-in feature today. I haven't been able to find one yet. I'm betting it's not there since kivy is very "mobile friendly" and top menus aren't normal for mobile devices. There is a "Settings" panel with some pre-configured things and you can add settings to: http://kivy.org/docs/api-kivy.app.html?highlight=menu (see: "Create a settings panel") but it's not something you'd want to switch back and forth to very often for common things. Having to make one "appear" or on top/bottom is probably the way to go. How about this: Assuming a Stop button is going to be "always visible/available" means it's going to take up a little square of screen space in the main window. Might as well extend that little chunk of space from side-to-side or top-to-bottom and then use that space for a few other other buttons. Maybe one of those buttons is "Menu" button which then makes the menu visible. On the menu you can put a "Settings" button for things accessed less often and things like "File", "Comm" or whatever is more often.

Long story short: Also sounds good. I'll also look into getting a menu-esque thing working.

Question: Do you want to stay within the "core" kivy built-in features or is loading external packages ok? There's a "kivy garden" (https://github.com/kivy-garden) of what appears to be user-generated kivy widgets/features. I'm not sure how you feel about using any of them (as this would be non-core dependencies, more painful install and maintenance, could be buggy) but there are some things which may be useful for the "menu problem": https://github.com/kivy-garden/garden.navigationdrawer https://github.com/kivy-garden/garden.modernmenu

Also: There's also a "graph" and a "File Browser" which may be cleaner/easier? than using the built-ins: https://github.com/kivy-garden/garden.graph https://github.com/kivy-garden/garden.filebrowser

yoelk commented 9 years ago

Hi, I did send a two files, I guess GitHub doesn't support attachments. Can you send me your direct email? Mine is yoel.koenka@gmail.com I tried committing to the new GitHub repository you've created, but I think I don't have commit permissions.

But without looking at it, you hit the target with the menu buttons. It's exactly what I was thinking about.

Regarding layout changes: The way I thought of doing it is to create all windows at startup, and add one of them to the screen, keeping the rest invisible (keeping them in an inaccessible screen manager screen). When the user changes the viewing mode, simply change the views' parent properties accordingly and create the new layout. Something like: hide everyone, recreate the visible layout and show the ones we want to show. Do you think it's possible?

Regarding external dependencies: Ease of setting up is a major issue with the current Instrumentino version (installing the dependencies etc.) and in generally in Python. As the most important aspect about Instrumentino should be ease of use, I'd really like to solve this nicely. What I thought of is going the Kivy way. You know how they pre-package Python+Kivy+anything_else_they_need in a single zip/dmg file, to work out of the box? This is also what I'd like to do. To package Instrumentino and anything else it needs (kivy, pySerial, twisted, numpy, etc.) and let users download the package and simply run: $ instrumentino my_system_file or something like that. Obviously, some users will require extra packages that we haven't thought of, so either they'll have to install everything the hard way, or maybe we can find a way to make it work. Don't know yet... What do you think?

On Thu, Apr 9, 2015 at 6:06 AM, Snarfums notifications@github.com wrote:

Thanks :) I've done some GUI stuff like this in the past (widgets, layout, widget packing, etc.) in perl+Tk and it's somewhat similar. I've also done a little bit of Android development and it's also kinda similar (layouts and widgets via nesting in separate layout files) so I figured I'd give it a shot and see how it went. What's killing me the most so far is the strict enforcement of "properly" indenting the code. I'm used to "2 spaces" not 4 (or none at all when I'm in a hurry :). It's taking some getting used to.

I don't see an attachment (or know how to get to it). Did it post?

Having the user decide what layout to choose (at the click of a button or selector) may be tricky, and I can think of 1 way to do it knowing what I know about kivy today. I'll see if I can find a better or "more proper" way do it. I read some new things that kivy 1.9 can (will be able to?) do around loading widgets/layouts from separate files that might make this type of idea easier but it may have only been something you can only do once at startup. There also may be a "better" way simply because how kivy auto-rearranges the widgets based on available screen size.

Long story short: Sounds cool. I'll look into how this may be done and see if I can get some examples up and running.

I'm not sure about the menu being a built-in feature today. I haven't been able to find one yet. I'm betting it's not there since kivy is very "mobile friendly" and top menus aren't normal for mobile devices. There is a "Settings" panel with some pre-configured things and you can add settings to: http://kivy.org/docs/api-kivy.app.html?highlight=menu (see: "Create a settings panel") but it's not something you'd want to switch back and forth to very often for common things. Having to make one "appear" or on top/bottom is probably the way to go. How about this: Assuming a Stop button is going to be "always visible/available" means it's going to take up a little square of screen space in the main window. Might as well extend that little chunk of space from side-to-side or top-to-bottom and then use that space for a few other other buttons. Maybe one of those buttons is "Menu" button which then makes the menu vis ible. On the menu you can put a "Settings" button for things accessed less often and things like "File", "Comm" or whatever is more often.

Long story short: Also sounds good. I'll also look into getting a menu-esque thing working.

Question: Do you want to stay within the "core" kivy built-in features or is loading external packages ok? There's a "kivy garden" ( https://github.com/kivy-garden) of what appears to be user-generated kivy widgets/features. I'm not sure how you feel about using any of them (as this would be non-core dependencies, more painful install and maintenance, could be buggy) but there are some things which may be useful for the "menu problem": https://github.com/kivy-garden/garden.navigationdrawer https://github.com/kivy-garden/garden.modernmenu

Also: There's also a "graph" and a "File Browser" which may be cleaner/easier? than using the built-ins: https://github.com/kivy-garden/garden.graph https://github.com/kivy-garden/garden.filebrowser

— Reply to this email directly or view it on GitHub https://github.com/yoelk/Instrumentino/issues/10#issuecomment-91110155.

yoelk commented 9 years ago

Oh, and yes, KivyGarden has some nice stuff in it. I'll be happy to use it if we can package things properly.

On Thu, Apr 9, 2015 at 10:09 AM, Yoel Koenka yoel.koenka@gmail.com wrote:

Hi, I did send a two files, I guess GitHub doesn't support attachments. Can you send me your direct email? Mine is yoel.koenka@gmail.com I tried committing to the new GitHub repository you've created, but I think I don't have commit permissions.

But without looking at it, you hit the target with the menu buttons. It's exactly what I was thinking about.

Regarding layout changes: The way I thought of doing it is to create all windows at startup, and add one of them to the screen, keeping the rest invisible (keeping them in an inaccessible screen manager screen). When the user changes the viewing mode, simply change the views' parent properties accordingly and create the new layout. Something like: hide everyone, recreate the visible layout and show the ones we want to show. Do you think it's possible?

Regarding external dependencies: Ease of setting up is a major issue with the current Instrumentino version (installing the dependencies etc.) and in generally in Python. As the most important aspect about Instrumentino should be ease of use, I'd really like to solve this nicely. What I thought of is going the Kivy way. You know how they pre-package Python+Kivy+anything_else_they_need in a single zip/dmg file, to work out of the box? This is also what I'd like to do. To package Instrumentino and anything else it needs (kivy, pySerial, twisted, numpy, etc.) and let users download the package and simply run: $ instrumentino my_system_file or something like that. Obviously, some users will require extra packages that we haven't thought of, so either they'll have to install everything the hard way, or maybe we can find a way to make it work. Don't know yet... What do you think?

On Thu, Apr 9, 2015 at 6:06 AM, Snarfums notifications@github.com wrote:

Thanks :) I've done some GUI stuff like this in the past (widgets, layout, widget packing, etc.) in perl+Tk and it's somewhat similar. I've also done a little bit of Android development and it's also kinda similar (layouts and widgets via nesting in separate layout files) so I figured I'd give it a shot and see how it went. What's killing me the most so far is the strict enforcement of "properly" indenting the code. I'm used to "2 spaces" not 4 (or none at all when I'm in a hurry :). It's taking some getting used to.

I don't see an attachment (or know how to get to it). Did it post?

Having the user decide what layout to choose (at the click of a button or selector) may be tricky, and I can think of 1 way to do it knowing what I know about kivy today. I'll see if I can find a better or "more proper" way do it. I read some new things that kivy 1.9 can (will be able to?) do around loading widgets/layouts from separate files that might make this type of idea easier but it may have only been something you can only do once at startup. There also may be a "better" way simply because how kivy auto-rearranges the widgets based on available screen size.

Long story short: Sounds cool. I'll look into how this may be done and see if I can get some examples up and running.

I'm not sure about the menu being a built-in feature today. I haven't been able to find one yet. I'm betting it's not there since kivy is very "mobile friendly" and top menus aren't normal for mobile devices. There is a "Settings" panel with some pre-configured things and you can add settings to: http://kivy.org/docs/api-kivy.app.html?highlight=menu (see: "Create a settings panel") but it's not something you'd want to switch back and forth to very often for common things. Having to make one "appear" or on top/bottom is probably the way to go. How about this: Assuming a Stop button is going to be "always visible/available" means it's going to take up a little square of screen space in the main window. Might as well extend that little chunk of space from side-to-side or top-to-bottom and then use that space for a few other other buttons. Maybe one of those buttons is "Menu" button which then makes the menu vis ible. On the menu you can put a "Settings" button for things accessed less often and things like "File", "Comm" or whatever is more often.

Long story short: Also sounds good. I'll also look into getting a menu-esque thing working.

Question: Do you want to stay within the "core" kivy built-in features or is loading external packages ok? There's a "kivy garden" ( https://github.com/kivy-garden) of what appears to be user-generated kivy widgets/features. I'm not sure how you feel about using any of them (as this would be non-core dependencies, more painful install and maintenance, could be buggy) but there are some things which may be useful for the "menu problem": https://github.com/kivy-garden/garden.navigationdrawer https://github.com/kivy-garden/garden.modernmenu

Also: There's also a "graph" and a "File Browser" which may be cleaner/easier? than using the built-ins: https://github.com/kivy-garden/garden.graph https://github.com/kivy-garden/garden.filebrowser

— Reply to this email directly or view it on GitHub https://github.com/yoelk/Instrumentino/issues/10#issuecomment-91110155.

ghost commented 9 years ago

I sent you an email.

I'm new to github, and I don't see an area to allow direct commit permissions. I believe we'd have to set up some sort of group/team/etc. and other things, which might be a pain (or a paid option). From what I've read (I've only done a single test) the "simpler" standard github way to contribute things is to (let me know if I'm off on this):

  1. Fork my repository, copying it to your profile as a "forked" repository
  2. Create a new branch with the name of what you want to do. Usually it's named by a feature being added "floating-menu" or just "docs" or something. There are some naming conventions for this somewhere.
  3. Pull down that branch repository to your local system OR just add/edit the files inside the github web editor
  4. When you're done making changes, upload your code to the branch (if you need to), go back to my repository and create a "pull request" and point to your branch in your repository.
  5. I'll get the notification and I can choose to merge your branch of changes or deny with notes/suggestions/etc.

There's more about making standard branches ( like one called "dev" ) and tagging releases so you can have several official versions that are always available for download. The general idea is that the "Master" branch should be deployable at all times and everything else is in some form of flux. I'm still hazy on most of this though and a lot of it is "do what works for you"

For the layout changes question "The way I thought of doing it is to create all windows at startup ... keeping the rest invisible " Yes, I think that's possible and probably the easiest way to handle it (at least this is my current belief)

Regarding external dependencies + kivy garden: I'm not familiar with the kivy (or python) packaging methods but if that's possible (building a single install/runnable package) then that would be great. It took me quite awhile to get v1 all set up as I had to install several things from scratch and then perform several upgrades. I had issues with a dependency (gstreamer?) and eventually got it working.

yoelk commented 9 years ago

Hi, I forked your repo and made a pull request. But there is an easier way: I added you as a collaborator in my forked repo https://github.com/yoelk/kivy-layout-examples. So we can continue working there together. Sorry that you had trouble installing v1, this is one of the issues I wish to solve in v2.

On Fri, Apr 10, 2015 at 3:57 AM, Snarfums notifications@github.com wrote:

I sent you an email.

I'm new to github, and I don't see an area to allow direct commit permissions. I believe we'd have to set up some sort of group/team/etc. and other things, which might be a pain (or a paid option). From what I've read (I've only done a single test) the "simpler" standard github way to contribute things is to (let me know if I'm off on this):

  1. Fork my repository, copying it to your profile as a "forked" repository
  2. Create a new branch with the name of what you want to do. Usually it's named by a feature being added "floating-menu" or just "docs" or something. There are some naming conventions for this somewhere.
  3. Pull down that branch repository to your local system OR just add/edit the files inside the github web editor
  4. When you're done making changes, upload your code to the branch (if you need to), go back to my repository and create a "pull request" and point to your branch in your repository.
  5. I'll get the notification and I can choose to merge your branch of changes or deny with notes/suggestions/etc.

There's more about making standard branches ( like one called "dev" ) and tagging releases so you can have several official versions that are always available for download. The general idea is that the "Master" branch should be deployable at all times and everything else is in some form of flux. I'm still hazy on most of this though and a lot of it is "do what works for you"

For the layout changes question "The way I thought of doing it is to create all windows at startup ... keeping the rest invisible " Yes, I think that's possible and probably the easiest way to handle it (at least this is my current belief)

Regarding external dependencies + kivy garden: I'm not familiar with the kivy (or python) packaging methods but if that's possible (building a single install/runnable package) then that would be great. It took me quite awhile to get v1 all set up as I had to install several things from scratch and then perform several upgrades. I had issues with a dependency (gstreamer?) and eventually got it working.

— Reply to this email directly or view it on GitHub https://github.com/yoelk/Instrumentino/issues/10#issuecomment-91400264.