blob: 46cecd74006f27b5030e8c48b26b8478112383ca (
plain)
| ofs | hex dump | ascii |
|---|
| 0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 01 90 00 00 02 14 08 06 00 00 00 34 76 7a | .PNG........IHDR.............4vz |
| 0020 | 9f 00 00 00 01 73 52 47 42 00 ae ce 1c e9 00 00 00 04 67 41 4d 41 00 00 b1 8f 0b fc 61 05 00 00 | .....sRGB.........gAMA......a... |
| 0040 | 00 09 70 48 59 73 00 00 40 f3 00 00 40 f3 01 72 63 37 d4 00 00 00 58 74 45 58 74 43 6f 70 79 72 | ..pHYs..@...@..rc7....XtEXtCopyr |
| 0060 | 69 67 68 74 00 43 43 30 20 50 75 62 6c 69 63 20 44 6f 6d 61 69 6e 20 44 65 64 69 63 61 74 69 6f | ight.CC0.Public.Domain.Dedicatio |
| 0080 | 6e 20 68 74 74 70 3a 2f 2f 63 72 65 61 74 69 76 65 63 6f 6d 6d 6f 6e 73 2e 6f 72 67 2f 70 75 62 | n.http://creativecommons.org/pub |
| 00a0 | 6c 69 63 64 6f 6d 61 69 6e 2f 7a 65 72 6f 2f 31 2e 30 2f c6 e3 bd f9 00 00 00 19 74 45 58 74 53 | licdomain/zero/1.0/........tEXtS |
| 00c0 | 6f 66 74 77 61 72 65 00 70 61 69 6e 74 2e 6e 65 74 20 34 2e 30 2e 31 37 33 6e 9f 63 00 00 ff 1c | oftware.paint.net.4.0.173n.c.... |
| 00e0 | 49 44 41 54 78 5e ec 9d 07 b8 1d 55 d5 fe ff 7e d2 41 9a 28 20 0a 02 16 54 04 45 6c a8 14 bb a8 | IDATx^.....U...~.A.(....T.El.... |
| 0100 | 9f 15 fd ac a8 a4 dd f4 4a 7a 6e 7a 6f 90 84 54 4a 08 81 00 01 42 02 04 02 09 bd 88 22 8a 82 0a | ........Jzusing System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using Tango.Integration.Observables;
namespace Tango.MachineStudio.Developer.Converters
{
public class SegmentLengthToWidthConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
try
{
if (values.Length == 4)
{
Job job = values[0] as Job;
if (job != null && values[1] is double)
{
double jobLength = System.Convert.ToDouble(values[1]);
double elementWidth = System.Convert.ToDouble(values[2]);
double segmentLength = System.Convert.ToDouble(values[3]);
double totalLength = job.Length;
return (segmentLength / totalLength) * elementWidth;
}
else
{
return 0d;
}
}
else
{
return 0d;
}
}
catch
{
return 0d;
}
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
|