示例#1
0
文件: TIME.cs 项目: Pravin044/TwinCat
        public static bool TryParse(string str, out TIME ret)
        {
            uint milliseconds = 0;

            if (PlcOpenTimeConverter.TryParseToMilliseconds(str, out milliseconds))
            {
                ret = new TIME(milliseconds);
                return(true);
            }
            ret = null;
            return(false);
        }
示例#2
0
 public static TimeSpan ValueToTime(uint timeValue) =>
 PlcOpenTimeConverter.MillisecondsToTimeSpan(timeValue);
示例#3
0
 public static long TimeToValue(TimeSpan time) =>
 ((long)PlcOpenTimeConverter.ToMilliseconds(time));
示例#4
0
 public static TimeSpan ToTimeSpan(uint ticks) =>
 PlcOpenTimeConverter.MillisecondsToTimeSpan(ticks);
示例#5
0
 internal static uint ToTicks(TimeSpan span) =>
 PlcOpenTimeConverter.ToMilliseconds(span);
示例#6
0
 internal static string ToString(uint ticks) =>
 ToString(PlcOpenTimeConverter.MillisecondsToTimeSpan(ticks));
示例#7
0
文件: TIME.cs 项目: Pravin044/TwinCat
 public override string ToString() =>
 PlcOpenTimeConverter.MillisecondsToString(base.internalTimeValue);
示例#8
0
文件: TIME.cs 项目: Pravin044/TwinCat
 public TIME(int days, int hours, int minutes, int seconds, int milliseconds)
 {
     base.internalTimeValue = PlcOpenTimeConverter.ToMilliseconds(new TimeSpan(days, hours, minutes, seconds, milliseconds));
 }
示例#9
0
文件: TIME.cs 项目: Pravin044/TwinCat
 public TIME(int seconds, int milliseconds)
 {
     base.internalTimeValue = PlcOpenTimeConverter.ToMilliseconds(new TimeSpan(0, 0, seconds, milliseconds));
 }
示例#10
0
 public static TimeSpan ValueToTime(ulong nanoseconds) =>
 PlcOpenTimeConverter.NanosecondsToTimeSpan(nanoseconds);
示例#11
0
 public static ulong TimeToValue(TimeSpan time) =>
 PlcOpenTimeConverter.ToNanoseconds(time);