206 { |
206 { |
207 update_refresh_period(dsc, reset_session_index, 0); |
207 update_refresh_period(dsc, reset_session_index, 0); |
208 return 0; |
208 return 0; |
209 } |
209 } |
210 |
210 |
211 void SVGHMI_SuspendFromPythonThread(void); |
211 static void *svghmi_handle; |
212 void SVGHMI_WakeupFromRTThread(void); |
212 |
|
213 void SVGHMI_SuspendFromPythonThread(void) |
|
214 { |
|
215 wait_RT_to_nRT_signal(svghmi_handle); |
|
216 } |
|
217 |
|
218 void SVGHMI_WakeupFromRTThread(void) |
|
219 { |
|
220 unblock_RT_to_nRT_signal(svghmi_handle); |
|
221 } |
213 |
222 |
214 int svghmi_continue_collect; |
223 int svghmi_continue_collect; |
215 |
224 |
216 int __init_svghmi() |
225 int __init_svghmi() |
217 { |
226 { |
218 bzero(rbuf,sizeof(rbuf)); |
227 bzero(rbuf,sizeof(rbuf)); |
219 bzero(wbuf,sizeof(wbuf)); |
228 bzero(wbuf,sizeof(wbuf)); |
220 |
229 |
221 svghmi_continue_collect = 1; |
230 svghmi_continue_collect = 1; |
222 |
231 |
|
232 /* create svghmi_pipe */ |
|
233 svghmi_handle = create_RT_to_nRT_signal("SVGHMI_pipe"); |
|
234 |
|
235 if(!svghmi_handle) |
|
236 return 1; |
|
237 |
223 return 0; |
238 return 0; |
224 } |
239 } |
225 |
240 |
226 void __cleanup_svghmi() |
241 void __cleanup_svghmi() |
227 { |
242 { |
228 svghmi_continue_collect = 0; |
243 svghmi_continue_collect = 0; |
229 SVGHMI_WakeupFromRTThread(); |
244 SVGHMI_WakeupFromRTThread(); |
|
245 delete_RT_to_nRT_signal(svghmi_handle); |
230 } |
246 } |
231 |
247 |
232 void __retrieve_svghmi() |
248 void __retrieve_svghmi() |
233 { |
249 { |
234 traverse_hmi_tree(read_iterator); |
250 traverse_hmi_tree(read_iterator); |