Innovenergy_trunk/csharp/Lib/Units/Current.cs

20 lines
562 B
C#
Raw Normal View History

2023-05-24 10:04:01 +00:00
using InnovEnergy.Lib.SrcGen;
using InnovEnergy.Lib.SrcGen.Attributes;
2023-02-26 14:43:53 +00:00
namespace InnovEnergy.Lib.Units;
2023-05-24 10:04:01 +00:00
[Generate<Operators>][Generate<Sum>]
2023-02-26 14:43:53 +00:00
public readonly partial struct Current
{
public static String Unit => "A";
public static String Symbol => "I";
2023-05-24 10:04:01 +00:00
2023-02-26 14:43:53 +00:00
// P=UI
2023-05-04 07:36:30 +00:00
public static ActivePower operator *(Current current, Voltage voltage) => new ActivePower(current.Value * voltage.Value);
2023-02-26 14:43:53 +00:00
// U=RI
public static Voltage operator *(Current current, Resistance resistance) => new Voltage(resistance.Value* current.Value);
}