当前位置: 首页>>代码示例>>C#>>正文


C# TrakHound.EventData类代码示例

本文整理汇总了C#中TrakHound.EventData的典型用法代码示例。如果您正苦于以下问题:C# EventData类的具体用法?C# EventData怎么用?C# EventData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EventData类属于TrakHound命名空间,在下文中一共展示了EventData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSentData

        public void GetSentData(EventData data)
        {
            if (data != null)
            {
                if (data.Id == "MTCONNECT_PROBE")
                {
                    if (data.Data02 != null)
                    {
                        var infos = StatusInfo.GetList((MTConnect.Application.Components.ReturnData)data.Data02);
                        if (infos.Count > 0)
                        {
                            statusInfos = infos;
                        }
                    }
                    else
                    {
                        SendStatusData(null);
                    }
                }
                else if (data.Id == "MTCONNECT_CURRENT" && data.Data02 != null)
                {
                    StatusInfo.ProcessList((MTConnect.Application.Streams.ReturnData)data.Data02, statusInfos);

                    SendStatusData(statusInfos);
                }
            }
        }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:27,代码来源:Plugin.cs

示例2: Row_Clicked

 private void Row_Clicked(Controls.Row row)
 {
     var data = new EventData(this);
     data.Id = "OPEN_DEVICE_DETAILS";
     data.Data01 = row.Device;
     SendData?.Invoke(data);
 }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:7,代码来源:StatusTimes.xaml.cs

示例3: SendGeneratedEvents

 void SendGeneratedEvents(List<GeneratedEvent> events)
 {
     var data = new EventData(this);
     data.Id = "GENERATED_EVENTS";
     data.Data01 = configuration;
     data.Data02 = events.ToList();
     SendData?.Invoke(data);
 }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:8,代码来源:Plugin.cs

示例4: GetSentData

        public void GetSentData(EventData data)
        {
            if (data != null)
            {
                bool found = false;

                if (data.Id == "OVERRIDE_INSTANCES")
                {
                    if (data.Data02.GetType() == typeof(List<OverrideInstance>))
                    {
                        var instances = (List<OverrideInstance>)data.Data02;
                        if (instances != null)
                        {
                            lock (_lock)
                            {
                                overrideInstancesQueue.AddRange(instances);
                            }
                            found = true;
                        }
                    }
                }

                if (data.Id == "GENERATED_EVENTS")
                {
                    if (data.Data02.GetType() == typeof(List<GeneratedEvent>))
                    {
                        var gEvents = (List<GeneratedEvent>)data.Data02;
                        if (gEvents != null)
                        {
                            var oc = Configuration.Get(configuration);
                            if (oc != null)
                            {
                                var operatingEvents = gEvents.FindAll(o => o.EventName == oc.OperatingEventName && o.CurrentValue != null);
                                if (operatingEvents != null)
                                {
                                    lock (_lock)
                                    {
                                        gEventsQueue.AddRange(operatingEvents);
                                    }
                                    found = true;
                                }
                            }
                        }
                    }
                }

                if (found)
                {
                    lock (_lock)
                    {
                        ProcessQueue();
                    }
                }
            }
        }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:55,代码来源:OEE.cs

示例5: GetSentData

        public void GetSentData(EventData data)
        {
            if (data != null)
            {
                switch (data.Id)
                {
                    case "INSTANCE_DATA":

                        var instances = (List<Instance>)data.Data02;

                        List<CycleData> cycles = ProcessCycles(instances);
                        if (cycles != null && cycles.Count > 0)
                        {
                            SendCycleData(cycles);
                        }

                        break;
                }
            }
        }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:20,代码来源:Cycles.cs

示例6: ShowDeviceManagerRequested

 private void ShowDeviceManagerRequested(EventData data)
 {
     if (data != null && data.Id != null)
     {
         if (data.Id == "SHOW_DEVICE_MANAGER")
         {
             DeviceManager_DeviceList_Open();
         }
     }
 }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:10,代码来源:Pages.cs

