예제 #1
0
        public void NajdiIpAdresuRobota()
        {
            string  hostname = "AGV_Luky";
            DnsInfo info     = GetHostNameAndIPAdress.DnsInfoFromHostname(hostname);

            Assert.IsTrue(info.IP.ToString() == "10.226.178.252");
        }
예제 #2
0
        public override async Task <AbstractRobot[]> PripojeniRoboti()
        {
            if (EnterpriseManagerClient == null)
            {
                Connect();
            }
            var identifikatoryRobotuPripojenychNaServer = EnterpriseManagerClient.RefreshConnectedRobots();
            await Task.Delay(10);

            LynxModel[] vysledek  = new LynxModel[identifikatoryRobotuPripojenychNaServer.Where(x => x != null).Count()];
            int         indexPole = 0;

            foreach (string identifikator in identifikatoryRobotuPripojenychNaServer)
            {
                DnsInfo   robotDnsInfo   = GetHostNameAndIPAdress.DnsInfoFromHostname($"AGV_{identifikator}");
                LynxModel pripojenyRobot = new LynxModel
                {
                    Hostname = identifikator,
                    IpAdress = robotDnsInfo.IP.ToString()
                };
                vysledek[indexPole] = pripojenyRobot;
                indexPole++;
            }
            return(vysledek);
        }