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()
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 = {} c.accumulate = False c.renderorder = 1 c.halfsize = False c.realtime = True c.dataMap = ['capturetime','numeric']
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' c1.minval = 0 c1.maxval = 100 c1.xtype = 'datetime' c1.colormap = {} c1.labelmap = {} c1.accumulate = False c1.renderorder = 1 c1.halfsize = False c1.realtime = True c1.dataMap = ['capturetime','numeric']