Ejemplo n.º 1
0
def workCV(eID,title):
	is_enable_leftbutton = True
	is_enable_rightbutton = True
	today = todayDate()
	#create items for CV
	if(currentProcess("3CS")=='idle'):
		cvThreeCS = 'idle'
	else:
		cvThreeCS = str(currentProcess("3CS"))[2:8]
	if(currentProcess("3CL")=='idle'):
		cvThreeCL = 'idle'
	else:
		cvThreeCL = str(currentProcess("3CL"))[2:8]
	if(currentProcess("2CL")=='idle'):
		cvTwoCL = 'idle'
	else:
		cvTwoCL = str(currentProcess("2CL"))[2:8]
	if(currentProcess("3CW")=='idle'):
		cvThreeCW = 'idle'
	else:
		cvThreeCW = str(currentProcess("3CW"))[2:8]
	if(currentProcess("2CS")=='idle'):
		cvTwoCS = 'idle'
	else:
		cvTwoCS = str(currentProcess("2CS"))[2:8]
	item_plan = FakeStatusTracking.objects.filter(plan_cv_start__year=today.year, plan_cv_start__month=today.month, plan_cv_start__day=today.day).values_list("plan_id","plan_cv_start", "plan_cv_end", "product_id", "actual_cv_start", "actual_cv_end", "cv_machine", "process1","process3","process4").order_by('plan_cv_start')
	items = list(item_plan)
	return render_to_response('CV/listCV.html', locals())
Ejemplo n.º 2
0
def showCV(eid,section_title):
	today = todayDate()
	is_enable_leftbutton = True
	is_enable_rightbutton = True
	title = "View convertor plan"
	eID = eid
	#create items for CV
	cvThreeCL = str(currentProcess("3CL"))[2:8]
	cvTwoCL = str(currentProcess("2CL"))[2:8]
	cvThreeCS = str(currentProcess("3CS"))[2:8]
	item_plan = FakeStatusTracking.objects.filter(plan_cv_start__year=today.year, plan_cv_start__month=today.month, plan_cv_start__day=today.day).values_list("plan_cv_start", "plan_cv_end", "product_id", "actual_cv_start", "actual_cv_end", "cv_machine", "process1","process3","process4").order_by('plan_cv_start')
	items = list(item_plan)
	return render_to_response('PC/CV.html', locals())
Ejemplo n.º 3
0
def workCR(eID,title):
	is_enable_leftbutton = True
	is_enable_rightbutton = True
	eID = eID
	today = todayDate()
	#create items for CR
	if(currentProcess("CR")=='idle'):
		cr = 'idle'
	else:
		cr = str(currentProcess("CR"))[2:8]
	#temp_contents = cr
	item_plan = FakeStatusTracking.objects.filter(plan_cr_start__year=today.year, plan_cr_start__month=today.month, plan_cr_start__day=today.day).values_list("plan_id","plan_cr_start", "plan_cr_end", "product_id", "actual_cr_start", "actual_cr_end").order_by('plan_cr_start')
	items = list(item_plan)
	x = ''
	return render_to_response('CR/listCR.html', locals())
Ejemplo n.º 4
0
def machine_list(request):
	today = todayDate()
	machine = request.GET['machine']
	eID = request.GET['eID']
	is_enable_leftbutton = True
	is_enable_rightbutton = True
	#create items for CV
	if(machine == "3CL"):
		cvThreeCL = str(currentProcess("3CL"))[2:8]
	if(machine == "2CL"):
		cvTwoCL = str(currentProcess("2CL"))[2:8]
	if(machine == "3CS"):
		cvThreeCS = str(currentProcess("3CS"))[2:8]
	if(machine == "2CS"):
		cvTwoCS = str(currentProcess("2CS"))[2:8]
	if(machine == "3CW"):
		cvThreeCW = str(currentProcess("3CW"))[2:8]
	item_plan = FakeStatusTracking.objects.filter(plan_cv_start__year=today.year, plan_cv_start__month=today.month, plan_cv_start__day=today.day).filter(cv_machine=machine).values_list("plan_id","plan_cv_start", "plan_cv_end", "product_id", "actual_cv_start", "actual_cv_end", "cv_machine", "previous_section").order_by('plan_cv_start')
	items = list(item_plan)
	return render_to_response('machine.html', locals())
Ejemplo n.º 5
0
def showCR(eid,section_title):
	today = todayDate()
	is_enable_leftbutton = True
	is_enable_rightbutton = True
	title = "View corrugator plan"
	eID = eid
	#create items for CR
	cr = str(currentProcess("CR"))[2:8]
	item_plan = FakeStatusTracking.objects.filter(plan_cr_start__year=today.year, plan_cr_start__month=today.month, plan_cr_start__day=today.day).values_list("plan_cr_start", "plan_cr_end", "product_id", "actual_cr_start", "actual_cr_end").order_by('plan_cr_start')
	items = list(item_plan)
	return render_to_response('PC/CR.html', locals())
