Measures 対策

A measure is an object that retrieves information to be used by the skin. Measures are one of the two major kinds of objects in a skin, along with meters.尺度は、スキンが使用する情報を取得するオブジェクトです。メジャーは、メーターとともに、スキン内の2つの主要な種類のオブジェクトのうちの1つです

Usage使用法

Unlike meters, measures do not display anything by themselves. You cannot "see" a measure in a skin. The measure simply provides the information as a value, which can be used in several ways:メーターとは異なり、メジャーはそれ自体では何も表示しません。スキンの中でメジャーを「見る」ことはできません。メジャーは単に情報をとして提供します。これはいくつかの方法で使用できます。

  • A meter can be bound to a measure. In this way, the meter will automatically display the value in a way that is appropriate for the type of meter. This also takes the measure's range and scale into account (if applicable).メーターはメジャーにバインドできます。このように、メーターはメーターの種類に適した方法で自動的に値を表示します。これはまた、メジャーの範囲とスケールも考慮に入れます(該当する場合)。

  • The measure value can be referenced as a section variable. In this way, the value can be used in almost any meter or measure option. As a section variable, the value is used "literally," which means it does not automatically account for the range or scale.メジャー値はセクション変数として参照できます。このように、値はほとんどすべてのメーターまたはメジャーオプションで使用できます。セクション変数として、値は「文字通りに」使用されます。これは、範囲またはスケールを自動的に考慮しないことを意味します。

  • A measure can trigger an action when the value passes into a certain range.数値が特定の範囲に入ると、メジャーはアクショントリガーできます。

Some measure types may have their own special rules. These are detailed in their individual articles.メジャータイプによっては、独自の特別な規則がある場合があります。これらについてはそれぞれの記事で詳しく説明されています。

Formatフォーマット

A measure is written as a section in the skin. All measures use the Measure option to define the section as a specific type of measure. Most other measure options depend on the type, but there are some general options that are valid in many or all measures.メジャーは、スキンのセクションとして書かれています。すべてのメジャーは、Measureセクションを特定のタイプのメジャーとして定義するためのオプションを使用します。他のほとんどのメジャーオプションはタイプに依存しますが、多くのまたはすべてのメジャーで有効な一般的なオプションがいくつかあります

Below is an example of a complete working measure:以下は、完全な作業対策の例です。

[MeasureFour]
Measure=Calc
Formula=2+2
UpdateDivider=-1

Values

A measure actually provides two values: a string, or "raw text," and a number, which can be used in calculation formulas. Depending on the type of measure, these values may be the same, which means you can use them interchangeably; or, they may be completely different. The article for each measure type explains what is provided for both the number and string values.数値データは実際には2つの値を提供します。文字列、つまり「生のテキスト」と数値です。これらは計算式で使用できます。数値データの種類によっては、これらの値は同じになる場合があります。つまり、これらの値は同じ意味で使用できます。または、完全に異なる可能性があります。各数値データタイプの記事では、数値と文字列値の両方に何が提供されているかについて説明しています。

  • When a meter is bound to a measure, it automatically uses the correct value for its type.メーターが小節バインドされていると、自動的にそのタイプに正しい値が使用されます。

  • When using Section Variables, different syntax is used to refer to a measure's string or number value.セクション変数を使用するときは、メジャーの文字列または数値を参照するために異なる構文が使用されます。

  • The Substitute option affects only the string value of the current measure.[ 代用 ]オプションは、現在の数値データの文字列値にのみ影響します。

  • IfAction options use only the number value of the current measure.IfActionオプションは、現在のメジャーの数値のみを使用します

  • The Formula option in a Calc measure uses only the number values of other measures, unless section variables are used instead.CalcメジャーFormulaオプションは、セクション変数が代わりに使用されていない限り、他のメジャーの数値のみを使用します。

Although a string value is not a "true" number, it can be used like a number in formulas and options, as long as it contains only numeric characters and valid operators. (Otherwise, it is treated as zero.) Likewise, a number value can be displayed or stored to a variable as a string of text, although this may cause the value to lose precision.文字列値は「真」の数値ではありませんが、数値と有効な演算子のみを含むのであれば、数式やオプションで数値のように使用できます。(それ以外の場合は、ゼロとして扱われます。)同様に、数値はテキストの文字列として表示または変数に格納することができますが、これによって値の精度が失われる可能性があります。

Percentage割合

Some meters require that a measure provide a value that can be used as a percentage. These would include Bar, Histogram, Line, Rotator and Roundline meters. In order for these meters to know that the current value of the measure is 27%, they need to know what value 100% represents. In addition, you may want to display the percentage of the total value a measure is currently at in a String meter, or use the percentage value of a measure in a formula.一部のメーターでは、メジャーがパーセンテージとして使用できる値を提供する必要があります。これらには、バー、ヒストグラム、ライン、ローテーター、ラウンドラインメーターが含まれます。これらのメーターがメジャーの現在の値が27%であることを認識するためには、100%がどの値を表しているのかを知る必要があります。さらに、メジャーの現在の合計値に対するパーセンテージを文字列メーターで表示したり、メジャーのパーセンテージ値を数式で使用したりすることもできます。

The percentage of the total that a measure's current value reflects is based on the "range" that the measure can be. This is defined as the MinValue and MaxValue of the measure.メジャーの現在値が反映する合計に対する割合は、そのメジャーが取り得る「範囲」に基づいています。これは次のように定義されMinValueプロパティMaxValueを測定します。

