Working on an Apex Code Debugger

phatduckk

Well-Known Member
View Badges
Joined
Jul 21, 2019
Messages
806
Reaction score
961
Location
San Mateo, CA
Rating - 0%
0   0   0
Title more or less says it all: I've always thought the code editor in the web interface could use a debugger... this morning I thought I'd give it a try. Turns out, in about an hour, I had something promising. It's not done, has bugs, yada yada - it's a work in progress. But, I wanted thought I'd show folks a preview.



Once I iron out the obvious bugs and am happy with it I'll toss it up on the interwebs for free.
 

Tangdora

Well-Known Member
View Badges
Joined
Feb 8, 2020
Messages
724
Reaction score
395
Rating - 0%
0   0   0
Pretty cool. Definite would help those getting in apex coding. Personally don’t struggle with the order of execution itself when it comes to apex programming . But a debugging area that I would gladly use a debugger like this on would be if you could some how get it to show linkage for better parameter control and over site

For example if I clicked on a line say

If Temp < 77 then on

Being able then to see in a table pane of every outlet name and line of code in that outlet that references “temp” would make confirming parameters are in sync a breeze. Apex is great at renaming outlet names and sensors in the lines them self but does nothing for your if you change and actual parameter value itself that may be used else where.

I ran once for an almost half a year mismatching temp condition when I forgot to hit save properly before I realized they were off a degree. On was set between 77-78 and the other heater 78-79.
 
OP
OP
phatduckk

phatduckk

Well-Known Member
View Badges
Joined
Jul 21, 2019
Messages
806
Reaction score
961
Location
San Mateo, CA
Rating - 0%
0   0   0
Pretty cool. Definite would help those getting in apex coding. Personally don’t struggle with the order of execution itself when it comes to apex programming . But a debugging area that I would gladly use a debugger like this on would be if you could some how get it to show linkage for better parameter control and over site

For example if I clicked on a line say

If Temp < 77 then on

Being able then to see in a table pane of every outlet name and line of code in that outlet that references “temp” would make confirming parameters are in sync a breeze. Apex is great at renaming outlet names and sensors in the lines them self but does nothing for your if you change and actual parameter value itself that may be used else where.

I ran once for an almost half a year mismatching temp condition when I forgot to hit save properly before I realized they were off a degree. On was set between 77-78 and the other heater 78-79.
That's a pretty good idea... I'll give it some thought. for now I have the basic version up at https://github.com/phatduckk/apex-debugger
 
OP
OP
phatduckk

phatduckk

Well-Known Member
View Badges
Joined
Jul 21, 2019
Messages
806
Reaction score
961
Location
San Mateo, CA
Rating - 0%
0   0   0
Pretty cool. Definite would help those getting in apex coding. Personally don’t struggle with the order of execution itself when it comes to apex programming . But a debugging area that I would gladly use a debugger like this on would be if you could some how get it to show linkage for better parameter control and over site

For example if I clicked on a line say

If Temp < 77 then on

Being able then to see in a table pane of every outlet name and line of code in that outlet that references “temp” would make confirming parameters are in sync a breeze. Apex is great at renaming outlet names and sensors in the lines them self but does nothing for your if you change and actual parameter value itself that may be used else where.

I ran once for an almost half a year mismatching temp condition when I forgot to hit save properly before I realized they were off a degree. On was set between 77-78 and the other heater 78-79.
This what you were thinking? I put debug icons next to the cogs in the dashboard page. when you click on them a panel pops up at the bottom showing all the places that switch/probe/outlet was used.

it shows the single line of code & line number - but if you click on the row you get a full preview. Also the name of the other outlet etc links directly to it

1775792850417.png
 

Tangdora

Well-Known Member
View Badges
Joined
Feb 8, 2020
Messages
724
Reaction score
395
Rating - 0%
0   0   0
This what you were thinking? I put debug icons next to the cogs in the dashboard page. when you click on them a panel pops up at the bottom showing all the places that switch/probe/outlet was used.

it shows the single line of code & line number - but if you click on the row you get a full preview. Also the name of the other outlet etc links directly to it

1775792850417.png
YES!! that’s awesome. Does it look into alarm and email outlets too as well virtual or is it limited to physical outlets only.
 
OP
OP
phatduckk

phatduckk

