[Lcdproc] imonlcd 0x0 command turning off progress bar

Eric Pooch epooch at cox.net
Sun Oct 16 15:43:54 UTC 2011


I agree with option 1.  This is more consistent with the LCDproc  
protocol.  Your description is consistent with my understanding of  
how the driver currently works, which seems different from what Yura  
stated.  0x0 does currently clear the bars and the icons
>


The issue you see in line 876 is intended as an aesthetic fix.  The  
bars and icons need to be set in separate output commands because  
there are not enough bits in the output command to hold the state of  
the icons and the bars. We could just return after we set the bars  
because there cannot also be any new icon data. However, if the CD  
icon is spinning we would miss an opportunity to automatically update  
it and the icon would appear to pause briefly when the bars are  
updated. This is not noticeable until you are updating the bars a  
lot.  If the CD icon is spinning, we need to update the icons every  
time, not just when we receive a new output command.
So maybe the comment should be changed to indicate that.

Using the output command to hold all of this data is really a hack  
and I could see a situation where a client sends many output commands  
and the driver's output only gets called once by the server core,  
missing some updates.  I don't know enough about the server core to  
know that this is a real issue though.  imonlcd would be greatly  
benefited by the proposed pictogram support.

--Eric

On Oct 16, 2011, at 1:36 AM, Markus Dolze wrote:

> On 15.10.2011 21:44, Yura Scheglyuk wrote:
>>         Hi!
>>
>> On 15.10.2011 23:59, Eric Pooch wrote:
>>
>>> My solution would be to just properly cache the bar state during a
>>> 0x0 or -1 output command. Otherwise 0x0 and -1 would not work as
>>> intended in the protocol.
>>> The problem is that there is currently no way to clear all of the  
>>> icons
>>> without clearing the bars.
>>
>> Now imonlcd driver assuming that 0x0 clear icons only. The simple
>> solution is to modify driver that on 0x0 command it should clear the
>> bar state too.
>>
>
> Currently there are two options:
>
>    1. '-1' will turn all icons _and_ bars on. '0x0' will turn all  
> icons
>       _and_ bars off.
>    2. '-1' will _not_ turn on the bars and '0x0' will _not_ turn  
> them off.
>
> 1.) This Is current behavior and has not been changed since 0.5.4. The
> bug is that bars do not turn on again after '0x0' if the same bar  
> state
> is sent again. This will be easy to fix.
>
> 2.) This is a change in the meaning of '-1' and '0x0' and will require
> applications to be updated to additionally set and clear the bars.
>
> I suggest to stay with 1.) and to just reset the last_output_bar_state
> upon '-1' or '0x0'.
>
>
> Additionally I see a possible problem in line 872:
> state = p->last_output_state;
>
> Immediately after that the function returns if state is the same as on
> last update (line 876):
> if (state == p->last_output_state && !(state & IMON_OUTPUT_CD_MASK)) {
>
> So unless IMON_OUTPUT_CD_MASK is set (in a previous call), output()  
> will
> return upon updating the bars. Is this intended behavior?
> Regards,
> Markus
>
>
> _______________________________________________
> LCDproc mailing list
> LCDproc at lists.omnipotent.net
> http://lists.omnipotent.net/mailman/listinfo/lcdproc



More information about the LCDproc mailing list