Welcome, Guest
Username: Password: Secret Key Remember me

TOPIC: Web Interfaces for, well, EVERYTHING!

Web Interfaces for, well, EVERYTHING! 2 years 11 months ago #17844

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
I have the asynchronous callbacks all working and setup of the panel page is working great! I also added database objects that target a specific table and specific data in those tables for read, write, update, and delete functions specific to the object, configured by the JSON configuration file. These objects are accessible from all the controls, but specific pieces of data is tied to specific controls through an event system. It's pretty complicated but fast, and configurable from the specific panel's JSON file. It is all working pretty well!! WOOHOO!

All this is getting more complicated because, again, the configuration of the specific panel needs to be setup entirely via the panel's JSON file, using the existing framework. This is great because if I add features to the controls, it will affect ALL that class of controls. All accessible from the controls library as the JSON file is iterated through. Even the appearance of the controls is controlled through CSS classes, and selected through the JSON file configuration data.

So the events, change triggers, everything is all set up through iteration of the JSON file as the DOM (Document Object Model) is built.

I am finally almost ready to build a complete interactive panel application within a web page on a local server. When I am finished with the JSON parameter layout, it will be imported to the database and that database will control everything. Then it will be time to build the IDE that handles designing the panel applications and layouts.

More as it develops! Thank you for your time! :)

Web Interfaces for, well, EVERYTHING! 2 years 11 months ago #17845

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
I do not believe I elaborated on the control creation scheme so I will do that now.

The controls are created using a method "create" that is written into the specific control type prototype. I would post one here but they are still very dirty, like a bread-boarded prototype of an embedded system. There are properties and methods that are included that may not even be used but included for future use. I will post one once I trim them down to what is needed.

What happens is a new instance of a specific control prototype is created and saved in a control array. Once created, the create method I wrote inside the prototype is called with parameters to create an actual DOM element. The prototype instance is linked to that specifically created element so interaction with that element is addressed through the new object based on that prototype. The element's ID, name, events, and appearance is all controlled by the object that created it. If another element of the same type is needed, a new instance object of the same prototype is created and unique. The mapping of these created elements and objects is in the JSON configuration file. The creation of all these objects and elements based on the JSON file is linear so the order of creation is important when elements with different "SUB-PARENTS" are required. Like say there is a DIV that contains a group of buttons, like say "SAVE", "CANCEL", "DELETE", etc. The parent of these buttons are a sub-control of the main panel. So the container DIV needs to be before the actual button object/elements. Understandably.

This is incredibly clean and transparent to individuality of the element control functions and features.

So the page loads, the JSON configuration file is loaded and iterated through, and the framework is addressed as needed to build the panel in the page. Once it is completed, I expect I will implement some sort of CACHING to use the built page statically to improve speed with repeated accesses.

One of the issues I ran into is unique ID naming, like namespaces. This was easy! All I had to do was make sure the ID's were started with the panel's ID name. This prevents interaction bleed between loaded panels on the master application plane. So a combo box that say, shows categories of electronic parts, that might be named "combobox01" will not interfere with another panel's combobox named the same thing because its ID is "categories_panel-combobox01". All I need to make sure is that each panel is uniquely named. :)

Web Interfaces for, well, EVERYTHING! 2 years 11 months ago #17846

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
I am at about 20 thousand lines of code now. I expect that count to increase and decrease as I streamline functions for multiple purpose use. On a grand scale of framework size though, it is incredibly small. This is exciting!!!!

Web Interfaces for, well, EVERYTHING! 2 years 11 months ago #17847

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
Found out something the super hard way today, and the last few weeks. Although Javascripting is single threaded and experts will tell you that RACE CONDITIONS will never happen, when you add jQuery, Ajax, and xmlhttprequests, you better use callbacks or you will outrun your code. After all, it IS ASYNCHRONOUS!

I chased and have been chasing my tail for the last few weeks because of that. I got it now. If you have code after say a $.get statement with a call back, the code right after that function block gets executed right after the block as the ajax waits for data. If you plan to use global arrays that needed to be populated by the ajax call, they will be undefined until the ajax is finished. Some planning-ahead needs to be used to service that additional code at the right time. even if the function is huge!

Now I have a new streamlining plan for the code and going after that today. HURDLE COMPROMISED! Now I can proceed. WHEW!

It makes sense if you look at it architecturally. You cannot populate a building until the floors and offices are finished. So build the building, then bring the workers in. Otherwise, they enter an office with a missing floor and BOOM! FATAL ERROR! lol

Web Interfaces for, well, EVERYTHING! 2 years 11 months ago #17848

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
Was on vacation last week, and we traveled to a nice little guest house in the White Mountains, Arizona in a little town called Springerville. It was WONDERFUL! But there was only shared internet from a weak AP from the owner off a slower (not really slow) connection at the host. I spent all my free time over two days figuring out how to tap into that connection for my network and had it working on the last day of our stay. I learned a lot from this though. I used a TP-LINK WR841N v9.2 with DD-WRT firmware and my laptop, and had the whole guest house bathed in a wonderful hotspot linked to the host connection. Worked great for our internet enabled smart TV (Samsung LED/LCD 32"), our phones, and the IoT devices I brought up for testing.

So while I didn't get a chance to work on this project, I learned a lot about networking that will help solve my wireless issues anywhere we go. So it was a WIN!

Now I'm back in San Tan Valley, AZ, and back at this project. More soon!

Web Interfaces for, well, EVERYTHING! 2 years 11 months ago #17849

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
Solved my asynchronous issues I think. I moved some code around and went after callbacks a slightly different way. It's too much to relay here for now, but it appears my CODE-FLOW changes solved a lot of my asynchronous problems.

For this next stretch, I decided to hard code the rest for specific panel apps that will run inside the master panel. The reason for this is I need the two apps features now for my use. What I will do though after I get it all functional is to rewrite the rest of the code framework that is hard coded to support the dynamic features I have been harping on all through this thread. Should be easy now that I documented all the framework features. All I will have to do is replace the hard-coded code with the dynamically supported code one piece at a time. It feels dirty, but manageable.

More as I do it!
Time to create page: 0.258 seconds