Esempio n. 1
0
def BAT2_Reverse(root, key, val, databaseHandle, mfgID, Sln, TestNameText,
                 MinLimitText, MaxLimitText, MeasurementText, ResultText,
                 modelFileContent, testStartTime, OperationMode,
                 OperationModeInput, LotNumvberInput):
    measurement = popen('megaioind 0 ruin 2').read()
    result = 'Pass' if float(measurement) < 10.0 else 'Fail'

    mod_TestName = re.sub(r"(\w)([A-Z])", r"\1 \2", key)

    if float(measurement) < 10.0:
        measurement = 0
    else:
        measurement = 1

    # Display Test and results
    displayResult(TestNameText, MinLimitText, MaxLimitText, MeasurementText,
                  ResultText, mod_TestName, val, int(measurement), result)

    if int(measurement) == 1:
        messagebox.showerror("Error", "Battery 2 connected in Reverse")

    # Return test results
    if int(measurement) == 0:
        return True
    else:
        return False
Esempio n. 2
0
def Verify_PN(root, key, val, databaseHandle, mfgID, Sln, TestNameText,
              MinLimitText, MaxLimitText, MeasurementText, ResultText,
              modelFileContent, testStartTime, OperationMode,
              OperationModeInput, LotNumvberInput):
    databaseHandle.execute(
        "Select distinct ProcessFlowKey from dbo.TestEvent WHERE MfgSerialNumber = ? AND ProcessFlowKey != 0",
        mfgID)
    ProcessFlowKey = databaseHandle.fetchall()
    CurrentPartNumber = modelFileContent['Part_No']
    CurrentProcessStep = 'Board Test'
    databaseHandle.execute(
        "Select PrePartNumber from dbo.ProcessEnforcementStep WHERE ProcessFlowKey = ? AND CurrentPartNumber = ? AND CurrentProcessStep = ?",
        int((ProcessFlowKey[0])[0]), CurrentPartNumber[0], CurrentProcessStep)
    PrePartNumber = databaseHandle.fetchall()
    if bool(PrePartNumber) == False:
        result = "Fail"
        measurement = 0
    elif (PrePartNumber[0])[0] == CurrentPartNumber[0]:
        result = "Pass"
        measurement = 1
    else:
        result = "Fail"
        measurement = 0

    mod_TestName = re.sub(r"(\w)([A-Z])", r"\1 \2", key)

    # Display test results
    displayResult(TestNameText, MinLimitText, MaxLimitText, MeasurementText,
                  ResultText, mod_TestName, val, measurement, result)

    # Return test result
    if result == "Fail":
        return False
    else:
        return True
Esempio n. 3
0
def Process_Enforcement(root, key, val, databaseHandle, mfgID, Sln,
                        TestNameText, MinLimitText, MaxLimitText,
                        MeasurementText, ResultText, modelFileContent,
                        testStartTime, OperationMode, OperationModeInput,
                        LotNumvberInput):
    # Running a stored procedure - getFlowKey
    getFlowKeyParam = (Sln, (modelFileContent['Part_No'])[0])
    databaseHandle.execute("{CALL [dbo].[getFlowKey] (?, ?)}", getFlowKeyParam)
    try:
        ProcessFlowKey = ((databaseHandle.fetchall())[0])[0]
    except:
        ProcessFlowKey = 1
    databaseHandle.commit()

    # Running a stored procedure - getProcessStep
    CurrentPartNumber = (modelFileContent['Part_No'])[0]
    CurrentProcessStep = re.sub(r"(\w)([A-Z])", r"\1 \2",
                                (modelFileContent['Current_Step'])[0])

    getProcessStepParam = (ProcessFlowKey, CurrentProcessStep,
                           CurrentPartNumber)
    databaseHandle.execute("{CALL [dbo].[getProcessStep] (?, ?, ?)}",
                           getProcessStepParam)

    getProcessStepReturn = databaseHandle.fetchall()
    try:
        ProcessStep = (getProcessStepReturn[0])[0]
        PrePartNumber = (getProcessStepReturn[0])[1]
    except:
        ProcessStep = ''
        PrePartNumber = ''
    databaseHandle.commit()

    # Checking if the unit is passed using the stored procedure - IsUnitPassed
    retResult = ''
    IsUnitPassedParam = (ProcessStep, PrePartNumber, Sln, retResult)
    databaseHandle.execute("{CALL [dbo].[IsUnitPassed] (?, ?, ?, ?)}",
                           IsUnitPassedParam)
    IsUnitPassedReturn = int((databaseHandle.fetchall()[0])[0])
    databaseHandle.commit()

    if IsUnitPassedReturn == 1:
        result = "Pass"
        measurement = 1
    else:
        result = "Fail"
        measurement = 0

    mod_TestName = re.sub(r"(\w)([A-Z])", r"\1 \2", key)

    # Display test results
    displayResult(TestNameText, MinLimitText, MaxLimitText, MeasurementText,
                  ResultText, mod_TestName, val, measurement, result)

    # Return test results
    if result == "Fail":
        return False
    else:
        return True
