예제 #1
0
 

system('echo "db.dropDatabase()" | mongo default')




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'
예제 #2
0
from SimpleSeer.Session import Session

if (len(sys.argv) > 1):
   config_file = sys.argv[1] 
else:
   config_file = "../default.cfg"

Session(config_file)

from SimpleSeer.models.Inspection import Inspection
from SimpleSeer.models.Inspection import Measurement 
from SimpleSeer.models.OLAP import OLAP 
 

Inspection.objects.delete()
Measurement.objects.delete()
OLAP.objects.delete()


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()


omove = OLAP(name='MotionMovingAverage', queryInfo = dict( name = 'Motion' ), descInfo = dict( formula = 'moving', window = 3), chartInfo = dict ( name='line', color = 'blue', min = 0, max = 100))
omove.save()
oraw = OLAP(name='Motion', queryInfo = dict( name = 'Motion' ), descInfo = None, chartInfo = dict ( name='line', color = 'blue', min = 0, max = 100))
oraw.save()
예제 #3
0
if (len(sys.argv) > 1):
   config_file = sys.argv[1] 
else:
   config_file = "../default.cfg"

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()
예제 #4
0
# Note this cleans out all old results 
Result.objects.delete()
Inspection.objects.delete()
Measurement.objects.delete()
OLAP.objects.delete()
Chart.objects.delete()


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()

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

c1 = Chart()
c1.name = 'Motion'
c1.olap = o1.name
c1.style = 'spline'