示例#1
0
void Model_Report::outputReportFile(const wxString& str)
{
    wxFileOutputStream index_output(mmex::getReportIndex());
    wxTextOutputStream index_file(index_output);
    index_file << str;
    index_output.Close();
}
bool Model_Report::outputReportFile(const wxString& str, const wxString& name)
{
    bool ok = true;
    wxFileOutputStream index_output(mmex::getReportFullName(name));
    if (index_output.IsOk())
    {
        wxTextOutputStream index_file(index_output);
        index_file << str;
        index_output.Close();
    }
    else
    {
        ok = false;
    }
    return ok;
}
示例#3
0
void mmReportsPanel::saveReportText()
{
    htmlreport_ = "coming soon..."; //TODO: ??
    if (rb_)
    {
        json::Object o;
        o[L"module"] = json::String(L"Report");
        o[L"name"] = json::String(rb_->title().ToStdWstring());
        o[L"start"] = json::String(wxDateTime::Now().FormatISOCombined().ToStdWstring());

        htmlreport_ = rb_->getHTMLText();

        wxFileOutputStream index_output(mmex::getReportIndex());
        wxTextOutputStream index_file(index_output);
        index_file << htmlreport_;
        index_output.Close();
        o[L"end"] = json::String(wxDateTime::Now().FormatISOCombined().ToStdWstring());
        Model_Usage::instance().append(o);
    }
}