1 | /* ************************************************************************** * |
---|
2 | * Copyright © IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011 * |
---|
3 | * ************************************************************************** */ |
---|
4 | |
---|
5 | #include <boost/multi_array.hpp> |
---|
6 | #include <boost/shared_ptr.hpp> |
---|
7 | |
---|
8 | #include "xmlioserver.hpp" |
---|
9 | |
---|
10 | #include "attribute_template_impl.hpp" |
---|
11 | #include "object_template_impl.hpp" |
---|
12 | #include "group_template_impl.hpp" |
---|
13 | |
---|
14 | #include "calendar_type.hpp" |
---|
15 | |
---|
16 | #include "icutil.hpp" |
---|
17 | |
---|
18 | extern "C" |
---|
19 | { |
---|
20 | // /////////////////////////////// Définitions ////////////////////////////// // |
---|
21 | |
---|
22 | void cxios_set_timestep(double ts_year, double ts_month, double ts_day, |
---|
23 | double ts_hour, double ts_minute, double ts_second) |
---|
24 | { |
---|
25 | try |
---|
26 | { |
---|
27 | date::CDuration dur = {ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second}; |
---|
28 | boost::shared_ptr<xmlioserver::tree::CContext> context = |
---|
29 | xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CContext> |
---|
30 | (CObjectFactory::GetCurrentContextId()); |
---|
31 | |
---|
32 | context->timestep.setValue(dur.toString()); |
---|
33 | context->sendAttributToServer("timestep") ; |
---|
34 | } |
---|
35 | catch (xmlioserver::CException & exc) |
---|
36 | { |
---|
37 | std::cerr << exc.getMessage() << std::endl; |
---|
38 | exit (EXIT_FAILURE); |
---|
39 | } |
---|
40 | } |
---|
41 | |
---|
42 | void cxios_update_calendar(int step) |
---|
43 | { |
---|
44 | boost::shared_ptr<xmlioserver::tree::CContext> context = |
---|
45 | xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CContext> |
---|
46 | (CObjectFactory::GetCurrentContextId()); |
---|
47 | context->updateCalendar(step) ; |
---|
48 | context->sendUpdateCalendar(step) ; |
---|
49 | |
---|
50 | } |
---|
51 | |
---|
52 | } // extern "C" |
---|