system.mes.spc.sample.getSampleList

Sepasoft MES Module Suite

system.mes.spc.sample.getSampleList

system.mes.spc.sample.getSampleList(sampleFilter)

system.mes.spc.sample.getSampleList(samplefilter)

Returns a sample list that matches the filter parameter. Used with system.mes.spc.sample.data.createFilter(location_path).

For sort keys, see sortType Key.

system.mes.spc.sample.getSampleList(samplefilter) → Dataset

Syntax

system.mes.spc.sample.data.getSampleList(samplefilter) 

  • Parameters

MESSampleFilter sampleFilter - MES Sample filter to use.

  • Returns

Dataset - Samples for a specified location path (equipment path with a sampling location configured).

  • 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




system.mes.spc.sample.getSampleList(locationPath, [startDate], [endDate], [productCode], [referenceNumber], [tag], [showDue], [showComingDue], [showOverDue], [showWaitingApproval], [showApproved], [showRemoved], [sortType])

system.mes.spc.sample.getSampleList(locationPath, startDate, endDate, [productCode], [referenceNumber], [tag], [showDue], [showComingDue], [showOverDue], [showWaitingApproval], [showApproved], [showRemoved], [sortType]) 

Return a sample list that matches the parameter input values.  The same data is retrieved via the Location Sample List component.

Syntax

system.mes.spc.sample.getSampleList(locationPath, startDate, endDate, [productCode], [referenceNumber], [tag], [showDue], [showComingDue], [showOverDue], [showWaitingApproval], [showApproved], [showRemoved], [sortType]) 

  • Parameters

String locationPath -The location path where the samples were collected.

Date startDate - Set samples returned should be collected after this date.

Date endDate - Set samples returned should be collected before this date.

String productCode - Optional - Samples returned should have this product code if present.

String referenceNumber - Optional -Samples returned should have this Reference Number if preset

String tag - Optional -Samples returned should have this tag if present.

Boolean showDue - Optional -Show samples that are in 'Due' status. Defaults to True.

Boolean showComingDue - Optional - Show samples that are in the 'ComingDue' status. Defaults to True.

Boolean showOverDue - Optional - Show samples that are in the 'OverDue' status. Defaults to True.

Boolean showWaitingApproval - Optional - Show samples that are in the 'WaitingApproval' status. Defaults to True.

Boolean showApproved - Optional - Show samples that are in the 'Approved' status. Defaults to False.

Boolean showRemoved - Optional - Show samples that are in the 'Removed' status. Defaults to False.

String sortType - Optional - Specify how samples returned should be sorted. See sortType Key.

  • Returns

Dataset - Samples meeting the specified filter criteria.

  • Scope

All

Code Example

Python
locationPath = 'Enterprise\\El Dorado Hills\\Packaging Area\\Packaging Line 2\\Inspection Station 1'
startDate = system.date.addHours(system.date.now(), -4)
endDate = system.date.now()

ds = system.mes.spc.sample.getSampleList(locationPath, startDate, endDate, sortType='Scheduled Start')
for row in range(ds.getRowCount()):
	for col in range(ds.getColumnCount()):
		print ds.getColumnName(col), ':', ds.getValueAt(row,col)
