public DeviceInfo(string address, int port, MTConnectDevices.Device device)
 {
     Id      = TrakHound.Tools.String_Functions.RandomString(20);
     Address = address;
     Port    = port;
     Device  = device;
 }
Example #2
0
        public static void Process(DataTable table, MTConnectDevices.Device device)
        {
            if (device != null && device.Description != null && !string.IsNullOrEmpty(device.Description.Manufacturer))
            {
                if (device.Description.Manufacturer.ToLower() == "okuma")
                {
                    SetDescription(table);

                    var items = device.GetDataItems();

                    AddTimers(table, items);
                }
            }
        }
Example #3
0
        public static void Add(DataTable table, MTConnectDevices.Device device)
        {
            if (device.Description != null)
            {
                DeviceConfiguration.EditTable(table, "/Description/Manufacturer", Trim(device.Description.Manufacturer), null);
                DeviceConfiguration.EditTable(table, "/Description/Model", Trim(device.Description.Model), null);
                DeviceConfiguration.EditTable(table, "/Description/Serial", Trim(device.Description.SerialNumber), null);
                DeviceConfiguration.EditTable(table, "/Description/Description", Trim(device.Description.CDATA), null);

                if (!string.IsNullOrEmpty(device.Description.Manufacturer))
                {
                    string logoUrl = new Uri("https://images.trakhound.com/device-image?manufacturer=" + device.Description.Manufacturer).ToString();
                    DeviceConfiguration.EditTable(table, "/Description/LogoUrl", logoUrl, null);

                    if (!string.IsNullOrEmpty(device.Description.Model))
                    {
                        string imageUrl = new Uri("https://images.trakhound.com/device-image?manufacturer=" + device.Description.Manufacturer + "&model=" + device.Description.Model).ToString();
                        DeviceConfiguration.EditTable(table, "/Description/ImageUrl", imageUrl, null);
                    }
                }
            }
        }
Example #4
0
        private static DeviceDefinition Create(string deviceId, long agentInstanceId, MTConnectDevices.Device device)
        {
            var obj = new DeviceDefinition();

            obj.DeviceId = deviceId;

            // MTConnect Properties
            obj.AgentInstanceId = agentInstanceId;
            obj.Id             = device.Id;
            obj.Uuid           = device.Uuid;
            obj.Name           = device.Name;
            obj.NativeName     = device.NativeName;
            obj.SampleInterval = device.SampleInterval;
            obj.SampleRate     = device.SampleRate;
            obj.Iso841Class    = device.Iso841Class;
            if (device.Description != null)
            {
                // Check if pointing to the MTConnect Demo at http://agent.mtconnect.org
                if (device.Description.Manufacturer == "SystemInsights")
                {
                    obj.Description = "MTConnect Demo";
                }
                else
                {
                    obj.Manufacturer = device.Description.Manufacturer;
                    obj.Description  = device.Description.CDATA;
                }

                obj.Model        = device.Description.Model;
                obj.SerialNumber = device.Description.SerialNumber;
                obj.Station      = device.Description.Station;
            }

            return(obj);
        }
        private static DeviceDefinitionData Create(string deviceId, long agentInstanceId, MTConnectDevices.Device device)
        {
            var obj = new DeviceDefinitionData();

            obj.DeviceId = deviceId;

            // MTConnect Properties
            obj.AgentInstanceId = agentInstanceId;
            obj.Id             = device.Id;
            obj.Uuid           = device.Uuid;
            obj.Name           = device.Name;
            obj.NativeName     = device.NativeName;
            obj.SampleInterval = device.SampleInterval;
            obj.SampleRate     = device.SampleRate;
            obj.Iso841Class    = device.Iso841Class;
            if (device.Description != null)
            {
                obj.Manufacturer = device.Description.Manufacturer;
                obj.Model        = device.Description.Model;
                obj.SerialNumber = device.Description.SerialNumber;
                obj.Station      = device.Description.Station;
                obj.Description  = device.Description.CDATA;
            }

            return(obj);
        }