Advertisement
Guest User

Conditionals to show images by week Q&A

a guest
Oct 1st, 2014
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. Conditionals Q&A
  2.  
  3. ------------------------
  4.  
  5. [Conditionals to show image by week]
  6.  
  7. Q: Hi there! I just made a watchface and it includes hand that would show certain day of week in an arc. What is the conditional to show the hand? For example:
  8. IF day of week is Sunday then show hand with rotation 42.
  9. Thank you
  10.  
  11. A: by pjsockett
  12. Here is what I use for the rotational value. Hopefully the day of the week will become an integer value in the app and this will get much easier. This equation will not work correctly in January or February of each year. The rotational value assumes the dial is 360° with Sunday on top
  13. (((((#Dd#%7)+(((2.6(#DM#-2))-0.2)%7))+(((5(#Dyy#%4))%7)+((3(#Dyy#%7))%7)))%7)51.429)
  14. To have the hand sweep from day to day it would be
  15. ((((((#Dd#%7)+(((2.6(#DM#-2))-0.2)%7))+(((5(#Dyy#%4))%7)+((3(#Dyy#%7))%7)))%7)+(#DH#/23))51.429)
  16.  
  17. A: by pjsockett
  18. I have come up with something much simpler if you need it for further faces.
  19. (((#DD#+((#Dyy#+2)%7))%7)*(360/7))
  20.  
  21. A: by wes__
  22. So....You're absolutely right. This formula does not evaluate in the opacity field. Must be a bug.
  23. I've figured out something that will work for this year
  24. In Sunday's opacity field I've put $5.0=(#DD#%7)?100:0
  25. Monday $6.0=(#DD#%7)?100:0
  26. Tuesday $0.0=(#DD#%7)?100:0
  27. Wednesday $1.0=(#DD#%7)?100:0
  28. Thursday $2.0=(#DD#%7)?100:0
  29. Friday $3.0=(#DD#%7)?100:0
  30. Saturday $4.0=(#DD#%7)?100:0
  31. This works because % is the mod operand and the first day of this year was Tuesday. #DD# is the number of the day in the year so that /7 for sundays will have a remainder of 5. Next year you'll have to shift the numbers so that Wednesday's are 0 and so forth (or hopefully the bug will be fixed by then)
  32. What threw me off is that my original formula works perfectly fine in a text layer which is where I do most of my testing.
  33. I've uploaded a version with all of the formulas in and working for this year: https://dl.dropboxusercontent.com/u/7652847/Casio%20Edifice.face
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement