Jump to content

Recommended Posts

  • Members

I have a condition that represent unit procedures. These capsules come from a batch execution system connector. Each capsule in the condition contains a property called 'Max Temperature'. I am trying to create a condition that just have the hot capsules. I am using a Seeq formula and filter to do this. Here's my formula:

$c.filter( $cap ->
   $cap.getProperty('Max Temperature').isGreaterThan(170) 
)

I don't get any errors from this formula, but, I don't get any results. I know some of the max temperatures are higher than 170 because I can view that in the Seeq Details pane:
10.PNG.b9a6fd20e0f19b6fa204c8cd6e6c4f3f.PNG

What am I doing wrong?

 

Link to comment
Share on other sites

Guest Jon Peterson

This is a common issue when using capsule properties. In Seeq properties are always stored as strings. So, before you can filter based on limits you need to convert the property to a number. This should fix the issue:

$c.filter( $cap ->
   $cap.getProperty('Max Temperature').toNumber().isGreaterThan(170) 
)

You may want to go one step further and set the UOM. Assuming this is degrees

$c.filter( $cap ->
   $cap.getProperty('Max Temperature').toNumber().setUnits('C').isGreaterThan(170C) 
)

Make sure you put the proper units on the value in the isGreaterThan function. 

 

 

image.png

Link to comment
Share on other sites

Another cool thing you do with Seeq is create a signal from the capsule properties. Here's an example:

$a.transformToSamples( $cap -> 
  Sample( $cap.getMiddle(), $cap.getProperty('Max Temperature').toNumber().setUnits('C') ), 6h ).toStep()

Note the toStep() is often used when plotting values that apply to a capsule (max temperature in this case. 

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...