void RefreshDistances() { // wird aufgerufen, wenn sich die Anzahl geändert hat // alle Längen werden gleich vorbesetzt. if (sections.Count < number) { // nur verlängern, nicht kürzen for (int i = sections.Count; i < number; ++i) { sections.Add(0.0); } } for (int i = 0; i < sections.Count; ++i) { sections[i] = 1.0 / (double)number; } // die Untereinträge mit den Längen werden erzeugt DoubleProperty[] doubleproperties = new DoubleProperty[number]; for (int i = 0; i < number; ++i) { DoubleProperty doubleProperty = new DoubleProperty("Constr.SplitCurve.Distance", Frame); doubleProperty.LabelText = StringTable.GetFormattedString("Constr.SplitCurve.Distance" + ".Label", i + 1); doubleProperty.UserData.Add("Index", i); doubleProperty.GetDoubleEvent += new DoubleProperty.GetDoubleDelegate(OnGetDistance); doubleProperty.SetDoubleEvent += new DoubleProperty.SetDoubleDelegate(OnSetDistance); doubleproperties[i] = doubleProperty; } distances.SetShowProperties(doubleproperties); for (int i = 0; i < number; ++i) { DoubleProperty doubleProperty = doubleproperties[i] as DoubleProperty; doubleProperty.Refresh(); } }
/// <summary> /// Base Class for all Tools. /// Creates the field: Properties. /// </summary> public Tool() : base() { DoubleProperty executionTimeMs = new DoubleProperty("ExecutionTimeMs", true); executionTimeMs.Tolerance = new Tolerance<double>(0, 1000); AddChild(executionTimeMs); }
public void Initialize_DoubleProperty() { IBusinessObjectNumericProperty property = new DoubleProperty( GetPropertyParameters(GetPropertyInfo(typeof(ClassWithAllDataTypes), "Double"), _businessObjectProvider)); Assert.That(property.Type, Is.SameAs(typeof(Double))); Assert.That(property.AllowNegative, Is.True); }
private void OnSetLeftPos(DoubleProperty sender, double l) { double w = section.Width; section.Left = l; section.Right = l + w; SetSection(); }
private void OnSetBottomPos(DoubleProperty sender, double l) { double h = section.Height; section.Bottom = l; section.Top = l + h; SetSection(); }
private void OnSetPattern(DoubleProperty sender, double l) { double[] oldPattern = (double[])pattern.Clone(); int ind = (int)sender.UserData.GetData("Index"); pattern[ind] = l; FireDidChange("Pattern", oldPattern); }
public CheckIntensity() { DisplayName = "Check Intensity"; AddChild(new RectangleProperty("AOI", 0.0, 0.0, 100.0, 100.0)); AddChild(new ImageProperty("InputImage", false)); AddChild(new ImageProperty("OuputImage", true)); DoubleProperty intensityProperty = new DoubleProperty("Intensity", true); intensityProperty.Tolerance = new Tolerance<double>(0, 100); AddChild(intensityProperty); }
public override bool Initialize() { base.Initialize(); _aoiProperty = GetProperty("AOI") as RectangleProperty; _inputImage = GetProperty("InputImage") as ImageProperty; _outputImage = GetProperty("OuputImage") as ImageProperty; _intensityProperty = GetProperty("Intensity") as DoubleProperty; return true; }
public override bool Initialize() { base.Initialize(); _imageInput = GetProperty("ImageInput") as ImageProperty; _redCoefficient = GetProperty("RedCoefficient") as DoubleProperty; _greenCoefficient = GetProperty("GreenCoefficient") as DoubleProperty; _blueCoefficient = GetProperty("BlueCoefficient") as DoubleProperty; _imageOutput = GetProperty("ImageOutput") as ImageProperty; return true; }
public void WhenProvingACustomNumberFormatShouldReturnValuesForThatFormat() { const double DoubleProperty = 13.8; FormatableObject formatableObject = new FormatableObject { DoubleProperty = DoubleProperty }; string str = formatableObject.ToString("{DoubleProperty:F}"); str.Should().Be(DoubleProperty.ToString("F"), "because we are using a format string to get the value of the 'DoubleProperty' property with a format"); }
public override bool Initialize() { base.Initialize(); _imageInput = GetProperty("ImageInput") as ImageProperty; _kernelSize = GetProperty("KernelSize") as IntegerProperty; _spatialFactor = GetProperty("SpatialFactor") as IntegerProperty; _colorFactor = GetProperty("ColorFactor") as IntegerProperty; _colorPower = GetProperty("ColorPower") as DoubleProperty; _imageOutput = GetProperty("ImageOutput") as ImageProperty; return true; }
private double OnGetVerPos(DoubleProperty sender) { BoundingRect ext = Model.GetExtent(Projection); if (ext.IsEmpty()) { ext.MinMax(new GeoPoint2D(0.0, 0.0)); } double factor, dx, dy; Projection.GetPlacement(out factor, out dx, out dy); return(ext.Bottom * factor + dy); }
private void OnSetVerPos(DoubleProperty sender, double l) { BoundingRect ext = Model.GetExtent(Projection); if (ext.IsEmpty()) { ext.MinMax(new GeoPoint2D(0.0, 0.0)); } double factor, dx, dy; Projection.GetPlacement(out factor, out dx, out dy); Projection.SetPlacement(factor, dx, l - ext.Bottom * factor); layoutView.Repaint(); }
public double GetDoubleProperty(string name, int index = 0, double?defaultValue = null) { DoubleProperty p = GetPropertyByName <DoubleProperty>(name, index); if (p == null && defaultValue == null) { throw new Exception($"No values found for {name}:{index}, and no defaults were given!"); } else if (p == null) { return(defaultValue.Value); } else { return(p.value); } }
double OnGetDistance(DoubleProperty sender) { // der Index steht in UserData int index = (int)sender.UserData.GetData("Index"); double factor = 1.0; switch (mode) { case 0: // prozent, 0.x*100 factor = 100; break; case 1: factor = theCurve.Length; break; } return(factor * sections[index]); }
public override IPropertyEntry GetPropertyEntry(IFrame frame) { List <IPropertyEntry> se = new List <IPropertyEntry>(); GeoPointProperty centerprop = new GeoPointProperty(frame, "SphericalSurface.Center"); centerprop.ReadOnly = true; centerprop.OnGetValue = new EditableProperty <GeoPoint> .GetValueDelegate(delegate() { return(center); }); se.Add(centerprop); DoubleProperty radius = new DoubleProperty(frame, "SphericalSurface.Radius"); radius.ReadOnly = true; radius.OnGetValue = new EditableProperty <double> .GetValueDelegate(delegate() { return(xAxis.Length); }); radius.Refresh(); se.Add(radius); return(new GroupProperty("SphericalSurface", se.ToArray())); }
public EntityViewModel(Entity entity) { Entity = entity; Width = new DoubleProperty(nameof(Width), () => Entity.Width, w => Entity.Width = w); Height = new DoubleProperty(nameof(Height), () => Entity.Height, h => Entity.Height = h); PropertyCategory size = new PropertyCategory("size"); size.Properties.Add(Width); size.Properties.Add(Height); Categories.Add(size); }
//private VdsGameActor _loadGameActor = null; public HelloWorld() { TestInt = new IntProperty(); TestInt.Value = 1; TestIntList = new IntListProperty(); TestIntList.ValueList.Add(1); TestIntList.ValueList.Add(2); TestDouble = new DoubleProperty(); TestDouble.Value = 2.0; TestDoubleList = new DoubleListProperty(); TestDoubleList.ValueList.Add(3.0); TestDoubleList.ValueList.Add(4.0); TestString = new StringProperty(); TestString.Value = "5"; TestStringList = new StringListProperty(); TestStringList.ValueList.Add("6"); TestStringList.ValueList.Add("7"); TestBool = new BoolProperty(); TestBool.Value = true; //TestBoolList = new BoolListProperty(); //TestBoolList.ValueList.Add(false); //TestBoolList.ValueList.Add(true); TestVec2 = new VdsVec2d(8, 9); TestVec2List = new VdsVec2dList(); TestVec2List.ValueList.Add(new VdsVec2d(10, 11)); TestVec2List.ValueList.Add(new VdsVec2d(12, 13)); TestVec3 = new VdsVec3d(14, 15, 16); TestVec3List = new VdsVec3dList(); TestVec3List.ValueList.Add(new VdsVec3d(17, 18, 19)); TestVec3List.ValueList.Add(new VdsVec3d(20, 21, 22)); TestVec4 = new VdsVec4d(23, 24, 25, 26); TestVec4List = new VdsVec4dList(); TestVec4List.ValueList.Add(new VdsVec4d(27, 28, 29, 30)); TestVec4List.ValueList.Add(new VdsVec4d(31, 32, 33, 34)); TestFilePath = new FilePathProperty(); TestFilePath.Value = "35"; TestEnum = new EnumProperty(); TestEnum.ValueList.Add("36"); TestEnum.ValueList.Add("37"); }
private double OnGetLeftPos(DoubleProperty sender) { return(section.Left); }
private void OnSetHeight(DoubleProperty sender, double l) { section.Top = section.Bottom + l; SetSection(); }
private void OnSetWidth(DoubleProperty sender, double l) { section.Right = section.Left + l; SetSection(); }
public static Property Clone(Property target) { Property prop = null; int id = target.PropertyId; PropertyBag bag = target.Owner; switch (target.PropertyType) { case (int)PropertyKind.WispObject: prop = new WispProperty(target.Name, id, ((WispProperty)target).Value, bag); break; case (int)PropertyKind.WispArray: prop = new WispArrayProperty(target.Name, id, ((WispArrayProperty)target).Value, bag); break; case (int)PropertyKind.Int32: prop = new Int32Property(target.Name, id, ((Int32Property)target).Value, bag); break; case (int)PropertyKind.String: prop = new StringProperty(target.Name, id, ((StringProperty)target).Value, bag); break; case (int)PropertyKind.Bool: prop = new BoolProperty(target.Name, id, ((BoolProperty)target).Value, bag); break; case (int)PropertyKind.Guid: prop = new GuidProperty(target.Name, id, ((GuidProperty)target).Value, bag); break; case (int)PropertyKind.Single: prop = new SingleProperty(target.Name, id, ((SingleProperty)target).Value, bag); break; case (int)PropertyKind.Int32Array: prop = new Int32ArrayProperty(target.Name, id, ((Int32ArrayProperty)target).Value, bag); break; case (int)PropertyKind.StringArray: prop = new StringArrayProperty(target.Name, id, ((StringArrayProperty)target).Value, bag); break; case (int)PropertyKind.DateTime: prop = new DateTimeProperty(target.Name, id, ((DateTimeProperty)target).Value, bag); break; case (int)PropertyKind.GuidArray: prop = new GuidArrayProperty(target.Name, id, ((GuidArrayProperty)target).Value, bag); break; case (int)PropertyKind.Double: prop = new DoubleProperty(target.Name, id, ((DoubleProperty)target).Value, bag); break; case (int)PropertyKind.Byte: prop = new ByteProperty(target.Name, id, ((ByteProperty)target).Value, bag); break; case (int)PropertyKind.Component: prop = new ComponentProperty(target.Name, id, ((ComponentProperty)target).Value, bag); break; case (int)PropertyKind.SingleArray: prop = new SingleArrayProperty(target.Name, id, ((SingleArrayProperty)target).Value, bag); break; case (int)PropertyKind.Int64: prop = new Int64Property(target.Name, id, ((Int64Property)target).Value, bag); break; case (int)PropertyKind.ComponentArray: prop = new ComponentArrayProperty(target.Name, id, ((ComponentArrayProperty)target).Value, bag); break; case (int)PropertyKind.DateTimeArray: prop = new DateTimeArrayProperty(target.Name, id, ((DateTimeArrayProperty)target).Value, bag); break; case (int)PropertyKind.ByteArray: prop = new ByteArrayProperty(target.Name, id, ((ByteArrayProperty)target).Value, bag); break; case (int)PropertyKind.DoubleArray: prop = new DoubleArrayProperty(target.Name, id, ((DoubleArrayProperty)target).Value, bag); break; case (int)PropertyKind.Int16Array: prop = new Int16ArrayProperty(target.Name, id, ((Int16ArrayProperty)target).Value, bag); break; case (int)PropertyKind.Int16: prop = new Int16Property(target.Name, id, ((Int16Property)target).Value, bag); break; case (int)PropertyKind.Int64Array: prop = new Int64ArrayProperty(target.Name, id, ((Int64ArrayProperty)target).Value, bag); break; case (int)PropertyKind.BoolArray: prop = new BoolArrayProperty(target.Name, id, ((BoolArrayProperty)target).Value, bag); break; } prop.Name = target.Name; return prop; }
private double OnGetPaperWidth(DoubleProperty sender) { return(layout.PaperWidth); }
public override bool Initialize() { base.Initialize(); _imageInput = GetProperty("ImageInput") as ImageProperty; _maxBlue = GetProperty("MaxBlue") as IntegerProperty; _minBlue = GetProperty("MinBlue") as IntegerProperty; _medianBlue = GetProperty("MedianBlue") as IntegerProperty; _meanBlue = GetProperty("MeanBlue") as DoubleProperty; _stdDevBlue = GetProperty("StdDevBlue") as DoubleProperty; _maxGreen = GetProperty("MaxGreen") as IntegerProperty; _minGreen = GetProperty("MinGreen") as IntegerProperty; _medianGreen = GetProperty("MedianGreen") as IntegerProperty; _meanGreen = GetProperty("MeanGreen") as DoubleProperty; _stdDevGreen = GetProperty("StdDevGreen") as DoubleProperty; _maxRed = GetProperty("MaxRed") as IntegerProperty; _minRed = GetProperty("MinRed") as IntegerProperty; _medianRed = GetProperty("MedianRed") as IntegerProperty; _meanRed = GetProperty("MeanRed") as DoubleProperty; _stdDevRed = GetProperty("StdDevRed") as DoubleProperty; return true; }
public void SetValue(object value) { string typeName = value.GetType().ToString(); switch (typeName) { case "byte": { if (type == EPropertyType.EPropertyType_Byte) { ByteProperty prop = this as ByteProperty; prop.SetValue((byte)value); return; } } break; case "bool": { if (type == EPropertyType.EPropertyType_Bool) { BoolProperty prop = this as BoolProperty; prop.SetValue((bool)value); return; } } break; case "short": { if (type == EPropertyType.EPropertyType_Short) { ShortProperty prop = this as ShortProperty; prop.SetValue((short)value); return; } } break; case "int": { if (type == EPropertyType.EPropertyType_Int) { IntProperty prop = this as IntProperty; prop.SetValue((int)value); return; } } break; case "long": { if (type == EPropertyType.EPropertyType_Long) { LongProperty prop = this as LongProperty; prop.SetValue((long)value); return; } } break; case "float": { if (type == EPropertyType.EPropertyType_Float) { FloatProperty prop = this as FloatProperty; prop.SetValue((float)value); return; } } break; case "double": { if (type == EPropertyType.EPropertyType_Double) { DoubleProperty prop = this as DoubleProperty; prop.SetValue((double)value); return; } } break; case "Vector2": { if (type == EPropertyType.EPropertyType_Vector2) { Vector2Property prop = this as Vector2Property; prop.SetValue((Vector2)value); return; } } break; case "Vector3": { if (type == EPropertyType.EPropertyType_Vector3) { Vector3Property prop = this as Vector3Property; prop.SetValue((Vector3)value); return; } } break; case "Vector4": { if (type == EPropertyType.EPropertyType_Vector4) { Vector4Property prop = this as Vector4Property; prop.SetValue((Vector4)value); return; } } break; case "Quaternion": { if (type == EPropertyType.EPropertyType_Quaternion) { QuaternionProperty prop = this as QuaternionProperty; prop.SetValue((Quaternion)value); return; } } break; case "Matrix4x4": { if (type == EPropertyType.EPropertyType_Matrix4x4) { Matrix4x4Property prop = this as Matrix4x4Property; prop.SetValue((Matrix4x4)value); return; } } break; case "Color": { if (type == EPropertyType.EPropertyType_Color) { ColorProperty prop = this as ColorProperty; prop.SetValue((Color)value); return; } } break; case "string": { if (type == EPropertyType.EPropertyType_String) { StringProperty prop = this as StringProperty; prop.SetValue((string)value); return; } } break; case "object": { if (type == EPropertyType.EPropertyType_Object) { m_value = value; return; } } break; } return; }
public bool equals(DoubleProperty other) { return(this.GetValue() == other.GetValue()); }
private double OnGetBottomPos(DoubleProperty sender) { return(section.Bottom); }
private void OnSetDx(DoubleProperty sender, double l) { dx = l; }
private double OnGetWidth(DoubleProperty sender) { return(section.Width); }
private void OnSetDy(DoubleProperty sender, double l) { dy = l; }
private double OnGetHeight(DoubleProperty sender) { return(section.Height); }
public override bool Initialize() { _executionTimeMs = GetProperty("ExecutionTimeMs") as DoubleProperty; return base.Initialize(); }
private void OnSetPaperWidth(DoubleProperty sender, double l) { layout.PaperWidth = l; }
public Compass() { Compass compass = this; this.__\u003C\u003Ecircumference = new DoubleProperty((PropertyHolder) this, "Circumference", 360.0); this.__\u003C\u003EringColor = new ColorProperty((PropertyHolder) this, "Ring Color", (Color) Color.YELLOW); this.data = new DefaultValueDataset(0.0); }
public ProgressBar() { ProgressBar progressBar = this; this.__\u003C\u003Eforeground = new ColorProperty((PropertyHolder) this, "Foreground"); this.__\u003C\u003Ebackground = new ColorProperty((PropertyHolder) this, "Background"); this.__\u003C\u003Emax = new DoubleProperty((PropertyHolder) this, "Maximum", 100.0); this.__\u003C\u003Emin = new DoubleProperty((PropertyHolder) this, "Minimum", 0.0); }
private double OnGetPaperHeight(DoubleProperty sender) { return(layout.PaperHeight); }
set => SetValue(DoubleProperty, value);
private void OnSetPaperHeight(DoubleProperty sender, double l) { layout.PaperHeight = l; }
private double OnGetDy(DoubleProperty sender) { return(YDistance); }
public static void GetElementTypeString(DoubleProperty obj, MethodReturnEventArgs<string> e) { e.Result = "double"; PropertyActions.DecorateElementType(obj, e, true); }
void OnSetDistance(DoubleProperty sender, double l) { // benutzereingabe für eine bestimmte Länge // der Index geht über Userdate int index = (int)sender.UserData.GetData("Index"); double factor = 1.0; switch (mode) { case 0: // prozent, 0.x*100 factor = 100; break; case 1: factor = theCurve.Length; break; } sections[index] = Math.Min(1.0, l / factor); // höchstens 1.0 // im Folgenden werden alle anderen Werte so geändert, dass die Summe 1.0 ergibt. // Es werden erst die folgenden Werte verändert, wenn das nicht reicht die vorhergehenden double sum = 0.0; for (int i = 0; i < number; ++i) { sum += sections[i]; } if (sum > 1.0) { // zu groß, die folgenden kleiner machen double toreduce = sum - 1.0; for (int i = index + 1; i < number; ++i) { if (sections[i] > toreduce) { sections[i] -= toreduce; toreduce = 0.0; break; } else { toreduce -= sections[i]; sections[i] = 0.0; } } if (toreduce > 0.0) { // immer noch zu groß, vorne anfangen for (int i = 0; i < index; ++i) { if (sections[i] > toreduce) { sections[i] -= toreduce; toreduce = 0.0; break; } else { toreduce -= sections[i]; sections[i] = 0.0; } } } } else if (sum < 1.0) { // zu klein, einfach den folgenden Wert entsprechend vergrößern double toadd = 1.0 - sum; int nextindex = index + 1; if (nextindex >= number) { nextindex = 0; } sections[nextindex] += toadd; } // alle Werte bis auf diesen updaten. IPropertyEntry[] sub = distances.GetShowProperties(); for (int i = 0; i < sub.Length; ++i) { if (i != index) { (sub[i] as DoubleProperty).Refresh(); } } Recalc(); }
public static void GetPropertyType(DoubleProperty obj, MethodReturnEventArgs<Type> e) { e.Result = typeof(double); PropertyActions.DecorateParameterType(obj, e, true, obj.IsList, obj.HasPersistentOrder); }
public static void GetPropertyTypeString(DoubleProperty obj, MethodReturnEventArgs<string> e) { GetElementTypeString(obj, e); PropertyActions.DecorateParameterType(obj, e, true, obj.IsList, obj.HasPersistentOrder); }
public SimpleDial() : base(0.0) { SimpleDial simpleDial = this; this.__\u003C\u003Emax = new DoubleProperty((PropertyHolder) this, "Upper Limit", 100.0); this.__\u003C\u003Emin = new DoubleProperty((PropertyHolder) this, "Lower Limit", 0.0); this.__\u003C\u003EtickInterval = new DoubleProperty((PropertyHolder) this, "Tick Interval", 10.0); ((Container) this).setLayout((LayoutManager) new BorderLayout()); MeterPlot.__\u003Cclinit\u003E(); this.m_meter = new MeterPlot((ValueDataset) this.getDataset()); this.m_plotRange = new Range(this.__\u003C\u003Emin.getValue().doubleValue(), this.__\u003C\u003Emax.getValue().doubleValue()); this.m_meter.setRange(this.m_plotRange); JFreeChart.__\u003Cclinit\u003E(); this.chartPanel = (JPanel) new ChartPanel(new JFreeChart(this.getFieldName(), JFreeChart.__\u003C\u003EDEFAULT_TITLE_FONT, (Plot) this.m_meter, false)); ((JComponent) this.chartPanel).setPreferredSize(new Dimension(250, 150)); this.propertyChanged((Property) this.__\u003C\u003EtickInterval); ((Container) this).add((Component) this.chartPanel, (object) "Center"); }