当前位置: 首页>>代码示例>>C#>>正文


C# Altaxo.ToDouble方法代码示例

本文整理汇总了C#中Altaxo.ToDouble方法的典型用法代码示例。如果您正苦于以下问题:C# Altaxo.ToDouble方法的具体用法?C# Altaxo.ToDouble怎么用?C# Altaxo.ToDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Altaxo的用法示例。


在下文中一共展示了Altaxo.ToDouble方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetScaleOrgEnd

		protected override string SetScaleOrgEnd(Altaxo.Data.AltaxoVariant org, Altaxo.Data.AltaxoVariant end)
		{
			double o = org.ToDouble();
			double e = end.ToDouble();

			if (!(o < e))
				return "org is not less than end";

			InternalSetOrgEnd(o, e, false, false);

			return null;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:12,代码来源:LinearScale.cs

示例2: Add

 public override bool Add(Altaxo.Data.AltaxoVariant val)
 {
   return Add(val.ToDouble());
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:4,代码来源:PositiveFiniteNumericalBoundaries.cs

示例3: PhysicalVariantToNormal

		/// <summary>
		/// PhysicalVariantToNormal translates physical values into a normal value linear along the axis
		/// a physical value of the axis origin must return a value of zero
		/// a physical value of the axis end must return a value of one
		/// the function physicalToNormal must be provided by any derived class
		/// </summary>
		/// <param name="x">the physical value</param>
		/// <returns>
		/// the normalized value linear along the axis,
		/// 0 for axis origin, 1 for axis end</returns>
		public override double PhysicalVariantToNormal(Altaxo.Data.AltaxoVariant x)
		{
			return PhysicalToNormal(x.ToDouble());
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:14,代码来源:LinearScale.cs

示例4: ProcessDataBounds

		public override void ProcessDataBounds(Altaxo.Data.AltaxoVariant org, bool orgfixed, Altaxo.Data.AltaxoVariant end, bool endfixed)
		{
			double dorg = org.ToDouble();
			double dend = end.ToDouble();

			if (!orgfixed)
			{
				dorg = Math.Ceiling(dorg) - 0.5;
			}
			if (!endfixed)
			{
				dend = Math.Floor(dend) + 0.5;
			}

			bool changed = false;
			changed |= _cachedAxisOrg != dorg;
			_cachedAxisOrg = dorg;

			changed |= _cachedAxisEnd != dend;
			_cachedAxisEnd = dend;

			changed |= _cachedAxisSpan != (dend - dorg);
			_cachedAxisSpan = dend - dorg;

			changed |= _cachedOneByAxisSpan != (1 / _cachedAxisSpan);
			_cachedOneByAxisSpan = 1 / _cachedAxisSpan;

			if (changed)
				OnChanged();
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:30,代码来源:TextScale.cs

示例5: PhysicalVariantToNormal

		public override double PhysicalVariantToNormal(Altaxo.Data.AltaxoVariant x)
		{
			if (x.IsType(Altaxo.Data.AltaxoVariant.Content.VString))
			{
				int idx = _dataBounds.IndexOf(x.ToString());
				return idx < 0 ? double.NaN : (1 + idx - _cachedAxisOrg) * _cachedOneByAxisSpan;
			}
			else if (x.CanConvertedToDouble)
			{
				return (x.ToDouble() - _cachedAxisOrg) * _cachedOneByAxisSpan;
			}
			else
			{
				return double.NaN;
			}
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:16,代码来源:TextScale.cs

示例6: Add

 public override bool Add(Altaxo.Data.AltaxoVariant item)
 {
   return Add(item.ToDouble());
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:4,代码来源:FiniteNumericalBoundaries.cs

示例7: PhysicalVariantToNormal

		/// <summary>
		/// PhysicalVariantToNormal translates physical values into a normal value linear along the axis
		/// a physical value of the axis origin must return a value of zero
		/// a physical value of the axis end must return a value of one
		/// the function physicalToNormal must be provided by any derived class
		/// </summary>
		/// <param name="x">the physical value</param>
		/// <returns>
		/// the normalized value linear along the axis,
		/// 0 for axis origin, 1 for axis end</returns>
		public override double PhysicalVariantToNormal(Altaxo.Data.AltaxoVariant x)
		{
			if (x.IsType(AltaxoVariant.Content.VDateTime))
				return PhysicalToNormal((DateTime)x);
			else if (x.CanConvertedToDouble)
				return PhysicalToNormal(new DateTime((long)(x.ToDouble() * 10000000)));
			else throw new ArgumentException("Variant x is neither DateTime nor numeric");
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:18,代码来源:DateTimeScale.cs

示例8: SetScaleOrgEnd

		protected override string SetScaleOrgEnd(Altaxo.Data.AltaxoVariant org, Altaxo.Data.AltaxoVariant end)
		{
			double o = org.ToDouble();
			double e = end.ToDouble();

			InternalSetOrgEnd(o, e);

			return null;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:9,代码来源:InverseScale.cs


注:本文中的Altaxo.ToDouble方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。