Modify

Opened 7 years ago

Closed 7 years ago

#2327 closed Feature Request (No Bug)

the script stops randomly please suggest some idea's.

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

#include "InputHeader_BMP.au3"

Local $strErrorLogName = 'image_PixelImageCombined_BMP.txt'
Local $strErrorLogPathName = $strErrorLogPath&$strErrorLogName

Global $strChannel = 'GREEN'
Global $strRow = 10
Global $strGetPixelRow = 200
Global $strGetPixelCol = 200
Global $strSetClear = 65536

Global $strSetWidth = 100
Global $strSetHeight = 100

Global $strSetDepth = 8

Global $strResizeType = '0' ;0-Nearest Neighbour 1-Linear 2-Bicubic

Global $strCheckButton = 1 ;0-uncheck checkbox 1-select check button

Global $strGetPixelVal = 100

Global $iSleepTime = 500

Global $file = FileOpen($strErrorLogPathName,2)
if($file == -1) Then

MsgBox(0, "Error", "Unable to open the file")
Exit

EndIf
Run($strApplicationPath)
for $iOperation = 2 to 2 Step 1

Main($strInputImgPath1k,$strName1k,$strName8bits,$iOperation)
Main($strInputImgPath2k,$strName2k,$strName8bits,$iOperation)
Main($strInputImgPath4k,$strName4k,$strName8bits,$iOperation)
Main($strInputImgPath10,$strName10,$strName8bits,$iOperation)
Main($strInputImgPath512,$strName512,$strName8bits,$iOperation)

Main($strInputColorImgPath1k,$strName1k,$strNameColor,$iOperation)
Main($strInputColorImgPath2k,$strName2k,$strNameColor,$iOperation)
Main($strInputColorImgPath4k,$strName4k,$strNameColor,$iOperation)
Main($strInputColorImgPath10,$strName10,$strNameColor,$iOperation)
Main($strInputColorImgPath512,$strName512,$strNameColor,$iOperation)

Next

Local $strActive = WinActive("ss", "Ready")
if @error == 0 Then

Winclose("ss")

EndIf

Func Main($strInpPath,$strImgName,$strOutPath,$iOperation)
Global $winimage = WinWaitActive("ss","Ready")
if ($winimage == 0) Then

FileWriteLine($file,"Error: image Window is not Active")

Else

FileWriteLine($file,"ss.exe Application Is Running")
FileWriteLine($file," ")
if($iOperation == 0) Then

FileWriteLine($file,"::::::::::::::::Get Sum::::::::::::::")

ElseIf($iOperation == 1) Then

FileWriteLine($file,"::::::::::::::::Get Row::::::::::::::")

ElseIf($iOperation == 2) Then

FileWriteLine($file,"::::::::::::::::Get Pixel::::::::::::::")

ElseIf($iOperation == 3) Then

FileWriteLine($file,"::::::::::::::::Get Max Pixel Value::::::::::::::")

ElseIf($iOperation == 4) Then

FileWriteLine($file,"::::::::::::::::Get Count::::::::::::::::::")

ElseIf($iOperation == 5) Then

FileWriteLine($file,"::::::::::::::::SET Depth::::::::::::::::::")

ElseIf($iOperation == 6) Then

FileWriteLine($file,":::::::::::::::Clear::::::::::::::::")

ElseIf($iOperation == 7) Then

FileWriteLine($file,":::::::::::::::Resize::::::::::::::::")

ElseIf($iOperation == 8) Then

FileWriteLine($file,":::::::::::::::GetStat::::::::::::::::")

ElseIf($iOperation == 9)Then

FileWriteLine($file,":::::::::::::::SET Pixel::::::::::::::::")

EndIf

for $i = 1 to 4 Step 1

Local $iReset = 1
Local $str1 = String($i)
Local $str2 = $strImgName
Local $str3 = $str2&$str1
Local $str4 = '.bmp'
Local $str5 = $str3&$str4


ControlClick("ss","",59398,"left",1,$iXClickFile,$iYClickFile)
sleep($iSleepTime)
ControlClick("ss","",59398,"left",1,$iXClickOpen,$iYClickOpen)
Local $winOpen1 = WinWaitActive("Open","")
if $winOpen1 == 0 Then

FileWriteLine($winOpen1,"Error: File->Open Window Not Active")

Else

FileWriteLine($file," ")
FileWriteLine($file,"File->Open Window is Active")
Local $str6 = $strInpPath&$str5
;Local $strOpenIm1 = ControlSetText($winOpen1,"",'Edit1',$str6)
;Local $strOpenIm1 = ControlSetText($winOpen1,"",1148,$str6)
Local $strOpenIm1 = ControlSetText("Open","",'Edit1',$str6)
ControlClick($winOpen1,"&Open","Button2"); Button2 for WinXP
sleep($iSleepTime)

