|
楼主 |
发表于 2010-8-25 13:23:06
|
显示全部楼层
Global $aRecords
If Not _FileReadToArray(@ScriptDir &"\data.log",$aRecords) Then
MsgBox(4096,"Error", " Error reading log to Array error:" & @error)
Exit
EndIf
Global $Param_min = IniRead(@ScriptDir &"\CPTest.ini", "Parameter", "Param_min", "NotFound")
Global $Param_max = IniRead(@ScriptDir &"\CPTest.ini", "Parameter", "Param_max", "NotFound")
Global $Param_1 = IniRead(@ScriptDir &"\CPTest.ini", "Parameter", "Param_1", "NotFound")
Global $Param_2 = IniRead(@ScriptDir &"\CPTest.ini", "Parameter", "Param_2", "NotFound")
Global $Param_3 = IniRead(@ScriptDir &"\CPTest.ini", "Parameter", "Param_3", "NotFound")
Global $Param_4 = IniRead(@ScriptDir &"\CPTest.ini", "Parameter", "Param_4", "NotFound")
Global $Param_5 = IniRead(@ScriptDir &"\CPTest.ini", "Parameter", "Param_5", "NotFound")
Global $Param_6 = IniRead(@ScriptDir &"\CPTest.ini", "Parameter", "Param_6", "NotFound")
Global $Param_7 = IniRead(@ScriptDir &"\CPTest.ini", "Parameter", "Param_7", "NotFound")
Global $Left_array[$aRecords[0]]
Global $Right_array[$aRecords[0]]
Global $total_array[$aRecords[0]]
_Readdata()
_Master_Volume()
Func _Readdata()
Local $i
For $i = 1 to $aRecords[0]
$array=StringSplit($aRecords[$i],'"',2)
$array1=StringSplit($array[1],':',2)
$Left_array[$i-1]=$array1[0]
$Right_array[$i-1]=$array1[1]
$total_array[$i-1]=$array1[2]
Next
EndFunc
Func _Master_Volume()
local $Right_array_1[3],$Right_array_2[3],$Right_array_3[3],$Right_array_4[3],$Right_array_5[3],$Right_array_6[3],$Right_array_7[3]
local $Left_array_1[3],$Left_array_2[3],$Left_array_3[3],$Left_array_4[3],$Left_array_5[3],$Left_array_6[3],$Left_array_7[3]
Local $StringWrite,$i
For $i = 0 to UBound($Right_array)-1
Switch $Right_array[$i]
Case 0 to Number($Param_min)
$Right_array_1[1]=$Right_array[$i]
$Right_array_1[2]=$i+1
case Number($Param_1) to Number($Param_2)
$Right_array_2[1]=$Right_array[$i]
$Right_array_2[2]=$i+1
case Number($Param_2) to Number($Param_3)
$Right_array_3[1]=$Right_array[$i]
$Right_array_3[2]=$i+1
case Number($Param_3) to Number($Param_4)
$Right_array_4[1]=$Right_array[$i]
$Right_array_4[2]=$i+1
case Number($Param_4) to Number($Param_5)
$Right_array_5[1]=$Right_array[$i]
$Right_array_5[2]=$i+1
case Number($Param_5) to Number($Param_6)
$Right_array_6[1]=$Right_array[$i]
$Right_array_6[2]=$i+1
case Number($Param_6) to Number($Param_7)
$Right_array_7[1]=$Right_array[$i]
$Right_array_7[2]=$i+1
EndSwitch
Switch $Left_array[$i]
Case 0 to Number($Param_min)
$Left_array_1[1]=$Left_array[$i]
$Left_array_1[2]=$i+1
case Number($Param_1) to Number($Param_2)
$Left_array_2[1]=$Left_array[$i]
$Left_array_2[2]=$i+1
case Number($Param_2) to Number($Param_3)
$Left_array_3[1]=$Left_array[$i]
$Left_array_3[2]=$i+1
case Number($Param_3) to Number($Param_4)
$Left_array_4[1]=$Left_array[$i]
$Left_array_4[2]=$i+1
case Number($Param_4) to Number($Param_5)
$Left_array_5[1]=$Left_array[$i]
$Left_array_5[2]=$i+1
case Number($Param_5) to Number($Param_6)
$Left_array_6[1]=$Left_array[$i]
$Left_array_6[2]=$i+1
case Number($Param_6) to Number($Param_7)
$Left_array_7[1]=$Left_array[$i]
$Left_array_7[2]=$i+1
EndSwitch
Next
EndFunc
cptest.ini
[Parameter]
Param_1 = 100
Param_2 = 3000
Param_3 = 6000
Param_4 = 11000
Param_5 = 18000
Param_6 = 28000
Param_7 = 32770
Param_min = 20
Param_max =32750 |
|