Esempio n. 4
0
def BAT1_Voltage(root, key, val, databaseHandle, mfgID, Sln, TestNameText, MinLimitText, MaxLimitText, MeasurementText, ResultText, modelFileContent, testStartTime, OperationMode, OperationModeInput, LotNumvberInput):
	rawScale = popen('megaioind 0 ruin 1').read()
	measurement = float(rawScale)
	mod_TestName = re.sub(r"(\w)([A-Z])", r"\1 \2", key)

	result = 'Pass' if measurement > float(val[1]) and measurement < float(val[2]) else 'Fail'

	# Display tests and results
	displayResult(TestNameText, MinLimitText, MaxLimitText, MeasurementText, ResultText, mod_TestName, val, measurement, result)
	# Return test results
	
	if result == "Fail" :
		return False
	else:
		return True
Esempio n. 5
0
def Wakeup_Pulse(root, key, val, databaseHandle, mfgID, Sln, TestNameText,
                 MinLimitText, MaxLimitText, MeasurementText, ResultText,
                 modelFileContent, testStartTime, OperationMode,
                 OperationModeInput, LotNumvberInput):
    result = "Pass"
    mod_TestName = re.sub(r"(\w)([A-Z])", r"\1 \2", key)
    measurement = 1

    # Display test and tests
    displayResult(TestNameText, MinLimitText, MaxLimitText, MeasurementText,
                  ResultText, mod_TestName, val, measurement, result)

    # Return test result
    if result == "Fail":
        return False
    else:
        return True
Esempio n. 6
0
def Valid_ID(root, key, val, databaseHandle, mfgID, Sln, TestNameText,
             MinLimitText, MaxLimitText, MeasurementText, ResultText,
             modelFileContent, testStartTime, OperationMode,
             OperationModeInput, LotNumvberInput):
    measurement = int(Sln)
    mod_TestName = re.sub(r"(\w)([A-Z])", r"\1 \2", key)

    result = 'Pass' if measurement > int(val[1]) and measurement < int(
        val[2]) else 'Fail'

    # Display tests and results
    displayResult(TestNameText, MinLimitText, MaxLimitText, MeasurementText,
                  ResultText, mod_TestName, val, int(measurement), result)
    # Return test results

    if result == "Fail":
        return False
    else:
        return True
Esempio n. 7
0
def Vin_Voltage(root, key, val, databaseHandle, mfgID, Sln, TestNameText, MinLimitText, MaxLimitText, MeasurementText, ResultText, modelFileContent, testStartTime, OperationMode, OperationModeInput, LotNumvberInput):
	rawScale = popen('megaioind 0 ruin 3').read()
	measurement = float(rawScale)

	if measurement < float(val[1]) or measurement > float(val[2]) :
		messagebox.showerror("Error", "Check if the bridge is Soldered \n \nSolder the bridge and press OK")
		rawScale = popen('megaioind 0 ruin 3').read()
		measurement = float(rawScale)

	result = 'Pass' if measurement > float(val[1]) and measurement < float(val[2]) else 'Fail'

	mod_TestName = re.sub(r"(\w)([A-Z])", r"\1 \2", key)

	# Display Test and results
	displayResult(TestNameText, MinLimitText, MaxLimitText, MeasurementText, ResultText, mod_TestName, val, measurement, result)

	# Return test results
	if result == "Fail":
		return False
	else:
		return True
Esempio n. 8
0
def Test_Time(root, key, val, databaseHandle, mfgID, Sln, TestNameText,
              MinLimitText, MaxLimitText, MeasurementText, ResultText,
              modelFileContent, testStartTime, OperationMode,
              OperationModeInput, LotNumvberInput):
    endTime = time.time()

    measurement = int(endTime - testStartTime)
    result = 'Pass' if measurement >= int(val[1]) and measurement <= int(
        val[2]) else 'Fail'

    mod_TestName = re.sub(r"(\w)([A-Z])", r"\1 \2", key)

    # Display test results
    displayResult(TestNameText, MinLimitText, MaxLimitText, MeasurementText,
                  ResultText, mod_TestName, val, measurement, result)

    # Return test results
    if result == "Fail":
        return False
    else:
        return True