system.mes.spc.sample.createFilter(locationPath)

Sepasoft MES Module Suite

system.mes.spc.sample.createFilter(locationPath)

Create a sample filter to retrieve sample data via filter parameters. Used in conjunction with system.mes.spc.sample.getSampleList

For sort keys, see sortType Key.

Warning

Scripting Function modifications in

MES 3.79.3 RC 5 and later
MES 3.81.4 RC 4 and later

Syntax

system.mes.spc.sample.createFilter(locationPath)

  • Parameters

String locationPath - The location path (equipment path with at least one location) to use.

  • Returns

An MES Sample Filter

  • Scope

All

Code Example

Python
location_path = "Enterprise\Site 1\Area 1\Location 1"

sample_filter = system.mes.spc.sample.createFilter(location_path)
sample_filter.setSortType("Taken Date Time (Descending)")
sample_filter.setLocationPath(location_path)
sample_filter.setStartDate(system.date.addMinutes(system.date.now(), -2))
sample_filter.setEndDate(system.date.addMinutes(system.date.now(), 4))
#sample_filter.setStartDate(system.date.parse("2021-11-05 13:00:00"))
#sample_filter.setEndDate(system.date.parse("2021-11-05 23:00:00"))

sample_filter.setShowDueSamples(True)

sample_filter.setShowComingDueSamples(True)

sample_filter.setShowOverDueSamples(True)
sample_filter.setShowWaitingApproval(False)
sample_filter.setShowApprovedSamples(False)
sample_filter.setShowRemovedSamples(False)
print "State:",  sample_filter.getSampleStateTypes().getState()


results = system.mes.spc.sample.getSampleList(sample_filter)
print results.getRowCount()
print results.getColumnNames()
for i in range(results.getRowCount()):
	row = []
	for j in range(results.getColumnCount()):
		row.append(results.getValueAt(i, j))
	print row




Sepasoft MES Module Suite