コード例 #1
0
        private void SendFeedingSignal()
        {
            var empty_in     = false;
            var ret_empty_in = StationDevice.GetEmptyInFeedingSignal(ref empty_in);

            if (ret_empty_in == true)
            {
                var dd = signalrService.Send(AgvSendActionEnum.SendFeedingSignalMessage.EnumToString(),
                                             new AgvFeedingSignal
                {
                    Id       = Station_Id + "_EMPTYIN",
                    ClientId = Station_Id,
                    Type     = AgvMissionTypeEnum.EMPTY_IN,
                    Value    = empty_in,
                }).Result;
            }

            var raw_in     = false;
            var ret_raw_in = StationDevice.GetRawInFeedingSignal(ref raw_in);

            if (ret_raw_in == true)
            {
                var ff = signalrService.Send(AgvSendActionEnum.SendFeedingSignalMessage.EnumToString(),
                                             new AgvFeedingSignal
                {
                    Id       = Station_Id + "_RAWIN",
                    ClientId = Station_Id,
                    Type     = AgvMissionTypeEnum.RAW_IN,
                    Value    = raw_in,
                }).Result;
            }
        }
コード例 #2
0
        public async static void MainTest()
        {
            signalrService = new SignalrService("http://localhost/Agv", "AgvMissonHub");
            signalrService.OnMessage <AgvOutMisson>(AgvReceiveActionEnum.receiveOutMissionMessage.EnumToString()
                                                    , (s) =>
            {
                Console.WriteLine("[receive]:" + s.Id);
            });

            await signalrService.Start();

            while (true)
            {
                string data = Console.ReadLine();
                Console.WriteLine("[send]:" + data);
                await signalrService.Send <AgvOutMisson>(AgvSendActionEnum.SendOutMission.EnumToString(),
                                                         new AgvOutMisson()
                {
                    Id = data
                });
            }
        }