Hi, <div><br></div><div>We embedded IronPython to allow users to specify custom KPIs to be calculated from plant-floor measurements. It&#39;s woking nicely. The user selects which measurements she wants, provides aliases to these and they get exposed to the expression scope as variables.</div>
<div><br></div><div>But we have two kinds of users:</div><div><br></div><div>1) People that only need the value of the measurements; they would like the variable to be the measurement value, so they could write short expressions like:</div>
<div><br></div><div>a + b * 0.2</div><div><br></div><div>2) People that want more advanced scenarios, and need more attributes of the measurement (for example, the timestamp of the data acquisition and its quality). For example:</div>
<div><br></div><div>(b.Value - a.Value) / (b.SourceTimestamp - a.SourceTimestamp).TotalMilliseconds</div><div><br></div><div>Is there a way to satisfy both scenarios? So that the object could also be evaluated implicitly as a float?</div>
<div><br></div><div>My first thought was to use a coercion, but the documentation does not recommend it. Any other suggestions please?</div><div><br></div><div>Thank you so much for the attention.</div><div><br></div><div>
Best regards!</div><div>Mello </div><div><br></div>