Local $WarnImage = WinExists("ss","This Window is already open")
if ($WarnImage == 1) Then

$str61 = 'Warning: '&$str5&' Is Already Open'
FileWriteLine($WarnImage,$str61)
ControlClick("ss","","Button1")

EndIf
Local $WarnImage1 = winExists("ss","Unable to load the image.")
if ($WarnImage1 == 1) Then

$str71 = 'Warning: Unable to load iamge - '&$str5
FileWriteLine($file,$str71)
ControlClick("ss","","Button1")
$iReset = 0

EndIf

Local $WarnImage2 = WinExists("ss","Error opening image file")
If($WarnImage2 == 1) Then

FileWriteLine($file,"Error Opening image file")
ControlClick("ss","","Button1")
sleep($iSleepTime)
ControlClick("ss","","Button1")
sleep($iSleepTime)
ControlClick("ss","","Button1")
$iReset = 0

EndIf
if($iReset == 1) Then

WinWaitActive("ss", $str5)
Local $var = ControlGetText( "[Active]", "", "[ID:65280]" )
$process = 'Processing Image: '&$var
FileWriteLine($file,$process)

Global $iHandle1 = ControlGetHandle("[Active]","","[ID:65280]")
if(@error == 1) Then

FileWriteLine($file,"Cannot Get Handle")

Else

;FileWriteLine($file,$iHandle1)
ControlHide("[Active]","","[ID:65280]")

;ThresholdOperations($str3,$strOutPath,$iOperation)
PixelOperations($str3,$strOutPath,$iOperation)

EndIf

EndIf

EndIf
FileWriteLine($file,"")

Next

EndIf
EndFunc

Func PixelOperations($str3,$strOutPath,$iType)
Local $iReset = 1
Local $strOut = $strOutputImgPath&$strOutPath&$str3

ControlClick("ss","",59398,"left",1,$iXClickOperation,$iYClickOperation)
ControlClick("ss","",59398,"left",1,$iXClickPixel,$iYClickPixel)
Local $winPixel = WinWaitActive($Winimage,"Pixel Operation");

if $winPixel == 0 Then

FileWriteLine($file,"Error: Operations-> Pixel Operations Menu Not Available")

Else

FileWriteLine($file,"Operations-> Pixel Operations Menu Available")
ControlCommand($winPixel,"","ComboBox2", "SetCurrentSelection", $iType)
if @error == 1 Then

FileWriteLine($file,"Error: Filter->ComboBox2 Selection Failure")

Else

FileWriteLine($file,"Filter->ComboBox2 Selection Pass")

EndIf
sleep($iSleepTime)

if($iType == 0) Then

$strCombo3 = $str3&'.bmp'
ControlCommand($winPixel,"",1082,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1082, "SelectString", $strCombo3)
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1082)
sleep($iSleepTime)

if($strOutPath == '24bit_' AND $strChannel = 'RED') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'RED')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'GREEN') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'BLUE') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

EndIf
;ControlClick($winPixel,"","Button8")
Local $strClickOk = ControlClick($winPixel,"","Button8")
if($strClickOk == 1) Then

FileWriteLine($file,"Click OK Sucesss")
sleep($iSleepTime)
Local $warnOut = WinExists("ss","Please select an input image.")
if $warnOut == 1 Then

FileWriteLine($file,"Warning: Select An Input Image")
Local $warnOK = ControlClick("ss","Please select an input image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf

EndIf
Local $iGetSumText = ControlGetText($winPixel,"","Edit4")
if @error == 1 Then

FileWriteLine($file,"Error: Edit4 ControlGetText for Sum: Fail")

Else

FileWriteLine($file,"Edit4: ControlGetText Pass")
$strTypeSum = 'Sum of Pixels for '&$strCombo3&' is :'&$iGetSumText
FileWriteLine($file,$strTypeSum)

EndIf
sleep($iSleepTime)

Local $strClickCancel = ControlClick($winPixel,"","Button7")
if($strClickCancel == 1) Then

FileWriteLine($file,"Click Cancel button Sucesss")

Else

FileWriteLine($file,"Click Cancel Button Fail")

EndIf

WinClose($iHandle1)

Else

FileWriteLine($file,"Error: Click Ok Fail")
ControlClick($winPixel,"","Button7")
WinClose($iHandle1)

EndIf

ElseIf($iType == 1) Then

$strCombo3 = $str3&'.bmp'
ControlCommand($winPixel,"",1082,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1082, "SelectString", $strCombo3)
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1082)
sleep($iSleepTime)

Local $setText = ControlSetText($winPixel,"","Edit1",$strRow)
if ($setText == 0) Then

FileWriteLine($file,"Error: Set Row value Fail")

Else

FileWriteLine($file,"Set Row value Success")

