Пример #1
0

insp = Inspection( name= "Motion", method="motion")
insp.save()

meas = Measurement( name="movement", label="Movement", method = "movement", parameters = dict(), units = "", featurecriteria = dict( index = 0 ), inspection = insp.id )
meas.save()


## Delivery time
o = OLAP()
o.name = 'Movement'  
o.maxLen = 1000 
o.queryType = 'measurement_id' 
o.queryId = meas.id 
o.fields = ['capturetime','numeric', 'measurement_id', 'inspection_id', 'frame_id']
o.since = None
o.before = None
o.customFilter = {} 
o.statsInfo = []
o.save()

c = Chart()
c.name = 'Movement'
c.olap = o.name
c.style = 'spline'
c.minval = 0
c.maxval = None
c.xtype = 'datetime'
c.colormap = {}
c.labelmap = {}
Пример #2
0
Session(config_file)

from SimpleSeer.models.OLAP import OLAP
from SimpleSeer.models.Chart import Chart
from bson import ObjectId

OLAP.objects.delete()
Chart.objects.delete()

o = OLAP()
o.name = 'Test OLAP'  
o.maxLen = 1000 
o.queryType = 'measurement' 
o.queryId = ObjectId('4fdbac481d41c834fb000001') 
o.fields = ['capturetime','string']
o.groupTime = 'minute'
o.valueMap = {}
o.since = None
o.before = None
o.customFilter = {} 
o.statsInfo = [{'sum': 1},
               {'min': 'string'},
               {'max': 'string'}]
o.save()


c = Chart()
c.name = 'Colors Evaluated'
c.olap = o.name
c.style = 'column'