Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Conditionals Q&A
- ------------------------
- [Conditionals to show image by week]
- 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:
- IF day of week is Sunday then show hand with rotation 42.
- Thank you
- A: by pjsockett
- 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
- (((((#Dd#%7)+(((2.6(#DM#-2))-0.2)%7))+(((5(#Dyy#%4))%7)+((3(#Dyy#%7))%7)))%7)51.429)
- To have the hand sweep from day to day it would be
- ((((((#Dd#%7)+(((2.6(#DM#-2))-0.2)%7))+(((5(#Dyy#%4))%7)+((3(#Dyy#%7))%7)))%7)+(#DH#/23))51.429)
- A: by pjsockett
- I have come up with something much simpler if you need it for further faces.
- (((#DD#+((#Dyy#+2)%7))%7)*(360/7))
- A: by wes__
- So....You're absolutely right. This formula does not evaluate in the opacity field. Must be a bug.
- I've figured out something that will work for this year
- In Sunday's opacity field I've put $5.0=(#DD#%7)?100:0
- Monday $6.0=(#DD#%7)?100:0
- Tuesday $0.0=(#DD#%7)?100:0
- Wednesday $1.0=(#DD#%7)?100:0
- Thursday $2.0=(#DD#%7)?100:0
- Friday $3.0=(#DD#%7)?100:0
- Saturday $4.0=(#DD#%7)?100:0
- 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)
- 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.
- 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