Some measures, for example CPU, FreeDiskSpace and Memory, automatically set the minimum and maximum range that the measure can be. FreeDiskSpace for instance knows how big the drive you are measuring is, and will set the MinValue to zero, and the MaxValue to the actual size of the drive. Then you can just use the measure's value in a meter by binding the measure to it with MeasureName=MyMeasure and the percentage will be used in the display of the meter. There is nothing you need to do for this to work properly.CPU、FreeDiskSpace、Memoryなどの一部の測定値は、その測定値の最小範囲と最大範囲を自動的に設定します。たとえばFreeDiskSpaceは、測定しているドライブの大きさを認識しており、MinValueをゼロに、MaxValueをドライブの実際のサイズに設定します。次に、メジャーをそれにバインドすることによって、メーター内のメジャーの値を使用することができMeasureName=MyMeasure、パーセンテージがメーターの表示に使用されます。これが正しく機能するために必要なことは何もありません。

Other measures do not know themselves what the maximum value the measure can be. Examples of this are the NetIn/NetOut/NetTotal measures, SpeedFan, any Calc measures, and any WebParser measures. What Rainmeter will do in this case is to set the MinValue and MaxValue of the measure dynamically, to the smallest and largest values the measure has been since the skin was loaded or refreshed. This may not always be the behavior you desire.他の測定値は、その測定値が最大値になる可能性があることを自分では知りません。この例としては、NetIn / NetOut / NetTotalメジャー、SpeedFan、Calcメジャー、WebParserメジャーなどがあります。この場合にRainmeterが実行するのは、メジャーのMinValueとMaxValueを、スキンがロードまたは更新されてからメジャーが受けた最小値と最大値に動的に設定することです。これは必ずしもあなたが望む行動ではないかもしれません。

To address this, you can manually define the range that the measure can be, by setting the MinValue and MaxValue options on the measure. Remember, you set this on the measure you are going to use as a percentage, not on the meter that is using it.これに対処するには、手動で設定することで、対策が可能な範囲を定義することができますMinValueプロパティMaxValueを対策のオプションを。覚えておいて、あなたはそれを使用しているメーターではなく、パーセンテージとして使用しようとしているメジャーにこれを設定します。

For example:例えば:

[MeasureCPUTemp]
Measure=Plugin
Plugin=SpeedFanPlugin
SpeedFanType=TEMPERATURE
SpeedFanScale=C
SpeedFanNumber=2
MinValue=30
MaxValue=100

[MeterCPUTempBar]
Meter=Bar
MeasureName=MeasureCPUTemp

While the String meter does not require a percentage when displaying the number value of a measure, it can be told to use the value as a percentage, by using the Percentual option on the meter. The meter will then use the MinValue and MaxValue of the measure to calculate what percentage of that the current value is.一方で文字列の指標の数値を表示するときにメーターが割合を必要としない、使用することによって、割合として値を使用するように指示することができPercentualのメーターのオプションを選択します。メーターは、メジャーのMinValueとMaxValueを使用して、現在の値が何パーセントであるかを計算します。

In addition, you can use the percentage value of a measure in a formula or String meter by using the measure as a Section Variable, with the percentage parameter.さらに、percentageパラメータを使用して数値データをセクション変数として使用することで、数式または文字列メーターで数値データのパーセント値を使用できます

Setting these options has no effect on the actual value of the measure, but only defines the low and high range, to used by meters.これらのオプションを設定しても、メジャーの実際の値には影響しませんが、メーターで使用される下限と上限の範囲のみが定義されます。

Note: The current MinValue / MaxValue "range" for a measure can be viewed in the Skins tab of the About window. This can be useful for debugging problems when you are not getting the meter output you expect.注:メジャーの現在のMinValue / MaxValueの "範囲"は、[バージョン情報] ウィンドウの[スキン]タブで確認できます。あなたが期待したメーター出力を得ていないとき、これは問題をデバッグするのに役に立ちます。

Order注文

Each time the skin updates, all measures in the skin are evaluated in order. This means that if a measure references the value of another measure that has not been evaluated yet, it will receive the value from the previous update.スキンが更新されるたびに、スキン内のすべての測定値が順番に評価されます。これは、メジャーがまだ評価されていない別のメジャーの値を参照する場合、前回の更新からの値を受け取ることを意味します。

For example:例えば:

[MeasureCounterPlusOne]
Measure=Calc
Formula=MeasureCounter + 1

[MeasureCounter]
Measure=Calc
Formula=Counter

The intent is for [MeasureCounterPlusOne] to add one to the value of [MeasureCounter], so that it is always greater than [MeasureCounter]. If the measures were in the opposite order, this would work. However, because [MeasureCounterPlusOne] is evaluated before [MeasureCounter], it will only add to the old, "outdated" value, and the two measures will remain equal.その意図は[MeasureCounterPlusOne]が[MeasureCounter]の値に1を加えることであるため、常に[MeasureCounter]より大きくなります。対策が逆の順序で行われている場合は、これでうまくいきます。ただし、[MeasureCounterPlusOne]は[MeasureCounter]の前に評価されるため、古い "古い"値に追加されるだけで、2つのメジャーは等しくなります。

関連記事

スポンサーリンク

親要素で指定したスタイルが表要素に継承しない

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る