This moving around is caused by the Angle option of the [MeterCurrentWindDirection] meter. Although for simple rotations of a String meter, the Angle option is good enough, for such rotations (when the direction of the wind is continuously changing), it could be difficult to properly manage it.nosanctuary wrote:However, two lines above, the Wind Direction arrow seems to move around a bit - and I'm not sure how to fix that.
Instead I'd be tempted to rotate the meter not with the Angle option, but with a properly written TransformationMatrix. It's much more easier to manage it and more accurate rotations can be achieved (but here I have to say I'm a big fan of this extremely powerful option). It's not easy to write a proper TransformationMatrix, but finally neither impossible isn't.
So, I wrote one, please try it and let me know if it is rotating the arrow as it should have to. Remove the Angle option of the [MeterCurrentWindDirection] meter and add the following TransformationMatrix option:
Code: Select all
TransformationMatrix=(Cos(Rad([CurrentWindDirectionChild])));(-Sin(Rad([CurrentWindDirectionChild])));(Sin(Rad([CurrentWindDirectionChild])));(Cos(Rad([CurrentWindDirectionChild])));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad([CurrentWindDirectionChild]))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad([CurrentWindDirectionChild]))))
Code: Select all
[MeterCurrentWindDirection]
...
X=236
Y=-8R
...
StringAlign=CenterCenter
...
TransformationMatrix=(Cos(Rad([CurrentWindDirectionChild])));(-Sin(Rad([CurrentWindDirectionChild])));(Sin(Rad([CurrentWindDirectionChild])));(Cos(Rad([CurrentWindDirectionChild])));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad([CurrentWindDirectionChild]))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad([CurrentWindDirectionChild]))))
[MeterCurrentWDewPoint]
...
Y=13r
No, it's not due to the arrow, neither to the alignment.nosanctuary wrote:Also, and it may be related - instead of 12 mph, it should be saying Wind 12 mph. Part of it is being cut off. I did try adding a line for the width, but that didn't seem to help. That's what makes me think it might be due to the arrow, or alignment.
The Wind word is hidden either by the IfTrueAction, either by the IfFalseAction option (which one is executed) of the [CurrentWindSpeedChild] measure. Modify them, to get the Wind word added before the speed:
Code: Select all
[CurrentWindSpeedChild]
...
IfCondition=CurrentWindSpeedChild = 0
IfTrueAction=[!SetOption MeterCurrentWind Text "Wind %1"]
IfFalseAction=[!SetOption MeterCurrentWind Text "Wind %1 [*UnitsSpeedChild*]"]