EndIf

Local $strClickOk = ControlClick($winPixel,"","Button8")
if($strClickOk == 1) Then

FileWriteLine($file,"Click OK Sucesss")
sleep($iSleepTime)
Local $warnOut = WinExists("ss","Please select an input image.")
if $warnOut == 1 Then

FileWriteLine($file,"Warning: Select An Input Image")
Local $warnOK = ControlClick("ss","Please select an input image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut1 = WinExists("ss","Please enter a valid Row value.")
if $warnOut1 == 1 Then

FileWriteLine($file,"Warning: Please enter a valid Row value.")
Local $warnOK1 = ControlClick("ss","Please enter a valid Row value.","Button1")
if $warnOK1 == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

if($iReset == 1) Then

$strFileName = $strOutPath&$str3&'_Row_'&$strRow&'.txt'
$strFileNamePath = $strOutputImgPath&$strFileName
$filerow = FileOpen($strFileNamePath,2)
$winRowText = WinGetText("ss","The Pixel values of Row No. ")
if($winRowText == 0) Then

FileWriteLine($file,"Error: Get Text Window Fail")

Else

FileWriteLine($file,"Get Row Text Success")
FileWriteLine($filerow,$winRowText)
ControlClick("ss","The Pixel values of Row No. ","Button1")

EndIf

EndIf
sleep($iSleepTime)

Local $strClickCancel = ControlClick($winPixel,"","Button7")
if($strClickCancel == 1) Then

FileWriteLine($file,"Click Cancel button Sucesss")

Else

FileWriteLine($file,"Click Cancel Button Fail")

EndIf
WinClose($iHandle1)

Else

FileWriteLine($file,"Error: Click Ok Fail")
ControlClick($winPixel,"","Button7")
WinClose($iHandle1)

EndIf

ElseIf($iType == 2) Then

Local $setText = ControlSetText($winPixel,"","Edit1",$strGetPixelRow)
if ($setText == 0) Then

FileWriteLine($file,"Error: Set Row value Fail")

Else

FileWriteLine($file,"Set Row value Success")

EndIf

Local $setText1 = ControlSetText($winPixel,"","Edit2",$strGetPixelCol)
if ($setText1 == 0) Then

FileWriteLine($file,"Error: Set Col value Fail")

Else

FileWriteLine($file,"Set Col value Success")

EndIf

$strCombo3 = $str3&'.bmp'
ControlCommand($winPixel,"",1082,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1082, "SelectString", $strCombo3)
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1082)
sleep($iSleepTime)

if($strOutPath == '24bit_' AND $strChannel = 'RED') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'RED')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'GREEN') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'BLUE') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

EndIf

Local $strClickOk = ControlClick($winPixel,"","Button8")
if($strClickOk == 1) Then

FileWriteLine($file,"Click OK Sucesss")
sleep($iSleepTime)
Local $warnOut = WinExists("ss","Please select an input image.")
if $warnOut == 1 Then

FileWriteLine($file,"Warning: Select An Input Image")
Local $warnOK = ControlClick("ss","Please select an input image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf

EndIf

Local $warnOut1 = WinExists("ss","Please enter a valid Row value.")
if $warnOut1 == 1 Then

FileWriteLine($file,"Warning: Please enter a valid Row value. ")
Local $warnOK1 = ControlClick("ss","Please enter a valid Row value.","Button1")
if $warnOK1 == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut2 = WinExists("ss","Please enter a valid Column value.")
if $warnOut2 == 1 Then

FileWriteLine($file,"Warning: Please enter a valid Column value.")
Local $warnOK2 = ControlClick("ss","Please enter a valid Column value.","Button1")
if $warnOK2 == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $strClickCancel = ControlClick($winPixel,"","Button7")
if($strClickCancel == 1) Then

FileWriteLine($file,"Click Cancel button Sucesss")

Else

FileWriteLine($file,"Click Cancel Button Fail")

EndIf
WinClose($iHandle1)

Else

FileWriteLine($file,"Error: Click Ok Fail")
ControlClick($winPixel,"","Button7")
WinClose($iHandle1)

EndIf

ElseIf ($iType == 3) Then

$strCombo3 = $str3&'.bmp'
ControlCommand($winPixel,"",1082,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1082, "SelectString", $strCombo3)
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1082)
sleep($iSleepTime)
if($strOutPath == '24bit_' AND $strChannel = 'RED') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'RED')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'GREEN') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'BLUE') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

EndIf

Local $strClickOk = ControlClick($winPixel,"","Button8")
if($strClickOk == 1) Then

FileWriteLine($file,"Click OK Sucesss")
sleep($iSleepTime)
Local $warnOut = WinExists("ss","Please select an input image.")
if $warnOut == 1 Then