Well-Known Member
View Badges
Joined
Jul 21, 2019
Messages
806
Reaction score
961
Location
San Mateo, CA
Rating - 0%
0   0   0
YES!! that’s awesome. Does it look into alarm and email outlets too as well virtual or is it limited to physical outlets only.
yup

1775795528969.png


So in this screenshot I clicked on the debug icon for "salt" which is my conductivity probe.... bottom shows both

* Main_Alarm is my renamed email alarm (forget the original name).
* AWC_ENABLED is a virtual outlet.
 

Tangdora

Well-Known Member
View Badges
Joined
Feb 8, 2020
Messages
724
Reaction score
395
Rating - 0%
0   0   0
I don't understand =) could you elaborate please?

install instructions and all the code is here. go nuts https://github.com/phatduckk/apex-debugger
Same concept as probes. If you click on fallback or set will it show you all the outlets with a fall back or set? For these two specifically would be nice if you could also show the inverse as well. For example if i were to click on fall back it would show all the outlets with a fallback but vice versa show a separate section of all outputs where it is missing. Now granted fallbacks are not needed in all outlets. But potentially calling it out where it may be missing may be wise.
 
OP
OP
phatduckk

phatduckk

Well-Known Member
View Badges
Joined
Jul 21, 2019
Messages
806
Reaction score
961
Location
San Mateo, CA
Rating - 0%
0   0   0
Same concept as probes. If you click on fallback or set will it show you all the outlets with a fall back or set? For these two specifically would be nice if you could also show the inverse as well. For example if i were to click on fall back it would show all the outlets with a fallback but vice versa show a separate section of all outputs where it is missing. Now granted fallbacks are not needed in all outlets. But potentially calling it out where it may be missing may be wise.
oh gotcha. I gotta figure out where id put that... hmmmm
 
OP
OP
phatduckk

phatduckk

Well-Known Member
View Badges
Joined
Jul 21, 2019
Messages
806
Reaction score
961
Location
San Mateo, CA
Rating - 0%
0   0   0
Same concept as probes. If you click on fallback or set will it show you all the outlets with a fall back or set? For these two specifically would be nice if you could also show the inverse as well. For example if i were to click on fall back it would show all the outlets with a fallback but vice versa show a separate section of all outputs where it is missing. Now granted fallbacks are not needed in all outlets. But potentially calling it out where it may be missing may be wise.
ok - done =)

1775798845705.png


I injected a new option into the ? dropdown called "Explore". Lists all the stuff on the left including SET & FALLBACK. has a toggle that allows you to list what other outlets do or do not reference it =)
 

Tangdora

Well-Known Member
View Badges
Joined
Feb 8, 2020
Messages
724
Reaction score
395
Rating - 0%
0   0   0
Nice I try it out tomorrow. If your looking for other enhancement While not 100% related to debugging code, one other thing that would be a useful feature to add to your extension if at all possible are auto back up and recovery options Bonus points if you could specify where on a drive it saves. The two biggest concepts that come to mind are 1) on login save a copy of full back up file since most people tend to forget 2) if you open an outlet. Have it save a copy of the current code before changes are made so that you have something roll back onto if your trial and error when debugging or experimenting fails. If it could actually write the original prior to directly saving the new code that would be more wise so that it’s not saving code snippets every time you simply go into to view.
 

TangerineSpeedo

Reefing since 1989
View Badges
Joined
Jun 8, 2022
Messages
4,105
Reaction score
8,236
Location
SoCal
Rating - 100%
2   0   0
wait this is supposed to make things easier... lol...
This is where I need AI...
I just need to Apex to be like Siri and say "Apex, when my temp rises in tank1 higher than 80f turn on my chiller A until it falls below 79f "
That would be helpful...
 
OP
OP
phatduckk

phatduckk

Well-Known Member
View Badges
Joined
Jul 21, 2019
Messages
806
Reaction score
961
Location
San Mateo, CA
Rating - 0%
0   0   0
wait this is supposed to make things easier... lol...
This is where I need AI...
I just need to Apex to be like Siri and say "Apex, when my temp rises in tank1 higher than 80f turn on my chiller A until it falls below 79f "
That would be helpful...
It’s possible. But the more you try to make it do the further you get from it being easy for non tech people to install & run the “extra thing”.

If you want something that magical you can probably pull it off with OpenClaw.
 

Tangdora

