DCC-EX / WebThrottle-EX

WebThrottle-EX is a web based (html,jQuery,JavaScript) Controller/Throttle for DCC-EX EX-CommandStations
https://dcc-ex.com/WebThrottle-EX
GNU General Public License v3.0
21 stars 14 forks source link

Store cab data and switching #16

Closed matt-vdv closed 3 years ago

matt-vdv commented 3 years ago

Suggested by @ManiAkasapu

We need a way of storing the cabs used to allow quick switching without the address needing to be used each time. We also need a way to switch quickly between cabs without needing to release, type in new address and then acquire.

ManiAkasapu commented 3 years ago

@matt-hu Do you think simple drop-down is enough to switch? For this there no need of Acquire button. Just select the Cab it will be acquired... Acquire will become Add locomotive button. You see any problems with this approach?

ManiAkasapu commented 3 years ago

Ofcourse the drop-down is searchable.. but let me know if you have any other more intuitive ideas.. For example, When user click on acquire, a popup which contains added locomotives shows with more details like Name, CV, along with image.. This is complex but achievable..

matt-vdv commented 3 years ago

@ManiAkasapu A drop-down would be a good idea, where the top entry is a text box

I also wonder if it would be good to have 5 favourites.

Another option would be to allow the user to set up names for each address such as Flying Scotsman or Class 08. I will try and make some mockups later.

ManiAkasapu commented 3 years ago

@ManiAkasapu A drop-down would be a good idea, where the top entry is a text box

I also wonder if it would be good to have 5 favourites.

Another option would be to allow the user to set up names for each address such as Flying Scotsman or Class 08. I will try and make some mockups later.

Generally if we are going with drop-down, all are same.. there's no favourite.. while adding a loco, they were given a form with 4 fields (for now)

  1. Name
  2. Cv
  3. Type of loco ( diesel, electric etc)
  4. Manufacturer etc.

Note that user has to add loco before they use.

matt-vdv commented 3 years ago

@ManiAkasapu that's exactly what I meant! Could the cab data be stored in an XML file? The only reason I ask is I have an idea for a future integration that already uses this.

ManiAkasapu commented 3 years ago

Cab data is stored as JSON in browser storage and will be available to download(export) in as .json file. We can also have format options to convert it to .xml before export

ManiAkasapu commented 3 years ago

@matt-hu These are the fields for a locomotive: { "name": "BR151", "type": "Electric", "brand": "Fleischmann", "decoder": "Lenz Standard V2+", "owner": "grbba", "dccAddress": 3, "functionmap": "mymap" }

matt-vdv commented 3 years ago

@ManiAkasapu oh ok. I think that is workable, as the XML can be converted to JSON when the site starts

ManiAkasapu commented 3 years ago

@matt-hu I am working on this. I see you are using "ex-locoid" input box (this is used for acquire loco). Please watch my changes.. This may effect your code for

  1. Simulator
  2. Disabling speed controls when loco not acquire.

I am planning to trigger Acquire on select also (WIP). You may need to check that code too.

matt-vdv commented 3 years ago

@ManiAkasapu thanks for the heads-up. Where are you working on that? Is it on your branch or one specific for this feature?

ManiAkasapu commented 3 years ago

@matt-hu My branch

matt-vdv commented 3 years ago

Ok thanks

ManiAkasapu commented 3 years ago

@matt-hu I pushed my changes to my branch.. It is work in progress but you can see the code that may effect your work.. Also you can test it. Let me know the feedback. Pending items are:

  1. Styling
  2. Storing Cab data in Local storage (currently using sample JSON data)
matt-vdv commented 3 years ago

@ManiAkasapu thanks for letting me know. I will have a look and check for issues when I have some time.

matt-vdv commented 3 years ago

@ManiAkasapu I have had a look, and everything seems to be working correctly.

At this point, as there are going to be many new settings such as editing and adding cabs, it might be a good idea to use the unified settings page. I have published my local branch called unified-settings where I have started work on the feature. It is very much WIP, but gives an idea of what I am intending.

ManiAkasapu commented 3 years ago

