Ejemplo n.º 1
0
template<> void Visitor<Writer<JSONObject>>::writeTo(Scenario::BaseScenario& base_scenario)
{
    writeTo(static_cast<Scenario::BaseScenarioContainer&>(base_scenario));

    Deserializer<JSONValue> elementPluginDeserializer(m_obj["PluginsMetadata"]);
    base_scenario.pluginModelList = iscore::ElementPluginModelList{elementPluginDeserializer, &base_scenario};
}
Ejemplo n.º 2
0
void Visitor<Writer<JSONObject>>::writeTo(JSProcessModel& proc)
{
    Deserializer<JSONValue> elementPluginDeserializer(m_obj["PluginsMetadata"]);
    proc.pluginModelList = new iscore::ElementPluginModelList{elementPluginDeserializer, &proc};

    proc.setScript(m_obj["Script"].toString());
}
Ejemplo n.º 3
0
void Visitor<Writer<JSONObject>>::writeTo(AutomationModel& autom)
{
    Deserializer<JSONValue> elementPluginDeserializer(m_obj["PluginsMetadata"]);
    autom.pluginModelList = new iscore::ElementPluginModelList{elementPluginDeserializer, &autom};

    Deserializer<JSONObject> curve_deser{m_obj["Curve"].toObject()};
    autom.setCurve(new CurveModel{curve_deser, &autom});

    autom.setAddress(fromJsonObject<iscore::Address>(m_obj["Address"].toObject()));
    autom.setMin(m_obj["Min"].toDouble());
    autom.setMax(m_obj["Max"].toDouble());
}
void Visitor<Writer<JSONObject>>::writeTo(ScenarioModel& scenario)
{
    Deserializer<JSONValue> elementPluginDeserializer(m_obj["PluginsMetadata"]);
    scenario.pluginModelList = new iscore::ElementPluginModelList{elementPluginDeserializer, &scenario};

    scenario.m_startTimeNodeId = fromJsonValue<id_type<TimeNodeModel>> (m_obj["StartTimeNodeId"]);
    scenario.m_endTimeNodeId = fromJsonValue<id_type<TimeNodeModel>> (m_obj["EndTimeNodeId"]);
    scenario.m_startEventId = fromJsonValue<id_type<EventModel>> (m_obj["StartEventId"]);
    scenario.m_endEventId = fromJsonValue<id_type<EventModel>> (m_obj["EndEventId"]);

    for(const auto& json_vref : m_obj["TimeNodes"].toArray())
    {
        auto tnmodel = new TimeNodeModel {
                       Deserializer<JSONObject>{json_vref.toObject() },
                       &scenario};

        scenario.addTimeNode(tnmodel);
    }

    for(const auto& json_vref : m_obj["Events"].toArray())
    {
        auto evmodel = new EventModel {
                       Deserializer<JSONObject>{json_vref.toObject() },
                       &scenario};

        scenario.addEvent(evmodel);
    }

    for(const auto& json_vref : m_obj["States"].toArray())
    {
        auto stmodel = new StateModel {
                       Deserializer<JSONObject>{json_vref.toObject() },
                       &scenario};

        scenario.addDisplayedState(stmodel);
    }

    for(const auto& json_vref : m_obj["Constraints"].toArray())
    {
        auto constraint = new ConstraintModel{
                Deserializer<JSONObject>{json_vref.toObject() },
                &scenario};
        scenario.addConstraint(constraint);
    }
}
Ejemplo n.º 5
0
void Visitor<Writer<JSONObject>>::writeTo(
        Dummy::DummyModel& proc)
{
    Deserializer<JSONValue> elementPluginDeserializer(m_obj["PluginsMetadata"]);
    proc.pluginModelList = new iscore::ElementPluginModelList{elementPluginDeserializer, &proc};
}