>>> 
DefUUID : c5cd6e9b-1173-4dce-81df-f07b270cb966
SampleUUID : 8e117278-a7bc-454e-b3a7-0d5fe17e38ac
ProductCode : None
LocationPath : Enterprise\El Dorado Hills\Packaging Area\Packaging Line 2\Inspection Station 1
Enterprise : Enterprise
Site : El Dorado Hills
Area : Packaging Area
Line : Packaging Line 2
Location : Inspection Station 1
RefNo : None
ScheduledStart : Tue Mar 14 09:07:32 PDT 2023
ScheduledFinish : Tue Mar 14 09:07:32 PDT 2023
SampleTakenDateTime : None
EntryDateTime : None
Shift : None
SequenceDate : None
Approved : 0
Exclude : 0
SampleTakenBy : None
SampleEnteredBy : None
ApprovedBy : None
ApprovedDateTime : None
Tag : None
Note : None
LastUpdated : None
State : 0
DefUUID : c5cd6e9b-1173-4dce-81df-f07b270cb966
SampleUUID : ddd7d904-ead6-419e-a795-fe5368c147ee
ProductCode : None
LocationPath : Enterprise\El Dorado Hills\Packaging Area\Packaging Line 2\Inspection Station 1
Enterprise : Enterprise
Site : El Dorado Hills
Area : Packaging Area
Line : Packaging Line 2
Location : Inspection Station 1
RefNo : None
ScheduledStart : Tue Mar 14 09:08:33 PDT 2023
ScheduledFinish : Tue Mar 14 09:08:33 PDT 2023
SampleTakenDateTime : None
EntryDateTime : None
Shift : None
SequenceDate : None
Approved : 0
Exclude : 0
SampleTakenBy : None
SampleEnteredBy : None
ApprovedBy : None
ApprovedDateTime : None
Tag : None
Note : None
LastUpdated : None
State : 0
DefUUID : c5cd6e9b-1173-4dce-81df-f07b270cb966
SampleUUID : 69540995-75e9-4df6-8579-aead56939fe4
ProductCode : None
LocationPath : Enterprise\El Dorado Hills\Packaging Area\Packaging Line 2\Inspection Station 1
Enterprise : Enterprise
Site : El Dorado Hills
Area : Packaging Area
Line : Packaging Line 2
Location : Inspection Station 1
RefNo : None
ScheduledStart : Tue Mar 14 09:09:34 PDT 2023
ScheduledFinish : Tue Mar 14 09:09:34 PDT 2023
SampleTakenDateTime : None
EntryDateTime : None
Shift : None
SequenceDate : None
Approved : 0
Exclude : 0
SampleTakenBy : None
SampleEnteredBy : None
ApprovedBy : None
ApprovedDateTime : None
Tag : None
Note : None
LastUpdated : None
State : 0
DefUUID : c5cd6e9b-1173-4dce-81df-f07b270cb966
SampleUUID : 0fbc44ab-778a-4d78-b054-1bfba5e744d3
ProductCode : None
LocationPath : Enterprise\El Dorado Hills\Packaging Area\Packaging Line 2\Inspection Station 1
Enterprise : Enterprise
Site : El Dorado Hills
Area : Packaging Area
Line : Packaging Line 2
Location : Inspection Station 1
RefNo : None
ScheduledStart : Tue Mar 14 09:10:35 PDT 2023
ScheduledFinish : Tue Mar 14 09:10:35 PDT 2023
SampleTakenDateTime : None
EntryDateTime : None
Shift : None
SequenceDate : None
Approved : 0
Exclude : 0
SampleTakenBy : None
SampleEnteredBy : None
ApprovedBy : None
ApprovedDateTime : None
Tag : None
Note : None
LastUpdated : None
State : 0
DefUUID : c5cd6e9b-1173-4dce-81df-f07b270cb966
SampleUUID : 4735daf5-4844-4ad0-8bb5-6d97b7251292
ProductCode : None
LocationPath : Enterprise\El Dorado Hills\Packaging Area\Packaging Line 2\Inspection Station 1
Enterprise : Enterprise
Site : El Dorado Hills
Area : Packaging Area
Line : Packaging Line 2
Location : Inspection Station 1
RefNo : None
ScheduledStart : Tue Mar 14 09:11:36 PDT 2023
ScheduledFinish : Tue Mar 14 09:11:36 PDT 2023
SampleTakenDateTime : None
EntryDateTime : None
Shift : None
SequenceDate : None
Approved : 0
Exclude : 0
SampleTakenBy : None
SampleEnteredBy : None
ApprovedBy : None
ApprovedDateTime : None
Tag : None
Note : None
LastUpdated : None
State : 0
DefUUID : c5cd6e9b-1173-4dce-81df-f07b270cb966
SampleUUID : 4455cc1f-2a0b-42d1-8857-6760504b6886
ProductCode : None
LocationPath : Enterprise\El Dorado Hills\Packaging Area\Packaging Line 2\Inspection Station 1
Enterprise : Enterprise
Site : El Dorado Hills
Area : Packaging Area
Line : Packaging Line 2
Location : Inspection Station 1
RefNo : None
ScheduledStart : Tue Mar 14 09:12:37 PDT 2023
ScheduledFinish : Tue Mar 14 09:12:37 PDT 2023
SampleTakenDateTime : None
EntryDateTime : None
Shift : None
SequenceDate : None
Approved : 0
Exclude : 0
SampleTakenBy : None
SampleEnteredBy : None
ApprovedBy : None
ApprovedDateTime : None
Tag : None
Note : None
LastUpdated : None
State : 0
DefUUID : c5cd6e9b-1173-4dce-81df-f07b270cb966
SampleUUID : 2f9eb081-b859-461e-bd84-301334ab1347
ProductCode : None
LocationPath : Enterprise\El Dorado Hills\Packaging Area\Packaging Line 2\Inspection Station 1
Enterprise : Enterprise
Site : El Dorado Hills
Area : Packaging Area
Line : Packaging Line 2
Location : Inspection Station 1
RefNo : None
ScheduledStart : Tue Mar 14 09:13:38 PDT 2023
ScheduledFinish : Tue Mar 14 09:13:38 PDT 2023
SampleTakenDateTime : None
EntryDateTime : None
Shift : None
SequenceDate : None
Approved : 0
Exclude : 0
SampleTakenBy : None
SampleEnteredBy : None
ApprovedBy : None
ApprovedDateTime : None
Tag : None
Note : None
LastUpdated : None
State : 1
DefUUID : c5cd6e9b-1173-4dce-81df-f07b270cb966
SampleUUID : bee37872-370d-41b9-9190-cd622dff817d
ProductCode : None
LocationPath : Enterprise\El Dorado Hills\Packaging Area\Packaging Line 2\Inspection Station 1
Enterprise : Enterprise
Site : El Dorado Hills
Area : Packaging Area
Line : Packaging Line 2
Location : Inspection Station 1
RefNo : None
ScheduledStart : Tue Mar 14 09:14:38 PDT 2023
ScheduledFinish : Tue Mar 14 09:14:38 PDT 2023
SampleTakenDateTime : None
EntryDateTime : None
Shift : None
SequenceDate : None
Approved : 0
Exclude : 0
SampleTakenBy : None
SampleEnteredBy : None
ApprovedBy : None
ApprovedDateTime : None
Tag : None
Note : None
LastUpdated : None
State : 1
DefUUID : c5cd6e9b-1173-4dce-81df-f07b270cb966
SampleUUID : 7f74f7c4-8086-40f6-a83a-31fdbd046726
ProductCode : None
LocationPath : Enterprise\El Dorado Hills\Packaging Area\Packaging Line 2\Inspection Station 1
Enterprise : Enterprise
Site : El Dorado Hills
Area : Packaging Area
Line : Packaging Line 2
Location : Inspection Station 1
RefNo : None
ScheduledStart : Tue Mar 14 09:15:39 PDT 2023
ScheduledFinish : Tue Mar 14 09:15:39 PDT 2023
SampleTakenDateTime : None
EntryDateTime : None
Shift : None
SequenceDate : None
Approved : 0
Exclude : 0
SampleTakenBy : None
SampleEnteredBy : None
ApprovedBy : None
ApprovedDateTime : None
Tag : None
Note : None
LastUpdated : None
State : 1
DefUUID : c5cd6e9b-1173-4dce-81df-f07b270cb966
SampleUUID : 66482c80-fee5-4cb2-97c5-4a93c02eeb8c
ProductCode : None
LocationPath : Enterprise\El Dorado Hills\Packaging Area\Packaging Line 2\Inspection Station 1
Enterprise : Enterprise
Site : El Dorado Hills
Area : Packaging Area
Line : Packaging Line 2
Location : Inspection Station 1
RefNo : None
ScheduledStart : Tue Mar 14 09:16:40 PDT 2023
ScheduledFinish : Tue Mar 14 09:16:40 PDT 2023
SampleTakenDateTime : None
EntryDateTime : None
Shift : None
SequenceDate : None
Approved : 0
Exclude : 0
SampleTakenBy : None
SampleEnteredBy : None
ApprovedBy : None
ApprovedDateTime : None
Tag : None
Note : None
LastUpdated : None
State : 1
DefUUID : c5cd6e9b-1173-4dce-81df-f07b270cb966
SampleUUID : 186c6645-b6aa-4bbb-822f-a8493204cc02
ProductCode : None
LocationPath : Enterprise\El Dorado Hills\Packaging Area\Packaging Line 2\Inspection Station 1
Enterprise : Enterprise
Site : El Dorado Hills
Area : Packaging Area
Line : Packaging Line 2
Location : Inspection Station 1
RefNo : None
ScheduledStart : Tue Mar 14 09:17:41 PDT 2023
ScheduledFinish : Tue Mar 14 09:17:41 PDT 2023
SampleTakenDateTime : None
EntryDateTime : None
Shift : None
SequenceDate : None
Approved : 0
Exclude : 0
SampleTakenBy : None
SampleEnteredBy : None
ApprovedBy : None
ApprovedDateTime : None
Tag : None
Note : None
LastUpdated : None
State : 1





Sepasoft MES Module Suite