使用
sciter::value arr[6];
arr[0] = (int)g_CopyStructSuccess.CopyFailed;
arr[1] = (int)g_CopyStructSuccess.CopySuccess;
arr[2] = (int)g_CopyStructSuccess.DeleteFailed;
arr[3] = (int)g_CopyStructSuccess.DeleteSuccess;
arr[4] = (int)g_CopyStructSuccess.CopySum;
arr[5] = (int)((g_CopyStructSuccess.MigrateSucceedSize / 1024) / 1024);
sciter::value sciOut(arr, 6);
MainFrame*pMainFrame = (MainFrame*)g_MainFrame; //封装无需要理会
pMainFrame->OnDiskFileCopyAllSum(sciOut);
sciter::value MainFrame::OnDiskFileCopyAllSum(value CopyFailed)
{
call_function("DiskFileCopyAllSum", CopyFailed);
return true;
}
/***************后端发送拷贝数据接收******前端接收***************/
function DiskFileCopyAllSum(ArrDiskData)
{
stdout.println("ArrDiskData = 1");
return;
var CopySum = ArrDiskData;
var Progress_Copy = $(#ProgressID_Copy);
//CopySum Arr 0拷贝失败 1拷贝成功 2删除失败 3删除成功 4拷贝总数 5拷贝成功总大小
//CopySum = 0,7430,0,7429,7494,300
stdout.println("拷贝数据获取 CopySum = "+CopySum);
if(CopySum!=0)
{
for(var i = 0;i<CopySum.length;i++)
{
//var CopySuccess = CopySum[1];
//stdout.println("CopySuccess value = "+CopySuccess);
stdout.println("CopySum[1] 文件大小 = " + CopySum[5]);
var ProgressSum = PercentageCalculation(CopySum[1],CopySum[4]);
Progress_Copy.value = ProgressSum;
$(#DiskHome2).$(.disk-postion).html = ProgressSum + "%";
if(CopySum[5] > 1024) //GB
{
$(#CopySizeMB).html = (CopySum[5] /1024) +"GB";
}
$(#CopySizeMB).html = CopySum[5]+"MB";
stdout.println(" value = "+Progress_Copy.value);
if(ProgressSum == 100)
{
stdout.println("这里停止计时器 Progress_Copy = "+ ProgressSum);
var TipsText = "<label>迁移完成!</label>";
PopupWindowsTest(TipsText,1,282,142,0);
DiskScanFileTree();
return false;
}
}
}
else
{
return false;
}
return true;
}