Ejemplo n.º 6
0
def showPC(eID,title):
	today = todayDate()
	page = "PC"
	is_enable_leftbutton = True
	is_enable_rightbutton = True
	

	#create items for PC
	#extra = db_type(FakeStatusTracking.objects.all())
	item_plan_cr = FakeStatusTracking.objects.filter(plan_cr_start__year= today.year, plan_cr_start__month=today.month, plan_cr_start__day=today.day).values_list("plan_cr_start","plan_cr_end","product_id","actual_cr_start","actual_cr_end","days_left","plan_amount","actual_amount_cr").order_by('plan_cr_start')
	#temp_contents = extra[0].days_left
	#item_plan_cr = FakeStatusTracking.objects.filter(plan_cr_start__year= today.year, plan_cr_start__month=today.month, plan_cr_start__day=today.day).values_list("plan_cr_start","plan_cr_end","product_id","actual_cr_start","actual_cr_end").order_by('plan_cr_start')
	#item_plan_cr = FakeStatusTracking.objects.filter(plan_cr_start__year=
	item_plan_cv = FakeStatusTracking.objects.filter(plan_cv_start__year=today.year, plan_cv_start__month=today.month, plan_cv_start__day=today.day).values_list("plan_cv_start", "plan_cv_end", "product_id", "actual_cv_start", "actual_cv_end", "cv_machine","process1","plan_due").order_by('plan_cv_start')
	item_plan_pt = FakeStatusTracking.objects.filter(plan_pt_start__year=today.year, plan_pt_start__month=today.month, plan_pt_start__day=today.day).values_list("plan_pt_start", "plan_pt_end", "product_id", "actual_pt_start", "actual_pt_end","process2","plan_due").order_by('plan_pt_start')
	#bug here ordering (also in utility line67)
	item_plan_wh = FakeStatusTracking.objects.filter(plan_wh_start__year=today.year, plan_wh_start__month=today.month, plan_wh_start__day=today.day).values_list("plan_wh_start", "product_id","actual_wh_start","process1","process2","process3","plan_due").order_by('plan_wh_start')
	
	items_plan_cr = list(item_plan_cr)
	items_plan_cv = list(item_plan_cv)
	items_plan_pt = list(item_plan_pt)
	items_plan_wh = list (item_plan_wh)
	
	cr = currentTimeProcess("CR")
	cv = currentTimeProcess("CV")
	cvThreeCS = currentTimeProcess("3CS")
	cvThreeCL = currentTimeProcess("3CL")
	cvTwoCL = currentTimeProcess("2CL")
	cvThreeCW = currentTimeProcess("3CW")
	cvTwoCS = currentTimeProcess("2CS")
	pt = currentTimeProcess("PT")
	wh = currentTimeProcess("WH")
	currentTimeProcess("WH") 
	
	#prepare list for CR
	size = len(items_plan_cr)
	if(currentProcess("CR")!='idle'):
		pos = positionOfCurrentProcess("CR",currentProcess("CR")[0][0:8])
	else :
		pos = size
	#temp_contents = currentProcess("CV")
	startList = returnStartingPoint(pos,size)
	endList = startList+getPCItemNum()
	items_plan_cr=items_plan_cr[startList:endList]
	
	#prepare list for CV
	size = len(items_plan_cv)
	pos = positionOfCurrentProcess("CV",currentProcess("CV")[0][0:8])
	startList = returnStartingPoint(pos,size)
	endList = startList+getPCItemNum()
	items_plan_cv=items_plan_cv[startList:endList]
	
	#prepare list for PT
	size = len(items_plan_pt)
	pos = positionOfCurrentProcess("PT",currentProcess("PT")[0][0:8])
	startList = returnStartingPoint(pos,size)
	endList = startList+getPCItemNum()
	items_plan_pt=items_plan_pt[startList:endList]
	
	#prepare list for WH
	size = len(items_plan_wh)
	#pos =currentProcess("WH")[0][0]
	#temp_contents = currentProcess("WH")[0][0]
	pos = positionOfCurrentProcess("WH",currentProcess("WH")[0][0])
	startList = returnStartingPoint(pos,size)
	endList = startList+getPCItemNum()
	items_plan_wh=items_plan_wh[startList:endList]
	#temp_contents = currentProcess("2CL")
	return render_to_response('PC/view.html', locals())