void RegisterEmployee(EmployeeComponent employee)
        {
            this.Log($"Assignment registering {employee}");

            if (!Assignments.ContainsKey(employee))
            {
                Assignments.Add(employee, null);
            }
        }
        private void OnTimedEvent(object sender, ElapsedEventArgs e)
        {
            if (timerCodeRunning)
            {
                return;
            }

            timerCodeRunning = true;
            try
            {
                foreach (var plugin in addedInputPlugins)
                {
                    List <SensorReadingPackage> readings = plugin.Plugin.GetReadings();
                    allReadings[plugin.InstanceId] = readings;
                }

                if (Assignments.ContainsKey(selectedJoint))
                {
                    Assignment ass = Assignments[selectedJoint];


                    if (allReadings.ContainsKey(ass.PluginInstance))
                    {
                        List <SensorReadingPackage> reading = allReadings[ass.PluginInstance];

                        SensorReadingPackage sens = reading.FirstOrDefault(y => y.Id == ass.SensorId);
                        if (sens != null)
                        {
                            //TODO - check for positional
                            {
                                CurrentSensorX = sens.Position.X;
                                CurrentSensorY = sens.Position.Y;
                                CurrentSensorZ = sens.Position.Z;

//                                Debug.WriteLine($"{CurrentSensorX},{CurrentSensorY},{CurrentSensorZ}");
                            }
                        }
                    }
                }
            }
            catch
            {
            }
            timerCodeRunning = false;
        }
Example #3
0
        public bool UserInGroup(string user, string group)
        {
            if (!Assignments.ContainsKey(group))
            {
                return(false);
            }

            List <string> users = Assignments[group];

            foreach (string u in Users)
            {
                if (u.ToLowerInvariant().Equals(user.ToLowerInvariant()))
                {
                    return(true);
                }
            }
            return(false);
        }
 public bool IsAssigned(EmployeeComponent employee) =>
 Assignments.ContainsKey(employee) && Assignments[employee];