private void NormalStoppage(Boolean set) { Action setter = () => { if (set) { button4.BackColor = Color.Red; pictureBox_Click(null, null); QTtool.playWavAudio(Properties.Resources.ALARM3); } else { button4.BackColor = System.Drawing.SystemColors.ControlLight; } }; if (button4.BackColor == Color.Red && !set || button4.BackColor != Color.Red && set) { if (button4.InvokeRequired) { button4.Invoke(setter); } else { setter(); } } }
public int onTAudioCastEvent(int eventMsg, string parstr) { lock (realview.calls) { List <BroadCallInfo> calls = QTtool.GetCallBroadIP(parstr); foreach (BroadCallInfo mycall in calls) { // if (!mycall.ip.Contains("1.90")) realview.calls.Add(mycall); } Debug.WriteLine(DateTime.Now.ToLocalTime().ToString() + ":" + parstr); string[] ls = parstr.Split(); lefttime = 1; } // audioMsg.Enqueue(parstr); Debug.WriteLine(DateTime.Now.ToLocalTime().ToString() + ":" + parstr); executedCounts++; return(1); }
public static void OnBroadCallListener(BroadCallInfo mycall) { elevatorinfo el = ht[mycall.ip] as elevatorinfo; if (el == null) { return; } if (mycall.e_num == 3) { boardIP = mycall.ip; el.pictureBox_Click(null, null); //el.playAlerm(); QTtool.playWavAudio(Properties.Resources.ALARM3); Log.log(el.lbpostion.Text + "呼叫" + " " + " " + el.lbnum.Text + " " + "电梯IP " + el.MMC_ip); } else if (mycall.ip == boardIP && mycall.e_num == 1) { TestForm.instantsClose(); } }