FileWriteLine($file,"Warning: Select An Input Image")
Local $warnOK = ControlClick("ss","Please select an input image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf

EndIf
Local $iGetMaxPixel = ControlGetText($winPixel,"","Edit4")
if @error == 1 Then

FileWriteLine($file,"Error: Edit4 ControlGetText for Sum: Fail")

Else

FileWriteLine($file,"Edit4: ControlGetText Pass")
$strTypeMaxPixel = 'Maximum Pixel in '&$strCombo3&' is :'&$iGetMaxPixel
FileWriteLine($file,$strTypeMaxPixel)

EndIf
sleep($iSleepTime)

Local $strClickCancel = ControlClick($winPixel,"","Button7")
if($strClickCancel == 1) Then

FileWriteLine($file,"Click Cancel button Sucesss")

Else

FileWriteLine($file,"Click Cancel Button Fail")

EndIf
WinClose($iHandle1)

EndIf

ElseIf($iType == 4) Then

$strCombo3 = $str3&'.bmp'
ControlCommand($winPixel,"",1082,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1082, "SelectString", $strCombo3)
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1082)
sleep($iSleepTime)

if($strOutPath == '24bit_' AND $strChannel = 'RED') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'RED')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'GREEN') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'BLUE') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

EndIf
Local $strClickOk = ControlClick($winPixel,"","Button8")
if($strClickOk == 1) Then

FileWriteLine($file,"Click OK Sucesss")
sleep($iSleepTime)
Local $warnOut = WinExists("ss","Please select an input image.")
if $warnOut == 1 Then

FileWriteLine($file,"Warning: Select An Input Image")
Local $warnOK = ControlClick("ss","Please select an input image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf

EndIf
Local $iGetCount = ControlGetText($winPixel,"","Edit4")
if @error == 1 Then

FileWriteLine($file,"Error: Edit4 ControlGetText for Sum: Fail")

Else

FileWriteLine($file,"Edit4: ControlGetText Pass")
$strCount = 'Sum of Pixels for '&$strCombo3&' is :'&$iGetCount
FileWriteLine($file,$strCount)

EndIf
sleep($iSleepTime)

Local $strClickCancel = ControlClick($winPixel,"","Button7")
if($strClickCancel == 1) Then

FileWriteLine($file,"Click Cancel button Sucesss")

Else

FileWriteLine($file,"Click Cancel Button Fail")

EndIf
WinClose($iHandle1)

EndIf

ElseIf($iType == 5) Then

$strCombo3 = $str3&'.bmp'
ControlCommand($winPixel,"",1082,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1082, "SelectString", $strCombo3)
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1082)
sleep($iSleepTime)

ControlCommand($winPixel,"",1083,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1083, "SelectString", 'NewImage')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1083)
sleep($iSleepTime)

Local $setText = ControlSetText($winPixel,"","Edit1",$strSetDepth)
if ($setText == 0) Then

FileWriteLine($file,"Error: Set Depth value Fail")

Else

FileWriteLine($file,"Set Depth value Success")

EndIf

Local $strClickOk = ControlClick($winPixel,"","Button8")
Sleep($iSleepTime)

if($strClickOk == 1) Then

FileWriteLine($file,"Click OK Sucesss")
sleep($iSleepTime)
Local $warnOut3 = WinExists("ss","Please select an input image.")
if $warnOut3 == 1 Then

