Changeset 518 for XIOS/trunk/src/node/domain.cpp
- Timestamp:
- 11/26/14 15:12:12 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/domain.cpp
r509 r518 750 750 CContextClient* client=context->client ; 751 751 // send lon lat for each connected server 752 CEventClient event(getType(),EVENT_ID_LON_LAT) ; 753 754 list<shared_ptr<CMessage> > list_msg ; 752 753 CEventClient eventLon(getType(),EVENT_ID_LON) ; 754 CEventClient eventLat(getType(),EVENT_ID_LAT) ; 755 756 list<shared_ptr<CMessage> > list_msgLon ; 757 list<shared_ptr<CMessage> > list_msgLat ; 755 758 list< CArray<int,1>* > list_indi,list_indj ; 756 759 list< CArray<double,1>* >list_lon,list_lat ; … … 794 797 if (hasBounds) list_boundslat.push_back(new CArray<double,2>(boundslat.copy())) ; 795 798 796 list_msg.push_back(shared_ptr<CMessage>(new CMessage)) ; 797 798 *list_msg.back()<<this->getId()<<(int)type ; // enum ne fonctionne pour les message => ToFix 799 *list_msg.back()<<isCurvilinear ; 800 *list_msg.back()<<*list_indi.back()<<*list_indj.back()<<*list_lon.back()<<*list_lat.back() ; 801 if (hasBounds) *list_msg.back()<<*list_boundslon.back()<<*list_boundslat.back(); 802 event.push(connectedServer[ns],nbSenders[ns],*list_msg.back()) ; 799 list_msgLon.push_back(shared_ptr<CMessage>(new CMessage)) ; 800 list_msgLat.push_back(shared_ptr<CMessage>(new CMessage)) ; 801 802 *list_msgLon.back()<<this->getId()<<(int)type ; // enum ne fonctionne pour les message => ToFix 803 *list_msgLat.back()<<this->getId()<<(int)type ; 804 *list_msgLon.back()<<isCurvilinear ; 805 *list_msgLat.back()<<isCurvilinear ; 806 *list_msgLon.back()<<*list_indi.back()<<*list_indj.back()<<*list_lon.back() ; 807 *list_msgLat.back()<<*list_indi.back()<<*list_indj.back()<<*list_lat.back() ; 808 809 if (hasBounds) 810 { 811 *list_msgLon.back()<<*list_boundslon.back(); 812 *list_msgLat.back()<<*list_boundslat.back(); 813 } 814 eventLon.push(connectedServer[ns],nbSenders[ns],*list_msgLon.back()) ; 815 eventLat.push(connectedServer[ns],nbSenders[ns],*list_msgLat.back()) ; 803 816 } 804 817 805 client->sendEvent(event) ; 818 client->sendEvent(eventLon) ; 819 client->sendEvent(eventLat) ; 806 820 807 821 … … 828 842 return true ; 829 843 break ; 830 case EVENT_ID_LON_LAT : 831 recvLonLat(event) ; 844 case EVENT_ID_LON : 845 recvLon(event) ; 846 return true ; 847 break ; 848 case EVENT_ID_LAT : 849 recvLat(event) ; 832 850 return true ; 833 851 break ; … … 882 900 } 883 901 884 void CDomain::recvLon Lat(CEventServer& event)902 void CDomain::recvLon(CEventServer& event) 885 903 { 886 904 list<CEventServer::SSubEvent>::iterator it ; … … 890 908 string domainId ; 891 909 *buffer>>domainId ; 892 get(domainId)->recvLon Lat(*buffer) ;910 get(domainId)->recvLon(*buffer) ; 893 911 } 894 912 } 895 913 896 void CDomain::recvLon Lat(CBufferIn& buffer)914 void CDomain::recvLon(CBufferIn& buffer) 897 915 { 898 916 CArray<int,1> indi ; 899 917 CArray<int,1> indj ; 900 918 CArray<double,1> lon ; 901 CArray<double,1> lat ;902 919 CArray<double,2> boundslon ; 903 CArray<double,2> boundslat ;904 920 905 921 int type_int ; 906 buffer>>type_int>>isCurvilinear>>indi>>indj>>lon >>lat;907 if (hasBounds) buffer>>boundslon >>boundslat;922 buffer>>type_int>>isCurvilinear>>indi>>indj>>lon ; 923 if (hasBounds) buffer>>boundslon ; 908 924 type.setValue((type_attr::t_enum)type_int) ; // probleme des type enum avec les buffers : ToFix 909 925 … … 914 930 ind_srv=(i-(zoom_ibegin_srv-1))+(j-(zoom_jbegin_srv-1))*zoom_ni_srv ; 915 931 lonvalue_srv(ind_srv)=lon(ind) ; 916 latvalue_srv(ind_srv)=lat(ind) ;917 932 if (hasBounds) 918 933 { … … 920 935 { 921 936 bounds_lon_srv(nv,ind_srv)=boundslon(nv,ind) ; 937 } 938 } 939 } 940 } 941 942 void CDomain::recvLat(CEventServer& event) 943 { 944 list<CEventServer::SSubEvent>::iterator it ; 945 for (it=event.subEvents.begin();it!=event.subEvents.end();++it) 946 { 947 CBufferIn* buffer=it->buffer; 948 string domainId ; 949 *buffer>>domainId ; 950 get(domainId)->recvLat(*buffer) ; 951 } 952 } 953 954 void CDomain::recvLat(CBufferIn& buffer) 955 { 956 CArray<int,1> indi ; 957 CArray<int,1> indj ; 958 CArray<double,1> lat ; 959 CArray<double,2> boundslat ; 960 961 int type_int ; 962 buffer>>type_int>>isCurvilinear>>indi>>indj>>lat ; 963 if (hasBounds) buffer>>boundslat ; 964 type.setValue((type_attr::t_enum)type_int) ; // probleme des type enum avec les buffers : ToFix 965 966 int i,j,ind_srv ; 967 for(int ind=0;ind<indi.numElements();ind++) 968 { 969 i=indi(ind) ; j=indj(ind) ; 970 ind_srv=(i-(zoom_ibegin_srv-1))+(j-(zoom_jbegin_srv-1))*zoom_ni_srv ; 971 latvalue_srv(ind_srv)=lat(ind) ; 972 if (hasBounds) 973 { 974 for(int nv=0;nv<nvertex;nv++) 975 { 922 976 bounds_lat_srv(nv,ind_srv)=boundslat(nv,ind) ; 923 977 } … … 925 979 } 926 980 } 981 // void CDomain::recvLonLat(CEventServer& event) 982 // { 983 // list<CEventServer::SSubEvent>::iterator it ; 984 // for (it=event.subEvents.begin();it!=event.subEvents.end();++it) 985 // { 986 // CBufferIn* buffer=it->buffer; 987 // string domainId ; 988 // *buffer>>domainId ; 989 // get(domainId)->recvLonLat(*buffer) ; 990 // } 991 // } 992 // 993 // void CDomain::recvLonLat(CBufferIn& buffer) 994 // { 995 // CArray<int,1> indi ; 996 // CArray<int,1> indj ; 997 // CArray<double,1> lon ; 998 // CArray<double,1> lat ; 999 // CArray<double,2> boundslon ; 1000 // CArray<double,2> boundslat ; 1001 // 1002 // int type_int ; 1003 // buffer>>type_int>>isCurvilinear>>indi>>indj>>lon>>lat ; 1004 // if (hasBounds) buffer>>boundslon>>boundslat ; 1005 // type.setValue((type_attr::t_enum)type_int) ; // probleme des type enum avec les buffers : ToFix 1006 // 1007 // int i,j,ind_srv ; 1008 // for(int ind=0;ind<indi.numElements();ind++) 1009 // { 1010 // i=indi(ind) ; j=indj(ind) ; 1011 // ind_srv=(i-(zoom_ibegin_srv-1))+(j-(zoom_jbegin_srv-1))*zoom_ni_srv ; 1012 // lonvalue_srv(ind_srv)=lon(ind) ; 1013 // latvalue_srv(ind_srv)=lat(ind) ; 1014 // if (hasBounds) 1015 // { 1016 // for(int nv=0;nv<nvertex;nv++) 1017 // { 1018 // bounds_lon_srv(nv,ind_srv)=boundslon(nv,ind) ; 1019 // bounds_lat_srv(nv,ind_srv)=boundslat(nv,ind) ; 1020 // } 1021 // } 1022 // } 1023 // } 927 1024 //---------------------------------------------------------------- 928 1025
Note: See TracChangeset
for help on using the changeset viewer.