示例7: ShowEditDeviceRequested

        private void ShowEditDeviceRequested(EventData data)
        {
            if (data != null && data.Id != null)
            {
                if (data.Id == "SHOW_EDIT_DEVICE" && data.Data01 != null && data.Data01.GetType() == typeof(DeviceDescription))
                {
                    var device = (DeviceDescription)data.Data01;

                    DeviceManager_EditDevice_Open(device);
                }
            }
        }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:12,代码来源:Pages.cs

示例8: SendEventData

        private void SendEventData(EventData data)
        {
            LoadDevicesRequested(data);
            ShowDeviceManagerRequested(data);
            ShowEditDeviceRequested(data);
            ShowRequested(data);

            if (deviceListPage != null) deviceListPage.GetSentData(data);

            foreach (var tabHeader in TabHeaders)
            {
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    if (tabHeader.Page != null)
                    {
                        if (tabHeader.Page.PageContent != null && tabHeader.Page.PageContent != data.Sender)
                        {
                            tabHeader.Page.PageContent.GetSentData(data);
                        }
                    }
                }), System.Windows.Threading.DispatcherPriority.Background, new object[] { });
            }
        }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:23,代码来源:Pages.cs

示例9: GetProbeData

 void GetProbeData(EventData data)
 {
     if (data != null && data.Id != null && data.Data02 != null)
     {
         if (data.Id.ToLower() == "mtconnect_probe_dataitems")
         {
             var dataItems = (List<DataItem>)data.Data02;
             probeData = dataItems;
             if (Loaded) LoadCollectedItems(dataItems);
         }
     }
 }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:12,代码来源:Page.xaml.cs

示例10: UpdateLoggedInChanged

 void UpdateLoggedInChanged(EventData data)
 {
     if (data != null)
     {
         if (data.Id == "USER_LOGIN")
         {
             if (data.Data01 != null) currentUser = (UserConfiguration)data.Data01;
         }
         else if (data.Id == "USER_LOGOUT")
         {
             currentUser = null;
         }
     }
 }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:14,代码来源:Page.xaml.cs

示例11: SendCurrentUser

        private void SendCurrentUser(IPage page)
        {
            var data = new EventData(this);

            if (currentUser != null)
            {
                data.Id = "USER_LOGIN";
                data.Data01 = currentUser;
            }
            else
            {
                data.Id = "USER_LOGOUT";
            }

            page.GetSentData(data);
        }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:16,代码来源:Page.xaml.cs

示例12: SendDataInfo

 public SendDataInfo(IClientPlugin plugin, EventData data)
 {
     Plugin = plugin;
     Data = data;
 }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:5,代码来源:Plugins.cs