Well-Known Member
View Badges
Joined
Feb 8, 2020
Messages
724
Reaction score
395
Rating - 0%
0   0   0
Played around with this tonight really like the explorer option. One tweak to it if possible. In all the filler space to the right of the reference/not reference codes are you able to get it to show a box that contains the full code of the active outlet selected.
 

Attachments

  • IMG_2909.jpeg
    IMG_2909.jpeg
    75 KB · Views: 31
OP
OP
phatduckk

phatduckk

Well-Known Member
View Badges
Joined
Jul 21, 2019
Messages
806
Reaction score
961
Location
San Mateo, CA
Rating - 0%
0   0   0
Played around with this tonight really like the explorer option. One tweak to it if possible. In all the filler space to the right of the reference/not reference codes are you able to get it to show a box that contains the full code of the active outlet selected.
I can ... I'll get to that and update here. Should be easy

In the mean time I added a Safari extension for my fellow MacOS/Safari peeps. Its over at
https://github.com/phatduckk/apex-debugger with instructions on how to install it
 
OP
OP
phatduckk

phatduckk

Well-Known Member
View Badges
Joined
Jul 21, 2019
Messages
806
Reaction score
961
Location
San Mateo, CA
Rating - 0%
0   0   0
I also added a filter to the unused widgets section b/c ive always been annoyed having to scroll through that mess.

Its ugly but it works... ill eventually update that UI to be nicer

1775927693257.png
 

Tangdora

Well-Known Member
View Badges
Joined
Feb 8, 2020
Messages
724
Reaction score
395
Rating - 0%
0   0   0
Played around with this tonight really like the explorer option. One tweak to it if possible. In all the filler space to the right of the reference/not reference codes are you able to get it to show a box that contains the full code of the active outlet selected.
ok done

1775927623297.png
Nice. I did find two bugs with the explore but the one can be ignored as it was being caused by something you’re not suppose to do in apex

1) bug 1 - the search feature looks be doing a wildcard string search. But if the outlet name is simple then it finding all items that only contain the wording. Given the coding in an apex does not allowthe sensor/outlet/ etc, name to be the last word in a line. You may need to add a space to the ending of the word being search. For example I have an outlet called “uv” only. When I click on it I see outlets that contain UV in the wording too but not directly related. You may have to search for “[name](actual space)” ie “UV “ to allow the space to server as a delimiter.

Other bug was actually because this identified that I actual had two outlets named the same, a physical and a control outlet from my MXM ….KUDOS to that. Was acting weird when I clicked on it. In this case I renamed one as you shouldn’t have two with same name.
 
OP
OP
phatduckk

phatduckk

Well-Known Member
View Badges
Joined
Jul 21, 2019
Messages
806
Reaction score
961
Location
San Mateo, CA
Rating - 0%
0   0   0
Nice. I did find two bugs with the explore but the one can be ignored as it was being caused by something you’re not suppose to do in apex

1) bug 1 - the search feature looks be doing a wildcard string search. But if the outlet name is simple then it finding all items that only contain the wording. Given the coding in an apex does not allowthe sensor/outlet/ etc, name to be the last word in a line. You may need to add a space to the ending of the word being search. For example I have an outlet called “uv” only. When I click on it I see outlets that contain UV in the wording too but not directly related. You may have to search for “[name](actual space)” ie “UV “ to allow the space to server as a delimiter.

Other bug was actually because this identified that I actual had two outlets named the same, a physical and a control outlet from my MXM ….KUDOS to that. Was acting weird when I clicked on it. In this case I renamed one as you shouldn’t have two with same name.
nice finds... Im cleaning up some of the UI and stuff but ill take a look at these when I get more time.

thx
 

TOP 10 Trending Threads

HOW DO YOU ADJUST YOUR CUC AS ALGAE DISAPPEARS?

  • Capture and re-home CUC

    Votes: 10 8.3%
  • Increase white light/hours in tank to spur algae growth to feed CUC

    Votes: 8 6.6%
  • Feed nori to support CUC

    Votes: 39 32.2%
  • Feed herbivore pellets to support CUC

    Votes: 43 35.5%
  • Allow attrition to balance CUC and algae

    Votes: 52 43.0%
  • Provide macro algae to feed CUC

    Votes: 8 6.6%
  • Introduce CUC predators

    Votes: 1 0.8%
  • Other (please explain)

    Votes: 12 9.9%
Back
Top