Exemplo n.º 1
0
        private void Count1()
        {
            mClount++;
            NotificationContainer MyNotificationContainer = new NotificationContainer();

            CountNotification MyCountNotification = new CountNotification();

            MyCountNotification.serverTask_ID   = ServerTaskID;
            MyCountNotification.customer_ID     = CounterID;// "C11200987654321";
            MyCountNotification.notification_ID = mClount;
            MyCountNotification.count_in        = 1;
            MyCountNotification.count_out       = 1;
            MyCountNotification.timestamp       = DateTime.Now;
            CountingGateID MyCountingGateID = new CountingGateID();

            MyCountingGateID.id = "10";
            MyCountNotification.counting_gate_id = MyCountingGateID;

            MyNotificationContainer.Item = MyCountNotification;
            AnswerContainer MyAnswerContainer;

            LGJCloudAPIHelper MyLGJCloudAPIHelper = new LGJCloudAPIHelper();

            MyAnswerContainer = MyLGJCloudAPIHelper.Notification(MyNotificationContainer);


            if (MyAnswerContainer != null)
            {
                OutMessage(MyAnswerContainer.server_response_type.ToString(), 4);
            }

            OutPutXMLInfor(MyAnswerContainer.Items);
        }
Exemplo n.º 2
0
 public void AddNotificationQueue(NotificationContainer noti)
 {
     lock (NotificationQueue)
     {
         NotificationQueue.Add(noti);
     }
 }
Exemplo n.º 3
0
        private void Alive1()
        {
            NotificationContainer MyNotificationContainer = new NotificationContainer();

            AliveNotification MyAliveNotification = new AliveNotification();

            MyAliveNotification.serverTask_ID   = 0;
            MyAliveNotification.customer_ID     = CounterID;// "C11200987654321";
            MyAliveNotification.ip_address      = "168.223.110.101";
            MyAliveNotification.notification_ID = mClount;
            MyAliveNotification.mac_address     = "AB-09-23-ED-F0-88";
            MyAliveNotification.timestamp       = DateTime.Now;

            MyNotificationContainer.Item = MyAliveNotification;
            AnswerContainer MyAnswerContainer;


            LGJCloudAPIHelper MyLGJCloudAPIHelper = new LGJCloudAPIHelper();

            MyAnswerContainer = MyLGJCloudAPIHelper.Notification(MyNotificationContainer);

            if (MyAnswerContainer != null)
            {
                if (MyAnswerContainer.Items[1] != null)
                {
                    ServerTaskID = MyAnswerContainer.Items[1].serverTask_ID;
                }
                OutMessage(MyAnswerContainer.server_response_type.ToString(), 4);
            }



            OutPutXMLInfor(MyAnswerContainer.Items);
        }
Exemplo n.º 4
0
        private void Startup1()
        {
            mClount++;
            NotificationContainer MyNotificationContainer = new NotificationContainer();

            StartupNotification MyStartupNotification = new StartupNotification();

            MyStartupNotification.serverTask_ID   = 0;
            MyStartupNotification.customer_ID     = CounterID;// "C11200987654321";
            MyStartupNotification.ip_address      = "168.223.110.101";
            MyStartupNotification.notification_ID = mClount;
            MyStartupNotification.mac_address     = "AB-09-23-ED-F0-88";

            MyStartupNotification.timestamp = DateTime.Now;
            MyNotificationContainer.Item    = MyStartupNotification;
            AnswerContainer MyAnswerContainer;

            LGJCloudAPIHelper MyLGJCloudAPIHelper = new LGJCloudAPIHelper();

            MyAnswerContainer = MyLGJCloudAPIHelper.Notification(MyNotificationContainer);

            if (MyAnswerContainer.Items != null)
            {
                ServerTaskID = MyAnswerContainer.Items[0].serverTask_ID;
            }


            OutPutXMLInfor(MyAnswerContainer.Items);

            OutMessage(null, 2);
        }
Exemplo n.º 5
0
        private void NotificationReceived(NotificationContainer container)
        {
            if (container == null)
            {
                throw new ArgumentNullException(nameof(container));
            }

            if (container.Notifications == null)
            {
                throw new ArgumentNullException(nameof(container.Notifications));
            }

            foreach (var notification in container.Notifications)
            {
                if (notification.Type == NotificationType.AddUser)
                {
                    var action = (AddUserActionNotification)notification.Action;
                    UserRepository.Set(action.User);
                }
                else if (notification.Type == NotificationType.DeleteUser)
                {
                    var action = (DeleteUserActionNotification)notification.Action;
                    UserRepository.Delete((u) => u.Id == action.UserId);
                }
            }
        }
Exemplo n.º 6
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.transform.tag == "Player" && !is_created)
     {
         NotificationContainer.show_container(t);
         is_created = true;
     }
 }
