@@ -2538,11 +2538,16 @@ void CMUSHclientDoc::ExecuteTriggerScript (CTrigger * trigger_item,
2538
2538
CString strReason = TFormat (" processing trigger \" %s\" " ,
2539
2539
(LPCTSTR) trigger_item->strLabel );
2540
2540
2541
+ // get unlabelled trigger's internal name
2542
+ const char * pLabel = trigger_item->strLabel ;
2543
+ if (pLabel [0 ] == 0 )
2544
+ pLabel = GetTriggerRevMap () [trigger_item].c_str ();
2545
+
2541
2546
if (GetScriptEngine () && GetScriptEngine ()->IsLua ())
2542
2547
{
2543
2548
list<double > nparams;
2544
2549
list<string> sparams;
2545
- sparams.push_back ((LPCTSTR) trigger_item-> strLabel );
2550
+ sparams.push_back (pLabel );
2546
2551
sparams.push_back ((LPCTSTR) strCurrentLine);
2547
2552
trigger_item->bExecutingScript = true ; // cannot be deleted now
2548
2553
GetScriptEngine ()->ExecuteLua (trigger_item->dispid ,
@@ -2583,7 +2588,7 @@ long i = 1;
2583
2588
2584
2589
// ::AfxMessageBox (trigger_item->trigger);
2585
2590
2586
- args [eTriggerName] = trigger_item-> strLabel ;
2591
+ args [eTriggerName] = pLabel ;
2587
2592
args [eCurrentLine] = strCurrentLine;
2588
2593
2589
2594
// --------------- set up wildcards array ---------------------------
@@ -4537,11 +4542,16 @@ double t = (tNow.m_dt - ((int) tNow.m_dt) ) * 86400.0;
4537
4542
CString strReason = TFormat (" processing timer \" %s\" " ,
4538
4543
(LPCTSTR) timer_item->strLabel );
4539
4544
4545
+ // get unlabelled timer's internal name
4546
+ const char * pLabel = timer_item->strLabel ;
4547
+ if (pLabel [0 ] == 0 )
4548
+ pLabel = GetTimerRevMap () [timer_item].c_str ();
4549
+
4540
4550
if (GetScriptEngine () && GetScriptEngine ()->IsLua ())
4541
4551
{
4542
4552
list<double > nparams;
4543
4553
list<string> sparams;
4544
- sparams.push_back ((LPCTSTR) timer_item-> strLabel );
4554
+ sparams.push_back (pLabel );
4545
4555
timer_item->bExecutingScript = true ; // cannot be deleted now
4546
4556
bool bResult = GetScriptEngine ()->ExecuteLua (timer_item->dispid ,
4547
4557
timer_item->strProcedure ,
@@ -4573,7 +4583,7 @@ double t = (tNow.m_dt - ((int) tNow.m_dt) ) * 86400.0;
4573
4583
DISPPARAMS params = { args, NULL , eArgCount, 0 };
4574
4584
4575
4585
// args [eTimerName] = strTimerName;
4576
- args [eTimerName] = timer_item-> strLabel ;
4586
+ args [eTimerName] = pLabel ;
4577
4587
timer_item->bExecutingScript = true ; // cannot be deleted now
4578
4588
bool bResult = ExecuteScript (timer_item->dispid ,
4579
4589
timer_item->strProcedure ,
@@ -4606,6 +4616,7 @@ double t = (tNow.m_dt - ((int) tNow.m_dt) ) * 86400.0;
4606
4616
{
4607
4617
TimerMap.RemoveKey (strTimerName);
4608
4618
delete timer_item;
4619
+ SortTimers ();
4609
4620
}
4610
4621
} // end of processing each timer
4611
4622
@@ -6354,12 +6365,14 @@ CTrigger * pTrigger;
6354
6365
POSITION pos;
6355
6366
6356
6367
GetTriggerArray ().SetSize (iCount);
6368
+ CTriggerRevMap ().empty ();
6357
6369
6358
6370
// extract pointers into a simple array
6359
6371
for (i = 0 , pos = GetTriggerMap ().GetStartPosition (); pos; i++)
6360
6372
{
6361
6373
GetTriggerMap ().GetNextAssoc (pos, strTriggerName, pTrigger);
6362
- GetTriggerArray ().SetAt (i, pTrigger);
6374
+ GetTriggerArray ().SetAt (i, pTrigger);
6375
+ GetTriggerRevMap () [pTrigger] = strTriggerName;
6363
6376
}
6364
6377
6365
6378
@@ -6404,12 +6417,14 @@ CAlias * pAlias;
6404
6417
POSITION pos;
6405
6418
6406
6419
GetAliasArray ().SetSize (iCount);
6420
+ CAliasRevMap ().empty ();
6407
6421
6408
6422
// extract pointers into a simple array
6409
6423
for (i = 0 , pos = GetAliasMap ().GetStartPosition (); pos; i++)
6410
6424
{
6411
6425
GetAliasMap ().GetNextAssoc (pos, strAliasName, pAlias);
6412
6426
GetAliasArray ().SetAt (i, pAlias);
6427
+ GetAliasRevMap () [pAlias] = strAliasName;
6413
6428
}
6414
6429
6415
6430
@@ -6422,6 +6437,28 @@ POSITION pos;
6422
6437
} // end of CMUSHclientDoc::SortAliases
6423
6438
6424
6439
6440
+ void CMUSHclientDoc::SortTimers (void )
6441
+ {
6442
+
6443
+ int iCount = GetTimerMap ().GetCount ();
6444
+ int i;
6445
+ CString strTimerName;
6446
+ CTimer * pTimer;
6447
+ POSITION pos;
6448
+
6449
+ CTimerRevMap ().empty ();
6450
+
6451
+ // extract pointers into a simple array
6452
+ for (i = 0 , pos = GetTimerMap ().GetStartPosition (); pos; i++)
6453
+ {
6454
+ GetTimerMap ().GetNextAssoc (pos, strTimerName, pTimer);
6455
+ GetTimerRevMap () [pTimer] = strTimerName;
6456
+ }
6457
+
6458
+ } // end of CMUSHclientDoc::SortTimers
6459
+
6460
+
6461
+
6425
6462
6426
6463
// CTime:Format only allows for a total field size of 128 bytes
6427
6464
CString CMUSHclientDoc::FormatTime (const CTime theTime,
0 commit comments