示例#1
0
文件: Form1.cs 项目: karlnet/mpb
 // ///////////////////////////////////////////////////////////////////////////////
 public void MPBAddEvect(MyMBP m)
 {
     m.newTempValue += TempUpdate;
     m.newRelayValue += RelayUpdate;
     m.newMPBValue += MPBNew;
     m.UpdateMPBValue += MPBUpdate;
     m.newImageValue += ImageUpdate;
     m.newStateValue += StateUpdate;
 }
示例#2
0
文件: MPBManager.cs 项目: karlnet/mpb
 //public MyMBP GetNewMPB(SocketAsyncEventArgs receiveSendEventArgs,/*Socket tcpClient, */string ip, string MAC, uint MPBID, uint relay, uint temp)
 public MyMBP GetNewMPB(TcpClient tcpClient, string MAC, uint MPBID, uint relay, uint temp)
 {
     MyMBP theMPB = new MyMBP(tcpClient, MAC, MPBID, relay, temp);
     MyForm.MPBAddEvect(theMPB);
     theMPB.OnNewMPB();
     theMPB.ConnectCheck();
     //((DataHoldingUserToken)receiveSendEventArgs.UserToken).IsMPBExit.Set();
     theMPB.GetMPBState();
     return theMPB;
 }
示例#3
0
文件: Form1.cs 项目: karlnet/mpb
 //private void DisConnectSet(object ip)
 //{
 //    string mpbIPADDRESS = (string)ip;
 //    tbMsg.WriteText(mpbIPADDRESS + " 连接断开.");
 //    if (MPBManager.currentMPB.Contains(mpbIPADDRESS))
 //    {
 //        gbMPB2.None(true);
 //        CloseCurrentLocalConnection();
 //    }
 //}
 //// -----------------------------------------------------------------------------
 private void RadioButtonSet(MyMBP m)
 {
     uint index = m.Relay;
     //Rs.ForEach(rb => rb.CheckedChanged -= RadioCheckedChanged);
     for (int i = 0; i < Rs.Count / 2; i++)
     {
         Rs[i * 2].CheckedChanged -= RadioCheckedChanged;
         if ((index & 0x01) == 0x01)
             Rs[i * 2].ON();
         else
             Rs[i * 2 + 1].ON();
         Rs[i * 2].CheckedChanged += RadioCheckedChanged;
         index = index >> 0x01;
     }
     //Rs.ForEach(rb => rb.CheckedChanged += RadioCheckedChanged);
 }
示例#4
0
文件: Form1.cs 项目: karlnet/mpb
        private void DisControls(MyMBP mm ,bool b)
        {
            if (b)
            {
                gbBar1.None(true);
                tbIP.WriteText("0.0.0.0");
                tbMAC.WriteText("00:00:00:00:00:00");
                tbTemp.WriteText("0");

                Bs.ForEach(bt => bt.None(true));
            }
            else
            {
                gbBar1.None(false);
                tbIP.Text = mm.MPBIPAddress;
                tbMAC.Text = mm.MAC;
                tbTemp.Text = String.Format("{0} °C", mm.Temp);
                RadioButtonSet(mm);
                Bs.ForEach(bt => bt.None(false));
            }
        }