private void DoAlert(string type, string msg = "")
{
if (IsEdit)
return;
if (type == "alert")
{
if (Alerted)
{
if ((Helper.Now - LastAlerted).TotalSeconds < Micobject.alerts.minimuminterval)
{
return;
}
}
Alerted = true;
UpdateFloorplans(true);
LastAlerted = Helper.Now;
RemoteCommand?.Invoke(this, new ThreadSafeCommand("bringtofrontmic," + Micobject.id));
if (Micobject.detector.recordonalert)
{
StartSaving();
}
MainForm.MWS.WebSocketServer.SendToAll("alert|" + ObjectName);
}
var t = new Thread(() => AlertThread(type, msg, Micobject.id)) { Name = type + " (" + Micobject.id + ")", IsBackground = true };
t.Start();
}