Esempio n. 1
0
GBindingPool::MethodKey GBindingPool::doMakeMethodKey(const GScriptValue & scriptValue)
{
	if(scriptValue.getType() == GScriptValue::typeMethod) {
		void * instance;
		GScopedInterface<IMetaMethod> method(scriptValue.toMethod(&instance));
		return std::make_tuple(method.get(), instance);
	}
	else { // GScriptValue::typeOverloadedMethods
		GScopedInterface<IMetaList> methodList(scriptValue.toOverloadedMethods());
		return std::make_tuple(methodList.get(), nullptr);
	}
}
Esempio n. 2
0
QString SiteResponseModel::toHtml()
{
    QString html;

    // Define the html header
    html += "<html><head>"
            "<title>Strata Input</title>"
            "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />"
            "<style type=\"text/css\">"
            "ol {"
            "list-style-type: upper-roman;"
            "font-size: 	medium;"
            "font-weight:   bold;"
            "}"
            "ol ol {"
            "list-style-type: upper-alpha;"
            "font-size: 	medium;"
            "font-weight:   bold;"
            "}"
            "ol ol ol {"
            "list-style-type: decimal;"
            "font-size: 	medium;"
            "font-weight:   bold;"
            "}"
            "ol ol ol ol {"
            "list-style-type: lower-alpha;"
            "font-size: 	medium;"
            "font-weight:   bold;"
            "}"
            "strong {"
            "font-size:     small;"
            "font-weight:   bold;"
            "}"
            "th {"
            "font-size:     small;"
            "font-weight:   bold;"
            "padding: 2px 4px 2px 4px;"
            "align: right;"
            "}"
            "td {"
            "font-size: 	small;"
            "font-weight:   normal;"
            "padding: 2px 4px 2px 4px;"
            "}"
            "table {"
            "border-style:  solid;"
            "border-collapse:  collapse;"
            "}"
            "</style>"
            "</head>";

    // Project
    html += tr("<h1>%1</h1>"
               "<ol>"
               "<li>General Settings"
               "<ol>"
               "<li>Project"
               "<table border=\"0\">"
               "<tr><th>Title:</th><td>%1</td></tr>"
               "<tr><th>Notes:</th><td>%2</td></tr>"
               "<tr><th>File preffix:</th><td>%3</td></tr>"
               "<tr><th>Units System:</th><td>%4</td></tr>"
               "</table>"
               "</li>"
              )
            .arg(m_outputCatalog->title())
            .arg(m_notes->toHtml())
            .arg(m_outputCatalog->filePrefix())
            .arg(Units::instance()->systemList().at(Units::instance()->system()));


    // Type of Analysis
    html += tr(
                "<li>Type of Analysis"
                "<table border=\"0\">"
                "<tr><th>Analysis Method:</th><td>%1</td></tr>"
                "<tr><th>Approach:</th><td>%2</td></tr>"
                "<tr><th>Properties Varied:</th><td>%3</td></tr>"
                "</table>"
                "</li>"
            )
            .arg(methodList().at(m_method))
            .arg(MotionLibrary::approachList().at(m_motionLibrary->approach()))
            .arg(boolToString(m_siteProfile->isVaried()));

    // Site Variation
    if ( m_siteProfile->isVaried() )
        html += tr(
                    "<li>Site Property Variation"
                    "<table border=\"0\">"
                    "<tr><th>Number of realizations:</th><td>%1</td></tr>"
                    "<tr><th>Vary the nonlinear soil properties:</th><td>%2</td></tr>"
                    "<tr><th>Vary the site profile:</th><td>%3</td></tr>"
                    "</table>"
                    "</li>"
                )
                .arg(m_siteProfile->profileCount())
                .arg(boolToString(m_siteProfile->nonlinearPropertyRandomizer()->enabled()))
                .arg(boolToString(m_siteProfile->profileRandomizer()->enabled()));

    // Layer Discretization
    html += tr(
                "<li>Layer Discretization"
                "<table border=\"0\">"
                "<tr><th>Maximum frequency:</th><td>%1 Hz</td></tr>"
                "<tr><th>Wavelength fraction:</th><td>%2</td></tr>"
                "</table>"
                "</li>"
            )
            .arg(m_siteProfile->maxFreq())
            .arg(m_siteProfile->waveFraction());

    // Calculator parameters
    html += m_calculator->toHtml();

    html += "</ol>";

    // Site profile
    html += "<li>" + m_siteProfile->toHtml() + "</li>";

    // Motions
    html += tr("<li>Motion(s)");

    QString loc;
    if (m_siteProfile->inputDepth() < 0)
        loc = "Bedrock";
    else
        loc = QString("%1 %2").arg(m_siteProfile->inputDepth()).arg(Units::instance()->length());

    html += tr("<table border=\"0\"><tr><th>Input Location:</th><td>%1</td></tr></table>")
            .arg(loc);

    html += m_motionLibrary->toHtml() + "</li>";

    // Close the html file
    html += "</ol></html>";

    return html;
}