FileWriteLine($file,"Warning: Select An Input Image")
Local $warnOK = ControlClick("ss","Please select an input image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut4 = WinExists("ss","Please select an output image.")
if $warnOut4 == 1 Then

FileWriteLine($file,"Warning: Select An Output Image")
Local $warnOK = ControlClick("ss","Please select an output image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut5 = WinExists("ss","Unable to save image")
if $warnOut5 == 1 Then

FileWriteLine($file,"Error: Unable to save Image ")
Local $warnOK = ControlClick("ss","Unable to save image","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

ControlClick($winPixel,"","Button7")

if($iReset == 1) Then

;ControlClick($winimage,"",59398,"left",1,73,47)
;sleep($iSleepTime)
;ControlClick($winimage,"",59398,"left",1,162,86)
ControlClick("ss","",59398,"left",1,$iXClickFile,$iYClickFile)
ControlClick("ss","",59398,"left",1,$iXClickSaveAs,$iYClickSaveAs)
sleep($iSleepTime)
Local $winSaveAs = WinWaitActive("Save As","")
if($WinSaveAs == 0) Then

FileWriteLine($file,"Error: File->SaveAs Window Not Active")

Else

$strType = '_'&$strSetDepth&'_SetDepth.bmp'

FileWriteLine($file,"File->SaveAs Window is Active")
$str31 = $strOut&$strType
$strSaveFile = $str31
Local $strSave = ControlSetText($winSaveAs,"","Edit1",$strSaveFile)
if($strSave == 0) Then

FileWriteLine($file,"Error: SaveAs->ImagePath Set Text Fail")

Else

FileWriteLine($file,"SaveAs->ImagePath Set Text Pass")
ControlClick($winSaveAs,"","Button1") ;Button2 for WinXP
if @error == 1 Then

FileWriteLine($file,"Error: Click On Save Fail")

Else

FileWriteLine($file,"Click On Save Pass")
FileWriteLine($file,"Save Image Success")

sleep($iSleepTime)
Local $var3 = ControlGetText( "[ACTIVE]","", "[ID:65280]" )
$process2 = 'Output Image: '&$var3
FileWriteLine($file,$process2)
sleep($iSleepTime)

Global $iHandle3 = ControlGetHandle("[ACTIVE]","","[ID:65280]")
if(@error == 1) Then

FileWriteLine($file,"Cannot Get Handle")

Else

WinClose($iHandle3)
Sleep($iSleepTime)
;ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

EndIf

EndIf

EndIf

EndIf
WinClose($iHandle3)
WinClose($iHandle1)

EndIf

EndIf

ElseIf($iType == 6) Then

Local $setText = ControlSetText($winPixel,"","Edit1",$strSetClear)
if ($setText == 0) Then

FileWriteLine($file,"Error: Set Clear value Fail")

Else

FileWriteLine($file,"Set Clear value Success")

EndIf

$strCombo3 = $str3&'.bmp'
ControlCommand($winPixel,"",1082,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1082, "SelectString", $strCombo3)
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1082)
sleep($iSleepTime)

ControlCommand($winPixel,"",1083,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1083, "SelectString", 'NewImage')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1083)
sleep($iSleepTime)

Local $strClickOk = ControlClick($winPixel,"","Button8")
Sleep($iSleepTime)

if($strClickOk == 1) Then

FileWriteLine($file,"Click OK Sucesss")
sleep($iSleepTime)
Local $warnOut3 = WinExists("ss","Please select an input image.")
if $warnOut3 == 1 Then

FileWriteLine($file,"Warning: Select An Input Image")
Local $warnOK = ControlClick("ss","Please select an input image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut4 = WinExists("ss","Please select an output image.")
if $warnOut4 == 1 Then

FileWriteLine($file,"Warning: Select An Output Image")
Local $warnOK = ControlClick("ss","Please select an output image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut5 = WinExists("ss","Unable to save image")
if $warnOut5 == 1 Then

FileWriteLine($file,"Error: Unable to save Image ")
Local $warnOK = ControlClick("ss","Unable to save image","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut6 = WinExists("ss","Operation failed ")
if $warnOut6 == 1 Then

FileWriteLine($file,"Error: Operation Failed: Enter A Valid Pixel Range")
Local $warnOK = ControlClick("ss","Operation failed ","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

ControlClick($winPixel,"","Button7")

if($iReset == 1) Then

ControlClick("ss","",59398,"left",1,$iXClickFile,$iYClickFile)
ControlClick("ss","",59398,"left",1,$iXClickSaveAs,$iYClickSaveAs)
sleep($iSleepTime)
Local $winSaveAs = WinWaitActive("Save As","")
if($WinSaveAs == 0) Then

FileWriteLine($file,"Error: File->SaveAs Window Not Active")

Else

$strType = '_'&$strSetClear&'_SetClear.bmp'

FileWriteLine($file,"File->SaveAs Window is Active")
$str31 = $strOut&$strType
$strSaveFile = $str31
Local $strSave = ControlSetText($winSaveAs,"","Edit1",$strSaveFile)
if($strSave == 0) Then

FileWriteLine($file,"Error: SaveAs->ImagePath Set Text Fail")

Else

FileWriteLine($file,"SaveAs->ImagePath Set Text Pass")
ControlClick($winSaveAs,"","Button1") ;Button2 for WinXP
if @error == 1 Then

FileWriteLine($file,"Error: Click On Save Fail")

Else

FileWriteLine($file,"Click On Save Pass")
FileWriteLine($file,"Save Image Success")

sleep($iSleepTime)
Local $var3 = ControlGetText( "[ACTIVE]","", "[ID:65280]" )
$process2 = 'Output Image: '&$var3
FileWriteLine($file,$process2)
sleep($iSleepTime)

Global $iHandle3 = ControlGetHandle("[ACTIVE]","","[ID:65280]")
if(@error == 1) Then

FileWriteLine($file,"Cannot Get Handle")

Else

WinClose($iHandle3)
Sleep($iSleepTime)
WinClose($iHandle1)

EndIf

EndIf

EndIf

EndIf
WinClose($iHandle3)
WinClose($iHandle1)

EndIf

EndIf

ElseIf($iType == 7) Then

$strCombo3 = $str3&'.bmp'
ControlCommand($winPixel,"",1082,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1082, "SelectString", $strCombo3)
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1082)
sleep($iSleepTime)

ControlCommand($winPixel,"",1083,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1083, "SelectString", 'NewImage')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1083)
sleep($iSleepTime)

Local $setWidth = ControlSetText($winPixel,"","Edit1",$strSetWidth)
if ($setWidth == 0) Then

FileWriteLine($file,"Error: Set Width value Fail")

Else

FileWriteLine($file,"Set Width value Success")

EndIf

Local $setHeight = ControlSetText($winPixel,"","Edit2",$strSetHeight)
if ($setHeight == 0) Then

FileWriteLine($file,"Error: Set Height value Fail")

Else

FileWriteLine($file,"Set Height value Success")

EndIf

Local $setDepth = ControlSetText($winPixel,"","Edit3",$strSetDepth)
if ($setDepth == 0) Then

FileWriteLine($file,"Error: Set Depth value Fail")

Else

FileWriteLine($file,"Set Depth value Success")

EndIf

ControlCommand($winPixel,"","ComboBox3","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Resize Type ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Resize Type ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel,"","ComboBox3", "SetCurrentSelection", $strResizeType)
If @error == 1 Then

FileWriteLine($file,"Error: Resize Type ComboBox Set String Fail")

Else

FileWriteLine($file,"Resize Type ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox3")
sleep($iSleepTime)

Local $strClickOk = ControlClick($winPixel,"","Button8")
if($strClickOk == 1) Then

FileWriteLine($file,"Click OK Sucesss")
sleep($iSleepTime)
Local $warnOut3 = WinExists("ss","Please select an input image.")
if $warnOut3 == 1 Then

FileWriteLine($file,"Warning: Select An Input Image")
Local $warnOK = ControlClick("ss","Please select an input image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut4 = WinExists("ss","Please select an output image.")
if $warnOut4 == 1 Then

FileWriteLine($file,"Warning: Select An Output Image")
Local $warnOK = ControlClick("ss","Please select an output image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut5 = WinExists("ss","Unable to save image")
if $warnOut5 == 1 Then

FileWriteLine($file,"Error: Unable to save Image ")
Local $warnOK = ControlClick("ss","Unable to save image","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut6 = WinExists("ss","Operation failed ")
if $warnOut6 == 1 Then

FileWriteLine($file,"Error: Operation Failed: Enter A Valid Pixel Range")
Local $warnOK = ControlClick("ss","Operation failed ","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut7 = WinExists("ss","Please enter a valid Width value. Valid Range 2 to 10000")
if $warnOut7 == 1 Then

FileWriteLine($file,"Warning: Please enter a valid Width value. Valid Range 2 to 10000")
Local $warnOK = ControlClick("ss","Please enter a valid Width value. Valid Range 2 to 10000","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut7 = WinExists("ss","Please enter a valid Height value. Valid Range 2 to 10000")
if $warnOut7 == 1 Then

FileWriteLine($file,"Warning: Please enter a valid Height value. Valid Range 2 to 10000")
Local $warnOK = ControlClick("ss","Please enter a valid Height value. Valid Range 2 to 10000","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

ControlClick($winPixel,"","Button7")

if($iReset == 1) Then

ControlClick("ss","",59398,"left",1,$iXClickFile,$iYClickFile)
ControlClick("ss","",59398,"left",1,$iXClickSaveAs,$iYClickSaveAs)
sleep($iSleepTime)
Local $winSaveAs = WinWaitActive("Save As","")
if($WinSaveAs == 0) Then

FileWriteLine($file,"Error: File->SaveAs Window Not Active")

Else

if $strResizeType == '0' Then

$strResize = 'NearestNeighbour'

ElseIf $strResizeType == '1' Then

$strResize = 'Linear'

ElseIf $strResizeType == '1' Then

$strResize = 'Bicubic'

EndIf

$strType = '_'&$strSetWidth&'_'&$strSetHeight&'_'&$strSetDepth&'_'&$strResize&'_Resize.bmp'

FileWriteLine($file,"File->SaveAs Window is Active")
$str31 = $strOut&$strType
$strSaveFile = $str31
Local $strSave = ControlSetText($winSaveAs,"","Edit1",$strSaveFile)
if($strSave == 0) Then

FileWriteLine($file,"Error: SaveAs->ImagePath Set Text Fail")

Else

FileWriteLine($file,"SaveAs->ImagePath Set Text Pass")
ControlClick($winSaveAs,"","Button1") ;Button2 for WinXP
if @error == 1 Then

FileWriteLine($file,"Error: Click On Save Fail")

Else

FileWriteLine($file,"Click On Save Pass")
FileWriteLine($file,"Save Image Success")

sleep($iSleepTime)
Local $var3 = ControlGetText( "[ACTIVE]","", "[ID:65280]" )
$process2 = 'Output Image: '&$var3
FileWriteLine($file,$process2)
sleep($iSleepTime)

Global $iHandle3 = ControlGetHandle("[ACTIVE]","","[ID:65280]")
if(@error == 1) Then

FileWriteLine($file,"Cannot Get Handle")

Else

WinClose($iHandle3)
Sleep($iSleepTime)
WinClose($iHandle1)

EndIf

EndIf

EndIf

EndIf
WinClose($iHandle3)
WinClose($iHandle1)

EndIf

EndIf

ElseIf($iType == 8) Then

$strCombo3 = $str3&'.bmp'
ControlCommand($winPixel,"",1082,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1082, "SelectString", $strCombo3)
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1082)
sleep($iSleepTime)
if($strOutPath == '24bit_' AND $strChannel = 'RED') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'RED')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'GREEN') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'BLUE') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

EndIf

if($strCheckButton == 1) Then

ControlCommand($winPixel,"", "Button6", "Check", "")
if (@error == 1)Then

FileWriteLine($file,"Error: Check Button Fail")

Else

FileWriteLine($file,"Check Buttton Pass")

EndIf

Elseif($strCheckButton == 0)Then

ControlCommand($winPixel,"", "Button6", "UnCheck", "")
if (@error == 1)Then

FileWriteLine($file,"Error: UnCheck check Button Fail")

Else

FileWriteLine($file,"Uncheck Check Buttton Pass")

EndIf

EndIf

Local $strClickOk = ControlClick($winPixel,"","Button8")
if($strClickOk == 1) Then

FileWriteLine($file,"Click OK Sucesss")
sleep($iSleepTime)
Local $warnOut = WinExists("ss","Please select an input image.")
if $warnOut == 1 Then

FileWriteLine($file,"Warning: Select An Input Image")
Local $warnOK = ControlClick("ss","Please select an input image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf

EndIf
Local $strOutput = WinExists("ss","Min val ")
if ($strOutput == 1) Then

$strOutputText = WinGetText("ss","")
FileWriteLine($file,$strOutputText)
ControlClick("ss","","Button1")

Else

FileWriteLine($file,"Error: Cannot Produce the output")

EndIf
sleep($iSleepTime)

Local $strClickCancel = ControlClick($winPixel,"","Button7")
if($strClickCancel == 1) Then

FileWriteLine($file,"Click Cancel button Sucesss")

Else

FileWriteLine($file,"Click Cancel Button Fail")

EndIf
WinClose($iHandle1)

EndIf

ElseIf($iType == 9) Then

Local $setText = ControlSetText($winPixel,"","Edit1",$strGetPixelRow)
if ($setText == 0) Then

FileWriteLine($file,"Error: Set Row value Fail")

Else

FileWriteLine($file,"Set Row value Success")

EndIf

Local $setText1 = ControlSetText($winPixel,"","Edit2",$strGetPixelCol)
if ($setText1 == 0) Then

FileWriteLine($file,"Error: Set Col value Fail")

Else

FileWriteLine($file,"Set Col value Success")

EndIf

$strCombo3 = $str3&'.bmp'
ControlCommand($winPixel,"",1082,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1082, "SelectString", $strCombo3)
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1082)
sleep($iSleepTime)

ControlCommand($winPixel,"",1083,"ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "",1083, "SelectString", 'NewImage')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"",1083)
sleep($iSleepTime)

if($strOutPath == '24bit_' AND $strChannel = 'RED') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'RED')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'GREEN') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

ElseIf($strOutPath == '24bit_' AND $strChannel = 'BLUE') Then

ControlCommand($winPixel,"","ComboBox6","ShowDropDown", "")
if @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox ShowDropDown Fail")

Else

FileWriteLine($file,"Input Image ComboBox ShowDropDown Pass")

EndIf
ControlCommand($winPixel, "","ComboBox6", "SelectString", 'GREEN')
If @error == 1 Then

FileWriteLine($file,"Error: Input Image ComboBox Set String Fail")

Else

FileWriteLine($file,"Input Image ComboBox Set String Pass")

EndIf
ControlClick($winPixel,"","ComboBox6")
sleep($iSleepTime)

EndIf

Local $setText3 = ControlSetText($winPixel,"","Edit3",$strGetPixelVal)
if ($setText3 == 0) Then

FileWriteLine($file,"Error: Set pixel value Fail")

Else

FileWriteLine($file,"Set pixel value Success")

EndIf

Local $strClickOk = ControlClick($winPixel,"","Button8")
if($strClickOk == 1) Then

FileWriteLine($file,"Click OK Sucesss")
sleep($iSleepTime)
Local $warnOut = WinExists("ss","Please select an input image.")
if $warnOut == 1 Then

FileWriteLine($file,"Warning: Select An Input Image")
Local $warnOK = ControlClick("ss","Please select an input image.","Button1")
if $warnOK == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut1 = WinExists("ss","Please enter a valid Width value.")
if $warnOut1 == 1 Then

FileWriteLine($file,"Warning: Please enter a valid Width value. ")
Local $warnOK1 = ControlClick("ss","Please enter a valid Width value.","Button1")
if $warnOK1 == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut2 = WinExists("ss","Please enter a valid Height value.")
if $warnOut2 == 1 Then

FileWriteLine($file,"Warning: Please enter a valid Height value.")
Local $warnOK2 = ControlClick("ss","Please enter a valid Heigth value.","Button1")
if $warnOK2 == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $warnOut3 = WinExists("ss","Please select an output image.")
if $warnOut3 == 1 Then

FileWriteLine($file,"Warning: Please select an output image.")
Local $warnOK2 = ControlClick("ss","Please select an output image.","Button1")
if $warnOK2 == 1 Then

FileWriteLine($file,"Click Ok: Success")
Sleep($iSleepTime)
ControlClick($winPixel,"","Button7")
Sleep($iSleepTime)
;MouseClick("Left",$iXCord,$iYCord,1)
WinClose($iHandle1)

Else

FileWriteLine($file,"Warning: Click OK Fail")

EndIf
$iReset = 0

EndIf

Local $iGetPixelText = ControlGetText($winPixel,"","Edit4")
if @error == 1 Then

FileWriteLine($file,"Error: Edit4 ControlGetText for Sum: Fail")

Else

FileWriteLine($file,"Edit4: ControlGetText Pass")
$strTypeSum = 'Pixel value at row-'&$strGetPixelRow&'Column-'&$strGetPixelCol&' for image -'&$strCombo3&' is :'&$iGetPixelText
FileWriteLine($file,$strTypeSum)

EndIf
sleep($iSleepTime)

if($iReset == 1) Then

ControlClick($winPixel,"","Button7")
ControlClick("ss","",59398,"left",1,$iXClickFile,$iYClickFile)
ControlClick("ss","",59398,"left",1,$iXClickSaveAs,$iYClickSaveAs)
sleep($iSleepTime)
Local $winSaveAs = WinWaitActive("Save As","")
if($WinSaveAs == 0) Then

FileWriteLine($file,"Error: File->SaveAs Window Not Active")

Else

$strType = '_'&$strGetPixelRow&'_'&$strGetPixelCol&'_'&$strGetPixelVal&'_SetPixel.bmp'

FileWriteLine($file,"File->SaveAs Window is Active")
$str31 = $strOut&$strType
$strSaveFile = $str31
Local $strSave = ControlSetText($winSaveAs,"","Edit1",$strSaveFile)
if($strSave == 0) Then

FileWriteLine($file,"Error: SaveAs->ImagePath Set Text Fail")

Else

FileWriteLine($file,"SaveAs->ImagePath Set Text Pass")
ControlClick($winSaveAs,"","Button1") ;Button2 for WinXP
if @error == 1 Then

FileWriteLine($file,"Error: Click On Save Fail")

Else

FileWriteLine($file,"Click On Save Pass")
FileWriteLine($file,"Save Image Success")

sleep($iSleepTime)
Local $var3 = ControlGetText( "[ACTIVE]","", "[ID:65280]" )
$process2 = 'Output Image: '&$var3
FileWriteLine($file,$process2)
sleep($iSleepTime)

Global $iHandle3 = ControlGetHandle("[ACTIVE]","","[ID:65280]")
if(@error == 1) Then

FileWriteLine($file,"Cannot Get Handle")

Else

WinClose($iHandle3)
Sleep($iSleepTime)
WinClose($iHandle1)

EndIf

EndIf

EndIf

EndIf
WinClose($iHandle3)
WinClose($iHandle1)

EndIf
Local $strClickCancel = ControlClick($winPixel,"","Button7")
if($strClickCancel == 1) Then

FileWriteLine($file,"Click Cancel button Sucesss")

Else

FileWriteLine($file,"Click Cancel Button Fail")

EndIf
WinClose($iHandle1)

Else

FileWriteLine($file,"Error: Click Ok Fail")
ControlClick($winPixel,"","Button7")
WinClose($iHandle1)

EndIf

EndIf

EndIf

EndFunc

Attachments (0)

Change History (3)

comment:1 Changed 7 years ago by TicketCleanup

  • Version 3.3.8.1 deleted

Automatic ticket cleanup.

comment:2 Changed 7 years ago by Jpm

If you need help go to the forum.
Anyway just follow the advise to submit a bug report.
Your script should isolate the error which is not the case with a so lengthy script

comment:3 Changed 7 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.