@matt-hu Correct. Lets move things that needs to be in settings page.. This is what I am thinking.. I am going to introduce pages for following

  1. Throttle
  2. Function Mapping
  3. Locomotives
  4. Settings

What settings you think can be moved to settings page? (Oh. You have a branch let me check that)

Thanks for amazing work.

ManiAkasapu commented 3 years ago

@matt-hu I have introduced the menu. It would be good if you link the toggle between Settings and Throttle to side menu I troduced.

matt-vdv commented 3 years ago

@ManiAkasapu That menu is looking good! Good idea.

matt-vdv commented 3 years ago

@ManiAkasapu Just a thought, should the cab data as well as user preferences (theme etc.) be added to the backup json file?

ManiAkasapu commented 3 years ago

Currently, They are 3 different object preferences, Mapdata, Cabdata..

We can merge them and download single file.

matt-vdv commented 3 years ago

Ok. I did see they were stored separately in the dev tools. The only reason I suggested this is some users might expect to have their theme and cabs exported, then come to import them and find they are missing, thinking something is broken. What do you think?

ManiAkasapu commented 3 years ago

Sorry for my typos..

Theme? That's too granular. I assume you meant preferences.. We can make users to download

  1. Preferences - need function
  2. Maps ( All /Single)
  3. Locomotives (All/Single - not started)
  4. All the above - Needs to work

Let me know your views..

matt-vdv commented 3 years ago

@ManiAkasapu didn't mean theme, sorry! I meant all the preferences, like you said. Here is the options I think the user needs, based off what you said:

ManiAkasapu commented 3 years ago

@FrightRisk I have merged the changes to Master. Please test it before proceeding with further feature additions. Now, User can see a Hamburger menu on the top left corner which allows you switch between pages.

cc @matt-hu

matt-vdv commented 3 years ago

