source: XIOS/dev/dev_trunk_graph/src/workflow_graph.hpp @ 2026

Last change on this file since 2026 was 2026, checked in by yushan, 9 months ago

Graph intermediate commit to a tmp branch.

File size: 2.8 KB
Line 
1#ifndef __WORKFLOW_GRAPH_HPP__
2#define __WORKFLOW_GRAPH_HPP__
3
4#include "xios_spl.hpp"
5#include "field.hpp"
6#include "grid.hpp"
7#include "garbage_collector.hpp"
8#include "date.hpp"
9#include "duration.hpp"
10#include "context.hpp"
11
12namespace xios
13{
14  class CField;
15
16  struct graph_node_object
17  {
18    StdString filter_name;
19
20    int filter_class;
21    bool filter_filled;
22    int expected_entry_nb;
23    CDate date;
24    Time timestamp;
25    StdString transform_type;
26    StdString attributes;
27    StdString field_id;
28    bool inputs_complete;
29    int filter_tag;
30    int clusterID;
31    int distance;
32    StdString context_id;
33    int context;
34    StdString label_field_id;
35    bool show;
36
37
38    graph_node_object():show(true){}
39
40  };
41
42  struct graph_edge_object
43  {
44    int from;
45    int to;
46
47    StdString field_id;
48    StdString field_name;
49    StdString grid_id;
50    CDate date;
51    Time timestamp;
52    CField *field;
53    StdString attributes;
54    StdString context_id;
55    int context;
56    bool show;
57   
58    graph_edge_object():show(true){}
59  };
60
61  class CWorkflowGraph
62  {
63    public:
64
65      CWorkflowGraph();
66
67      /*! Map between fields identified by its id and their filters identified by an integer.
68       * It is filled up during reconstruction of a workflow (in function CField::buildFilterGraph()).
69      */
70
71      static std::vector<graph_node_object> *vectorOfNodes_;
72      static std::vector<graph_edge_object> *vectorOfEdges_; 
73      static std::vector<StdString> *vectorOfContexts_; 
74
75      static std::vector<graph_node_object> *vectorOfNodes_srv_;
76      static std::vector<graph_edge_object> *vectorOfEdges_srv_;
77      static std::vector<StdString> *vectorOfContexts_srv_; 
78
79      // these variables are not yet used
80      static bool clientGraphBuilt;
81      static bool serverGraphBuilt;
82      static bool build_begin;
83
84
85      static void drawWorkFlowGraph_client();
86      static void drawWorkFlowGraph_server();
87
88
89      static void addNode(StdString filterName, int filter_class, bool filter_filled, int entry_nb, CDataPacketPtr packet);
90      static void addEdge(int from, int to, CDataPacketPtr packet);
91     
92      // write to file the graph info
93      static void outputWorkflowGraph_client();
94      static void outputWorkflowGraph_server();
95     
96      // output on screen the graph info
97      static void outputWorkflowGraph_client_stdout();
98      static void outputWorkflowGraph_server_stdout();
99
100      static int  getNodeSize();
101
102
103
104     
105
106
107    private:
108
109      //! List of fields marked for visualizing of their workflow
110      static vector <StdString> fields;
111
112      //! List of connected filters for fields for visualizing of their workflow
113      static vector <StdString> filters;
114
115      //! Fields to filters connectivity
116      static vector <pair<int, int> > fieldsToFilters;
117
118      static void buildStaticWorkflow();
119
120
121
122  };
123
124}
125
126#endif
127
Note: See TracBrowser for help on using the repository browser.