Exemplo n.º 7
0
 public PersonAppService(IUnitOfWork unitOfWork,
                         IPersonService service,
                         NotificationContainer notificationContainer)
 {
     _unitOfWork            = unitOfWork;
     _service               = service;
     _notificationContainer = notificationContainer;
 }
Exemplo n.º 8
0
        private void AddNotificationToList(NotificationContainer notification, ErrorContainer error, Task[] tList)
        {
            ServerNotificationListItemType listItem = new ServerNotificationListItemType();

            listItem.notificationListItem = notification;
            listItem.errorListItem        = error;
            listItem.serverTime           = GetTimestamp();
            listItem.taskList             = tList;
            serverNotificationList.Add(listItem);
            removedNotifications += CleanUpNotificationList();

            CreateOrUpdateCounterListItem(notification, error);
        }
 public bool tryGetNotificationView(NotificationId id, out NotificationView view)
 {
     view = null;
     NotificationView[] viewList = NotificationContainer.GetComponentsInChildren <NotificationView>();
     for (int i = 0; i < viewList.Length; i++)
     {
         if (viewList[i].Id == id)
         {
             view = viewList[i];
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 10
0
        private void AddRetentionTimePredictor(LibraryManager.BuildState buildState)
        {
            var predictorName = Helpers.GetUniqueName(buildState.LibrarySpec.Name, Settings.Default.RetentionTimeList.Select(rt => rt.Name).ToArray());

            using (var addPredictorDlg = new AddRetentionTimePredictorDlg(predictorName, buildState.LibrarySpec.FilePath, false))
            {
                if (addPredictorDlg.ShowDialog(TopMostApplicationForm) == DialogResult.OK)
                {
                    Settings.Default.RTScoreCalculatorList.Add(addPredictorDlg.Calculator);
                    Settings.Default.RetentionTimeList.Add(addPredictorDlg.Regression);
                    NotificationContainer.ModifyDocument(Resources.LibraryBuildNotificationHandler_AddRetentionTimePredictor_Add_retention_time_predictor,
                                                         doc => doc.ChangeSettings(doc.Settings.ChangePeptidePrediction(predict =>
                                                                                                                        predict.ChangeRetentionTime(addPredictorDlg.Regression))));
                }
            }
        }
Exemplo n.º 11
0
        public void CustomActivity()
        {
            if (Visible)
            {
                for (int i = NotificationContainer.Children.Count() - 1; i > -1; i--)
                {
                    var notification = NotificationContainer.Children.ElementAt(i);
                    if (TimeManager.CurrentScreenSecondsSince(notification.TimeCreated) >
                        NotificationDisplayTimeInSeconds)
                    {
                        NotificationContainer.RemoveChild(notification);

                        UpdateVisibility();
                    }
                }
            }
        }
Exemplo n.º 12
0
        private void Preprocessing(NotificationContainer notification, Task[] Mytasks)
        {
            LGJSynchTcpClient MyLGJSynchTcpClient = new LGJSynchTcpClient(null, null, null, "8000");
            //Type MyType = notification.Item.GetType();
            //MyLGJSynchTcpClient.SendMessage("xxxx#"+MyType..FullName+"  Tasks:"+ Mytasks.Length.ToString());
            string MessageTypeStr = notification.Item.ToString();

            MessageTypeStr = MessageTypeStr.Substring(MessageTypeStr.IndexOf(".") + 1);
            MyLGJSynchTcpClient.SendMessage("Types#" + MessageTypeStr + "  Tasks:" + Mytasks.Length.ToString());

            string NotificationStr = null;

            if (notification.Item is CountNotification)
            {
                CountNotification MyCountNotifi = notification.Item as CountNotification;
                NotificationStr = "count#" + MyCountNotifi.customer_ID + ",IN:" + MyCountNotifi.count_in.ToString() + ";OUT:" + MyCountNotifi.count_out.ToString() + ",TaskID:" + MyCountNotifi.serverTask_ID.ToString() + ",GateID:" + MyCountNotifi.counting_gate_id.id;

                HellaAPCECOMannager MyHellaAPCECOManager = new HellaAPCECOMannager();
                CountingHelper      MyCountingHelper     = new CountingHelper(MyCountNotifi.customer_ID, MyCountNotifi.serverTask_ID, (int)MyCountNotifi.count_in, (int)MyCountNotifi.count_out);
                //CountingMannager MyCountingMannager = new CountingMannager("ABC987654321", 1000, 1, 1);
                CountingHelper.DoUpdateWork(MyHellaAPCECOManager, MyCountingHelper);
            }

            if (notification.Item is StartupNotification)
            {
                StartupNotification MyStartNotifi = notification.Item as StartupNotification;
                NotificationStr = "start#" + MyStartNotifi.customer_ID + ",TaskID:" + MyStartNotifi.serverTask_ID.ToString() + "," + MyStartNotifi.ip_address + "," + MyStartNotifi.mac_address;
            }

            if (notification.Item is AliveNotification)
            {
                AliveNotification MyAliveNotifi = notification.Item as AliveNotification;
                NotificationStr = "keepalive#" + MyAliveNotifi.customer_ID + ",TaskID:" + MyAliveNotifi.serverTask_ID.ToString() + "," + MyAliveNotifi.ip_address + "," + MyAliveNotifi.mac_address;
            }

            if (NotificationStr != null)
            {
                MyLGJSynchTcpClient.SendMessage(NotificationStr);

                //SoapMessageLogExtension MySoapMessageLogExtension = new SoapMessageLogExtension();
                //MySoapMessageLogExtension.LGJLogTextMessage(NotificationStr, notification.Item.GetType());
            }
        }
Exemplo n.º 13
0
        public AnswerContainer Notification(NotificationContainer notification_message)
        {
            //lock (notificationListLock)
            //{
            //lock (taskListLock)
            //{
            //Task[] tasks = CreateCounterTaskList2(notification_message.Item);
            //AddNotificationToList(notification_message, null, tasks);

            //Preprocessing(notification_message, tasks);//Test-LGJ

            Task[] tasks = PreprocessingEx(notification_message);

            AnswerContainer MyAnswer = new AnswerContainer();

            MyAnswer.Items = tasks;
            MyAnswer.referenced_notification_ID = notification_message.Item.notification_ID;
            MyAnswer.server_response_type       = SOAP_ServerError.SOAP_SERVER_OK;

            return(MyAnswer);
            //  }
            // }
        }
 private void Awake()
 {
     container_obj = this;
 }
 public NotificationView[] GetNotificationViewList()
 {
     return(NotificationContainer.GetComponentsInChildren <NotificationView>());
 }
Exemplo n.º 16
0
 public NotificationTaskManager(NotificationContainer UserData)
     : base(UserData)
 {
     this.notifier = new GCMNotifier();
 }
Exemplo n.º 17
0
 public PersonService(IPersonRepository repository, NotificationContainer notificationContainer)
 {
     _repository            = repository;
     _notificationContainer = notificationContainer;
 }
Exemplo n.º 18
0
 public NotificationTaskQueue(NotificationContainer Data)
 {
     UserData = Data;
 }
Exemplo n.º 19
0
 public PersonController(IPersonAppService appService, NotificationContainer notificationContainer)
 {
     _appService            = appService;
     _notificationContainer = notificationContainer;
 }
Exemplo n.º 20
0
        private Task[] PreprocessingEx(NotificationContainer notification)
        {
            LGJSynchTcpClient MyLGJSynchTcpClient = new LGJSynchTcpClient(null, null, null, "8000");
            string            MessageTypeStr      = notification.Item.ToString();

            MessageTypeStr = MessageTypeStr.Substring(MessageTypeStr.IndexOf(".") + 1);
            MyLGJSynchTcpClient.SendMessage("APC-Types#" + MessageTypeStr);

            string NotificationStr = null;

            uint GetTaskID = 0;
            uint OldTaskID = 0;

            if (notification.Item is CountNotification)
            {
                CountNotification MyCountNotifi = notification.Item as CountNotification;
                NotificationStr = "APC-count#" + MyCountNotifi.customer_ID + ",IN:" + MyCountNotifi.count_in.ToString() + ";OUT:" + MyCountNotifi.count_out.ToString() + ",TaskID:" + MyCountNotifi.serverTask_ID.ToString() + ",GateID:" + MyCountNotifi.counting_gate_id.id;
                MyLGJSynchTcpClient.SendMessage(NotificationStr);

                OldTaskID = MyCountNotifi.serverTask_ID;
                HellaAPCECOMannager MyHellaAPCECOManager = new HellaAPCECOMannager();
                CountingHelper      MyCountingHelper     = new CountingHelper(MyCountNotifi.customer_ID, MyCountNotifi.serverTask_ID, (int)MyCountNotifi.count_in, (int)MyCountNotifi.count_out);
                GetTaskID = (uint)CountingHelper.DoUpdateWork(MyHellaAPCECOManager, MyCountingHelper);

                if (GetTaskID > 0)
                {
                    return(CreateCounterTaskList4(OldTaskID, GetTaskID));
                }
                else
                {
                    return(null);
                }
            }

            if (notification.Item is StartupNotification)
            {
                StartupNotification MyStartNotifi = notification.Item as StartupNotification;
                NotificationStr = "APC-start#" + MyStartNotifi.customer_ID + ",TaskID:" + MyStartNotifi.serverTask_ID.ToString() + "," + MyStartNotifi.ip_address + "," + MyStartNotifi.mac_address;
                MyLGJSynchTcpClient.SendMessage(NotificationStr);

                HellaAPCECOMannager MyHellaAPCECOManager = new HellaAPCECOMannager();
                HellaApcHelper      MyHellaApcHelper     = new HellaApcHelper(MyStartNotifi.customer_ID, "startup");
                GetTaskID = HellaApcHelper.DoUpdateWork(MyHellaAPCECOManager, MyHellaApcHelper);
                if (GetTaskID > 0)
                {
                    return(CreateCounterTaskList3(GetTaskID));
                }
                else
                {
                    return(null);
                }
            }

            if (notification.Item is AliveNotification)
            {
                AliveNotification MyAliveNotifi = notification.Item as AliveNotification;
                NotificationStr = "APC-keepalive#" + MyAliveNotifi.customer_ID + ",TaskID:" + MyAliveNotifi.serverTask_ID.ToString() + "," + MyAliveNotifi.ip_address + "," + MyAliveNotifi.mac_address;
                MyLGJSynchTcpClient.SendMessage(NotificationStr);


                OldTaskID = MyAliveNotifi.serverTask_ID;
                HellaAPCECOMannager MyHellaAPCECOManager = new HellaAPCECOMannager();
                HellaApcHelper      MyHellaApcHelper     = new HellaApcHelper(MyAliveNotifi.customer_ID, "keepalive");
                GetTaskID = HellaApcHelper.DoUpdateWork(MyHellaAPCECOManager, MyHellaApcHelper);

                if (GetTaskID > 0)
                {
                    return(CreateCounterTaskList4(OldTaskID, GetTaskID));
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }


            /*
             * if (NotificationStr != null)
             * {
             *  MyLGJSynchTcpClient.SendMessage(NotificationStr);
             *
             *  //SoapMessageLogExtension MySoapMessageLogExtension = new SoapMessageLogExtension();
             *  //MySoapMessageLogExtension.LGJLogTextMessage(NotificationStr, notification.Item.GetType());
             *
             * }
             */
            //------最后返回数据库-------------------------------------------------------------

            /*
             * if (GetTaskID > 0)
             *  return CreateCounterTaskList3(GetTaskID);
             * else
             *  return null;
             */
        }
Exemplo n.º 21
0
        private void CreateOrUpdateCounterListItem(NotificationContainer notification, ErrorContainer error)
        {
            CounterListItemType counterListItem = null;
            DateTime            now             = DateTime.Now;
            string                   mac_address;
            NotificationBase         notificationBase    = null;
            ExtendedNotificationBase extNotificationBase = null;

            if (notification != null)
            {
                mac_address      = notification.Item.mac_address;
                notificationBase = notification.Item as NotificationBase;
                if (notification.Item is ExtendedNotificationBase)
                {
                    extNotificationBase = notification.Item as ExtendedNotificationBase;
                }
            }
            else if (error != null)
            {
                mac_address         = error.mac_address;
                notificationBase    = error as NotificationBase;
                extNotificationBase = error as ExtendedNotificationBase;
            }
            else
            {
                return;
            }

            counterListItem = GetCounterListItemByMacAddress(mac_address);
            if (counterListItem == null)
            {
                counterListItem = new CounterListItemType();
                counterList.Add(counterListItem);
                counterListItem.mac_address          = mac_address;
                counterListItem.registered_timestamp = now;
                counterListItem.updated_timestamp    = now;
                counterListItem.notifications_count  = 0;
                counterListItem.errors_count         = 0;
            }

            if (extNotificationBase != null)
            {
                if (!string.Equals(extNotificationBase.ip_address, counterListItem.ip_address))
                {
                    counterListItem.ip_address        = extNotificationBase.ip_address;
                    counterListItem.updated_timestamp = now;
                }
            }

            if (notificationBase != null)
            {
                if (!string.Equals(notificationBase.customer_ID, counterListItem.customer_ID))
                {
                    counterListItem.customer_ID       = notificationBase.customer_ID;
                    counterListItem.updated_timestamp = now;
                }
            }

            if (notification != null)
            {
                counterListItem.last_notification_ID        = notification.Item.notification_ID;
                counterListItem.last_notification_timestamp = notification.Item.timestamp;
                counterListItem.last_notification_type      = notification.Item.task_type;
                counterListItem.notifications_count++;
            }
            else if (error != null)
            {
                counterListItem.last_error_ID        = error.notification_ID;
                counterListItem.last_error_timestamp = error.timestamp;
                counterListItem.last_error_reason    = error.error_reason;
                counterListItem.errors_count++;
            }

            counterListItem.changed = true;
        }