@ManiAkasapu The menu switcher is looking great! The only thing I have noticed is when adding a new function map, this opens in a 'popup' window rather than replace the Select a function map pane like viewing function maps does, if you get what I mean. (Also, the new function map window isn't theme aware at the moment).

ManiAkasapu commented 3 years ago

@ManiAkasapu The menu switcher is looking great! The only thing I have noticed is when adding a new function map, this opens in a 'popup' window rather than replace the Select a function map pane like viewing function maps does, if you get what I mean. (Also, the new function map window isn't theme aware at the moment).

Right. I currently reused existing popup to avoid re-work (dirty but works for now). We will move it to page as you mentioned. I will deal with these popups later. I just deferred for now.

ManiAkasapu commented 3 years ago

@matt-hu ⬆️

matt-vdv commented 3 years ago

@ManiAkasapu Thats fine by me! It works, which is the main thing. Don't worry about changing it now, as you say we can deal with minor cosmetic changes later on.

ManiAkasapu commented 3 years ago

@matt-hu Only thing I worry about the experience while acquiring the loco. You can try and let know what do you think. Just providing screenshot below to get what I mean

image
matt-vdv commented 3 years ago

@ManiAkasapu I think it is good for now. We can think about it for a bit and put a new and improved version in a later release if we need to.

Also, hopefully at some point we will start to get some users giving us some feedback...

FrightRisk commented 3 years ago

We should announce this for testing. Should we put Larry on having people test what is in master? I need to fix the web page so that the latest version of the throttle is available.

matt-vdv commented 3 years ago

@FrightRisk could we have a conclusion to the PWA stuff first? I think it would be a good idea to resolve this before we start telling people to come and have a look at what we are doing...

ManiAkasapu commented 3 years ago

@FrightRisk I agree with @matt-hu . Let's complete PWA thing too.. then put it for testing..

FrightRisk commented 3 years ago

Sorry I am having trouble following. Trying to bounce between too many projects. Currently we have a live version on the website and run it from your browser served from our repo on github. If you want it locally, you download a zip, unzip it and put it on your machine. Where? Is it selectable? From then on you can just run it from index.html or there is a shortcut to click on?

We don't lose any functionality or compatibility, etc. correct? I was trying to find a message where I though one of you said, "but then we have to do this" or "but the user won't be able to do that", but perhaps I am mistaken.

On Sat, Nov 21, 2020 at 8:31 PM Mani Kumar A notifications@github.com wrote:

@FrightRisk https://github.com/FrightRisk I agree with @matt-hu https://github.com/matt-hu . Let's complete PWA thing too.. then put it for testing..

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DCC-EX/exWebThrottle/issues/16#issuecomment-731662768, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI36OWGONSMK2KNL3A2Q7PTSRBSYZANCNFSM4S3NMBLQ .

matt-vdv commented 3 years ago

@FrightRisk So to clear things up:

Current solution Hosted on main site, in different repo Users can download or run in browser If downloaded, it has to be unzipped then found a home for (documents etc) and launched by finding that folder To fully deploy a new release, the code has to be copied to the website repo for live users

Proposed solution: Hosted on GitHub pages in this repo Users can install or run in browser If installed, the process is fully automated and a shortcut is added (start in windows, apps page on mac) To deploy a new release, we merge into a branch (lets call it build)

FrightRisk commented 3 years ago

I think I have you. Allright, the current website build process is much simpler than before. The website exists at dcc-ex.github.io. The "docs" folder has the live website. The exwebthrottle lives there in a folder and a link in the website points to it as well as anyone typing dcc-ex.com/exwebthrottle which called the index.html file and launches the throttle.

The way we build the website is from the raw files in the docsrc folder. So I pull down the latest, create a local branch, make changes, push the new branch, issue a PR, then merge in the main branch (called sphinx now).

So what you are proposing would change the link, correct? The website can still have the info page and a link to run web throttle from anywhere we put it, but it would no longer be in the same domain? EX: www.dcc-ex.com/exwebthrottle.

Fred

On Sun, Nov 22, 2020 at 12:24 PM Matt notifications@github.com wrote:

@FrightRisk https://github.com/FrightRisk So to clear things up:

Current solution Hosted on main site, in different repo Users can download or run in browser If downloaded, it has to be unzipped then found a home for (documents etc) and launched by finding that folder To fully deploy a new release, the code has to be copied to the website repo for live users

Proposed solution: Hosted on GitHub pages in this repo Users can install or run in browser If installed, the process is fully automated and a shortcut is added (start in windows, apps page on mac) To deploy a new release, we merge into a branch (lets call it build)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DCC-EX/exWebThrottle/issues/16#issuecomment-731780601, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI36OWFFCYB7DQSLTG6KVHLSRFCL3ANCNFSM4S3NMBLQ .

matt-vdv commented 3 years ago

@FrightRisk If set up correctly, it should be at www.dcc-ex.github.io/exWebThrottle but the old link may still work, but don't quote me on that one. The end-user experience for using in the browser should be identical

FrightRisk commented 3 years ago

That works. Do we keep exWebThrottle? There had been discussion about everything being -EX as in WebThrottle-EX, Installer-EX, etc. And since the website should be redirected, dcc-ex.com is where people navigate instead of instead of dcc-ex.github.io

On Mon, Nov 23, 2020 at 12:30 PM Matt notifications@github.com wrote:

@FrightRisk https://github.com/FrightRisk If set up correctly, it should be at www.dcc-ex.github.io/exWebThrottle but the old link may still work, but don't quote me on that one. The end-user experience for using in the browser should be identical

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DCC-EX/exWebThrottle/issues/16#issuecomment-732310452, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI36OWBDGLBVV3O6PWP7CQTSRKL3FANCNFSM4S3NMBLQ .

matt-vdv commented 3 years ago

@FrightRisk WebThrottle-EX is a good idea as it will fit with all the other names, but someone else will need to change the repo name (I don't have admin) I can update the name within the website itself if this is going to be its new name.

FrightRisk commented 3 years ago

Ok, I can rename it

On Tue, Nov 24, 2020 at 12:05 PM Matt notifications@github.com wrote:

@FrightRisk https://github.com/FrightRisk WebThrottle-EX is a good idea as it will fit with all the other names, but someone else will need to change the repo name (I don't have admin) I can update the name within the website itself if this is going to be its new name.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DCC-EX/exWebThrottle/issues/16#issuecomment-733113052, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI36OWBYWXI3LACBNJZ7KRTSRPRW7ANCNFSM4S3NMBLQ .