Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Home page Hourly Display
#1
Dan,

      As I have been hacking away on my weewx plugin. I noticed something with hourly display on the homepage that I have not been able to chase down the cause. If I open the homepage during the time window when programs are scheduled and the system enable is off, the hourly window shows programs scheduled to run/or could have been in an ~1nr window around the current time indicator bar (they are hashed, I think indicating they are not being run). The color/name legend at the bottom shows up but the name portion is not the station name from the programData.json as it would be in for a program that has been or is being run. Instead the name is "PROGRAM #" where, # is the pid of the program. Is that intended?
I have the 24hr-clock option off.

Thanks,
Reply
#2
(2023 Jun 13, 07:02 PM)tutqiunnh Wrote: Dan,

      As I have been hacking away on my weewx plugin. I noticed something with hourly display on the homepage that I have not been able to chase down the cause. If I open the homepage during the time window when programs are scheduled and the system enable is off, the hourly window shows programs scheduled to run/or could have been in an ~1nr window around the current time indicator bar (they are hashed, I think indicating they are not being run). The color/name legend at the bottom shows up but the name portion is not the station name from the programData.json as it would be in for a program that has been or is being run. Instead the name is "PROGRAM #" where, # is the pid of the program. Is that intended?
I have the 24hr-clock option off.

Thanks,
That looks like a bug.
Named programs was added fairly recently and  I may have missed that. I will take a look.
Thanks for reporting this.

Dan
<p><br></p>
Reply
#3
I am not seeing what you describe.
I set my test system to match the settings from your post but the program names appear for all named programs.
If the name field on the program setup page the program number is shown. This is the intended behavior.

Dan
<p><br></p>
Reply
#4
Photo 
Dan,

I was looking at it again this AM. So to clarify what I'm seeing and you can verify correctness.

I have a 6 programs
        Mo-Th-Sa_Pass1
        Mo-Th-Sa_Pass2
        Su-Tu-Fr Pass 1
        Su-Tu-Fr Pass 2
        Veg Grdn
        Shrubs

On the hourly display panel on the home page if I look at the runs of a previous day I will see the legend color code with the name of one or the programs above shown in the legend. If I look at the current day I will see as an example color coded boxes with (PROGRAM 3, PROGRAM 4, PROGRAM 5) not the names shown above. I found this morning that system on/off did not effect the display.

I have a couple of screen shots that I captured to show this but don't see a method to attach them to the thread. Please advise if you would like me to send the screen shots to you.

One other thing I forgot about that is different in my case is I'm running on an Ubuntu system not Rpi. Ubuntu 22.04.2 LTS to be specific. I was rooting around the code a bit but not exactly sure the legend generation happens. I know that home.html has part of it and webpages.py is involved. It might be that difference that is causing my issue.

(Update 06/17/23: I'm not certain, however, it looks like an possible issue in schedule.js In the JQuery starting at line 183 there is a "else if (isNaN" on line 202. Then the variable idx gets assigned by a program names lookup and programClass is assigned via idx +1. The else statement after uses parseInt for programClass assignment, I think to make sure it is an integer used. Finally, that programClass is assigned to the scheduled program in programClassesUsed on line 208. On line 223 the jQuery for the legend uses programClassesUsed for legend name assignment via programName(p) on line 225. That function def starting on 163 indicates that if name lookup is not a number than assign it as a name, otherwise it is assign as "Program" + number, which is what I see displayed in my scenario.)

As an aside, I was working on a bug I found in my program and left sip running as a service while I modified the plugin code. When I  saved the plugin code, sip picked up on this and the plugin popup showed 2 versions of my plugin in it and my status page updated with the new plugin outputs. I have seen other tools that reread .py subroutine and control files as well so I assume this is expected behavior. A simple restart removed the extra listing in the pop up.

(Update 06/19/23 have attached the screenshot images It is likely caused by the way the function doSimulation works in schedule.js. I think this function builds timeline for station runs that are not in the log file. On line 115 of schedule.js the program value is assigned to the pid_array value, likely the program index number and no lookup of if this program index has an associated program name. When the display is generated from the log and then merged with the doSimulation results the log processing just leaves the program value as the name in the log.)


Attached Files Thumbnail(s)
       
Reply
#5
(2023 Jun 14, 05:11 PM)dan Wrote: I am not seeing what you describe.
I set my test system to match the settings from your post but the program names appear for all named programs.
If the name field on the program setup page the program number is shown. This is the intended behavior.

Dan

Dan,

 I have updated my post with some analysis of schedule.js and attached the screenshots of what I see. I think I understand why it happens, but you can confirm my analysis.

Thanks,

Bryan
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)