예제 #1
0
 private void SetRemotInfo(LockMain <T> .GetStatueList statue, string value)
 {
     if (GetRemotHostInfo != null)
     {
         GetRemotHostInfo(statue, value);
     }
 }
예제 #2
0
        private void lockUdp_GetStringArgs(Udp sender, ReciveString reciveArgs)
        {
            string value = reciveArgs.Value;

            string[] buff = value.Split(new string[] { "~~~" }, StringSplitOptions.None);

            LockMain <T> .GetStatueList statue = (LockMain <T> .GetStatueList)Num.ToInt(buff[0]);
            switch (statue)
            {
            case LockMain <T> .GetStatueList.收到请求:
                nowStatueList = SetStatueList.请求;
                getRemotValue = true;
                break;

            case LockMain <T> .GetStatueList.等待:
                SetRemotInfo(statue, "远程主机已收到请求,请等待分配执行");
                break;

            case LockMain <T> .GetStatueList.允许执行互锁要求:
                SetRemotInfo(statue, "远程主机已允许执行互锁前的开关切换");
                isPlease = false;
                switch (nowStatueList)
                {
                case SetStatueList.请求:
                    if (SwitchOpen != null)
                    {
                        SwitchOpen();
                    }
                    nowStatueList = SetStatueList.执行要求完毕;
                    break;
                }
                break;

            case LockMain <T> .GetStatueList.正在执行互锁动作:

                SetRemotInfo(statue, "远程主机正在执行互锁动作");
                if (buff.Length > 1)
                {
                    if (GetRemotHostTestingValue != null)
                    {
                        GetRemotHostTestingValue(buff[1]);
                    }
                }
                break;

            case LockMain <T> .GetStatueList.互锁动作执行完毕:
                if (isStart)
                {
                    isStart = false;
                    SetRemotInfo(statue, "远程操作完成");
                    if (GetRemotHostTestValue != null)
                    {
                        GetRemotHostTestValue(buff[1]);
                    }
                    if (SwitchClose != null)
                    {
                        SwitchClose();
                    }
                }
                break;

            case LockMain <T> .GetStatueList.互锁请求正常结束:
                SetRemotInfo(statue, "远程主机已收到请求,互锁请求正常结束");
                nowStatueList = SetStatueList.除;
                isStop        = false;
                isPlease      = false;
                isStart       = false;
                break;

            case LockMain <T> .GetStatueList.除请求成功:
                SetRemotInfo(statue, "远程主机已收到请求,互锁请求已删除");
                nowStatueList = SetStatueList.除;
                isDel         = false;
                isPlease      = false;
                isStart       = false;
                isStop        = false;
                break;
            }
        }