예제 #1
0
파일: report.c 프로젝트: baiyuanlab/zerovm
void Report(struct NaClApp *nap)
{
    GString *r = g_string_sized_new(BIG_ENOUGH_STRING);
    char *eol = report_mode == 1 ? "; " : "\n";
    char *acc = FinalAccounting();

    /* report validator state and user return code */
    REPORT(r, "%s%d%s", REPORT_VALIDATOR, validation_state, eol);
    REPORT(r, "%s%d%s", REPORT_DAEMON, daemon_state, eol);
    REPORT(r, "%s%d%s", REPORT_RETCODE, user_code, eol);

    /* add memory digest to cumulative digests if asked */
    if(nap != NULL && nap->manifest != NULL)
        if(nap->manifest->mem_tag != NULL)
            ReportTag(STDRAM, GetMemoryDigest(nap));

    /* report tags digests and remove ending " " if exist */
    REPORT(r, "%s", REPORT_ETAG);
    REPORT(r, "%s", digests->len == 0
           ? TAG_ENGINE_DISABLED : digests->str);
    g_string_truncate(r, r->len - 1);

    /* report accounting and session message */
    if(zvm_state == NULL) zvm_state = UNKNOWN_STATE;
    REPORT(r, "%s%s%s%s", eol, REPORT_ACCOUNTING, acc, eol);
    REPORT(r, "%s%s%s", REPORT_STATE,
           zvm_state == NULL ? UNKNOWN_STATE : zvm_state, eol);
    REPORT(r, "%s%s", REPORT_CMD, eol);
    OutputReport(r->str);

    g_string_free(r, TRUE);
    g_free(acc);
}
//第六次扫描:积分并整理
void CSignalProcessDlg::OnSixthScan()
{
	m_PeakDraw.ClearLine();
	//m_PeakSeak.ConfigArgs_SixthScan(); //(接口)信号处理:最终整理
	m_PeakSeak.SP_SixthScan();
	m_PeakDraw.SetCPeakSeakData(m_PeakSeak);
	m_PeakDraw.SignalDisplay();
	
	m_Peak.clear();
	m_PeakSeak.GetPeakResult(m_Peak);
	OutputReport();
	m_ConfigArgs.clear();
	m_ConfigArgs = m_PeakSeak.m_AnalysisConfigArg.GetResultArgument();

	//把最终结果配置列表保存到txt文件中去
//	CReadSaveArgs ReadSaveArgs;
//	ReadSaveArgs.Write2Txt(&m_ConfigArgs);

	OutputResultConfigArgs(); //输入最终结果配置列表

	GetDlgItem(IDC_SIXTHSCAN)->EnableWindow(FALSE);  //第六次按键inactive

	CString szMsg;
	m_PeakSeak.GetPeakTypeStr(szMsg);
	MessageBox(szMsg);

}
예제 #3
0
파일: report.c 프로젝트: baiyuanlab/zerovm
void FastReport()
{
    char *eol = report_mode == 1 ? "; " : EOL;
    static int64_t start = 0;
    int64_t now = 0;
    struct timeval t;
    char *acc = NULL;
    char *r = NULL;

    /* skip fast report if specified */
    if(report_mode != 2) return;

    /* check if it is time to report */
    gettimeofday(&t, NULL);
    now = MICRO_PER_SEC * t.tv_sec + t.tv_usec;
    if(now - start < QUANT) return;
    start += start == 0 ? now : QUANT;

    /* create and output report */
    acc = FastAccounting();
    r = g_strdup_printf("%s%s%s", REPORT_ACCOUNTING, acc, eol);
    OutputReport(r);

    g_free(acc);
    g_free(r);
}
//第三次扫描:重叠峰处理
void CSignalProcessDlg::OnThirdScan()
{
	m_PeakDraw.ClearLine();
	//(接口)信号处理:重叠峰处理(垂直分峰,峰谷连线,切线分峰
	m_PeakSeak.SP_ThirdScan();
	m_PeakDraw.SetCPeakSeakData(m_PeakSeak);
	m_PeakDraw.SignalDisplay();
	
	GetDlgItem(IDC_FOURTHSCAN)->EnableWindow(TRUE);
	GetDlgItem(IDC_THIRDSCAN)->EnableWindow(FALSE);  //第三次按键inactive
	m_PeakSeak.GetPeakResult(m_Peak);
	OutputReport();
}
//第二次扫描:去除不要的峰
void CSignalProcessDlg::OnSecondScan()
{
	m_PeakDraw.ClearLine();	
	//m_PeakSeak.ConfigArgs_SecondScan(); //(接口)信号处理:去除不要的峰
	m_PeakSeak.SP_SecondScan();
	m_PeakDraw.SetCPeakSeakData(m_PeakSeak);
	m_PeakDraw.SignalDisplay();

	m_PeakSeak.GetPeakResult(m_Peak);
	OutputReport();
	GetDlgItem(IDC_THIRDSCAN)->EnableWindow(TRUE);  //第三次按键active
	GetDlgItem(IDC_SECONDSCAN)->EnableWindow(FALSE); //第二次扫描按键inactive
}
//第五次扫描:手工调整峰
void CSignalProcessDlg::OnFifthScan()
{
	m_PeakDraw.ClearLine();
	//m_PeakSeak.ConfigArgs_FourthScan(); //(接口)信号处理:手工调整峰(合并峰、手工分峰、手工基线、手工封顶
	m_PeakSeak.SP_FifthScan();
	m_PeakDraw.SetCPeakSeakData(m_PeakSeak);
	m_PeakDraw.SignalDisplay();

	GetDlgItem(IDC_SIXTHSCAN)->EnableWindow(TRUE);
	GetDlgItem(IDC_FIFTHSCAN)->EnableWindow(FALSE);  //第五次按键inactive
	
	m_PeakSeak.GetPeakResult(m_Peak);
	OutputReport();
}
//第4次扫描:基线的校正
void CSignalProcessDlg::OnFourthScan()
{
	m_PeakDraw.ClearLine();
    //(接口)信号处理:基线校正
	m_PeakSeak.SP_FourthScan();
	m_PeakSeak.SP_FourthScan(); // 1 more time
	m_PeakDraw.SetCPeakSeakData(m_PeakSeak);
	m_PeakDraw.SignalDisplay();

	GetDlgItem(IDC_FIFTHSCAN)->EnableWindow(TRUE);
	GetDlgItem(IDC_FOURTHSCAN)->EnableWindow(FALSE);  //第四次按键inactive
	m_PeakSeak.GetPeakResult(m_Peak);
	OutputReport();
}