示例13: GetSentData

        public void GetSentData(EventData data)
        {
            if (data != null && data.Id == "USER_LOGIN")
            {
                if (data.Data01.GetType() == typeof(UserConfiguration))
                {
                    _userConfiguration = (UserConfiguration)data.Data01;
                }
            }

            if (data != null && data.Id == "USER_LOGOUT")
            {
                _userConfiguration = null;
            }

            if (data != null && data.Id == "STATUS_STATUS" && data.Data02 != null && data.Data02.GetType() == typeof(Data.StatusInfo))
            {
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    string uniqueId = data.Data01.ToString();
                    if (Device != null && Device.UniqueId == uniqueId)
                    {
                        var info = (Data.StatusInfo)data.Data02;

                        UpdateDeviceInfo(info);
                    }
                }), System.Windows.Threading.DispatcherPriority.Background, new object[] { });
            }

            if (data != null && data.Id == "STATUS_CONTROLLER" && data.Data02 != null && data.Data02.GetType() == typeof(Data.ControllerInfo))
            {
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    string uniqueId = data.Data01.ToString();
                    if (Device != null && Device.UniqueId == uniqueId)
                    {
                        var info = (Data.ControllerInfo)data.Data02;

                        UpdateDeviceInfo(info);
                    }
                }), System.Windows.Threading.DispatcherPriority.Background, new object[] { });
            }

            if (data != null && data.Id == "STATUS_HOURS" && data.Data02 != null && data.Data02.GetType() == typeof(List<Data.HourInfo>))
            {
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    string uniqueId = data.Data01.ToString();
                    if (Device != null && Device.UniqueId == uniqueId)
                    {
                        var info = (List<Data.HourInfo>)data.Data02;

                        UpdateDeviceInfo(info);
                    }
                }), System.Windows.Threading.DispatcherPriority.Background, new object[] { });
            }

            if (data != null && data.Id == "STATUS_TIMERS" && data.Data02 != null && data.Data02.GetType() == typeof(Data.TimersInfo))
            {
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    string uniqueId = data.Data01.ToString();
                    if (Device != null && Device.UniqueId == uniqueId)
                    {
                        var info = (Data.TimersInfo)data.Data02;

                        UpdateDeviceInfo(info);
                    }
                }), System.Windows.Threading.DispatcherPriority.Background, new object[] { });
            }

            if (data != null && data.Id == "STATUS_OEE" && data.Data02 != null && data.Data02.GetType() == typeof(TrakHound.API.Data.OeeInfo))
            {
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    string uniqueId = data.Data01.ToString();
                    if (Device != null && Device.UniqueId == uniqueId)
                    {
                        var info = (Data.OeeInfo)data.Data02;

                        UpdateDeviceInfo(info);
                    }
                }), System.Windows.Threading.DispatcherPriority.DataBind, new object[] { });
            }
        }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:85,代码来源:Page.xaml.cs

示例14: ShowRequested

        /// <summary>
        /// Page has sent a message requesting to be shown as a tab
        /// de_d.id = 'show'
        /// de_d.data01 = Configuration
        /// de_d.data02 = Page (IPage)
        /// de_d.data03 = [Optional] Alternate Title
        /// de_d.data04 = [Optional] Tag
        /// </summary>
        /// <param name="de_d"></param>
        private void ShowRequested(EventData data)
        {
            if (data != null)
            {
                if (data.Id == "SHOW")
                {
                    if (data.Data02 != null)
                    {
                        if (typeof(IPage).IsAssignableFrom(data.Data02.GetType()))
                        {
                            var page = (IPage)data.Data02;

                            string title = page.Title;

                            ImageSource img = null;
                            if (page.Image != null) img = new BitmapImage(page.Image);

                            string tag = null;

                            if (data.Data03 != null) title = data.Data03.ToString();
                            if (data.Data04 != null) tag = data.Data04.ToString();

                            AddTab(page, title, img, tag);
                        }
                    }
                }
            }
        }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:37,代码来源:Pages.cs

示例15: GetSentData

        public void GetSentData(EventData data)
        {
            Dispatcher.BeginInvoke(new Action<EventData>(UpdateLoggedInChanged), System.Windows.Threading.DispatcherPriority.DataBind, new object[] { data });
            Dispatcher.BeginInvoke(new Action<EventData>(UpdateDevicesLoading), System.Windows.Threading.DispatcherPriority.Normal, new object[] { data });

            Dispatcher.BeginInvoke(new Action<EventData>(UpdateDeviceAdded), System.Windows.Threading.DispatcherPriority.DataBind, new object[] { data });
            Dispatcher.BeginInvoke(new Action<EventData>(UpdateDeviceUpdated), System.Windows.Threading.DispatcherPriority.DataBind, new object[] { data });
            Dispatcher.BeginInvoke(new Action<EventData>(UpdateDeviceRemoved), System.Windows.Threading.DispatcherPriority.DataBind, new object[] { data });
        }
开发者ID:TrakHound,项目名称:TrakHound-Community,代码行数:9,代码来源:LoadFromFile.xaml.cs


注:本文中的TrakHound.EventData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。