@@ -57,14 +57,7 @@ clock_t timer;
5757
5858CBString myfrequency;
5959
60- map<CBString, CBString> vStrips_Stands;
61-
62- bool startThreadvStrips = true ;
63-
6460using namespace SMRPluginSharedData ;
65- asio::ip::udp::socket* _socket;
66- asio::ip::udp::endpoint receiver_endpoint;
67- // std::thread vStripsThread;
6861char recv_buf[1024 ];
6962
7063vector<CSMRRadar*> RadarScreensOpened;
@@ -243,48 +236,6 @@ void sendDatalinkClearance(void * arg)
243236 }
244237};
245238
246- void vStripsReceiveThread (const asio::error_code &error, size_t bytes_transferred)
247- {
248- // @TODO @HACK @BUG
249- // Never tested this with the new CBString, no idea if it works
250- // And since vStrips is no longer really a thing, is there any reason to still keep it?
251-
252- Logger::info (__FUNCSIG__);
253- CBString out (recv_buf, bytes_transferred);
254-
255- // Processing the data
256- CBStringList data;
257- data.split (out, ' :' );
258-
259- if (data.front () == " STAND" ) {
260- CSMRRadar::vStripsStands[data.at (1 )] = data.back ();
261- }
262-
263- if (data.front () == " DELETE" ) {
264- if (CSMRRadar::vStripsStands.find (data.back ()) != CSMRRadar::vStripsStands.end ()) {
265- CSMRRadar::vStripsStands.erase (CSMRRadar::vStripsStands.find (data.back ()));
266- }
267- }
268-
269- if (!error) {
270- _socket->async_receive_from (asio::buffer (recv_buf), receiver_endpoint,
271- std::bind (&vStripsReceiveThread, std::placeholders::_1, std::placeholders::_2));
272- }
273- }
274-
275- void vStripsThreadFunction (void * arg)
276- {
277- try {
278- _socket = new asio::ip::udp::socket (io_service, asio::ip::udp::endpoint (asio::ip::udp::v4 (), VSTRIPS_PORT));
279- _socket->async_receive_from (asio::buffer (recv_buf), receiver_endpoint,
280- std::bind (&vStripsReceiveThread, std::placeholders::_1, std::placeholders::_2));
281-
282- io_service.run ();
283- }
284- catch (std::exception& e) {
285- std::cerr << e.what () << std::endl;
286- }
287- }
288239
289240
290241CSMRPlugin::CSMRPlugin (void ) :CPlugIn(EuroScopePlugIn::COMPATIBILITY_CODE, MY_PLUGIN_NAME, MY_PLUGIN_VERSION, MY_PLUGIN_DEVELOPER, MY_PLUGIN_COPYRIGHT)
@@ -325,14 +276,6 @@ CSMRPlugin::CSMRPlugin(void) :CPlugIn(EuroScopePlugIn::COMPATIBILITY_CODE, MY_PL
325276 GetModuleFileNameA (HINSTANCE (&__ImageBase), DllPathFile, sizeof (DllPathFile));
326277 Logger::DLL_PATH = DllPathFile;
327278 Logger::DLL_PATH.rtrim (" vSMR.dll" );
328-
329- try {
330- // vStripsThread = std::thread();
331- _beginthread (vStripsThreadFunction, 0 , NULL );
332- }
333- catch (std::exception& e) {
334- std::cerr << e.what () << std::endl;
335- }
336279}
337280
338281CSMRPlugin::~CSMRPlugin ()
0 commit comments