| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using SHJX.Service.Control.Common.Assets;
- namespace SHJX.Service.Control.Extends
- {
- public static class ExtendEquipment
- {
- public static void ReleaseArea(this EquipmentTask task)
- {
- List<EquipmentArea> areas = DataManagerInstance.GetEquipmentAreas(task.To, task.From);
- areas.ForEach(area =>
- {
- area.Enable = true;
- DataManagerInstance.Update(area);
- });
- List<PositionHotlist> positions = DataManagerInstance.GetPositionHotlists(task.To, task.From);
- positions.ForEach(position =>
- {
- position.CurrentOccupy = string.Empty;
- position.Enable = true;
- DataManagerInstance.Update(position);
- });
- }
- public static void ReleaseAxis(this EquipmentTask task)
- {
- List<RouteCache> caches = DataManagerInstance.GetCaches(task.Source);
- if (caches.Any())
- {
- if (caches.Count == 1)
- {
- DataManagerInstance.Delete(caches.FirstOrDefault());
- }
- else
- {
- foreach (RouteCache cache in caches)
- {
- if (cache.RouteStep != task.RouteStep)
- {
- DataManagerInstance.Delete(cache);
- }
- }
- }
- }
- DataManagerInstance.DecreaseLock(StateMachineName.MOTOR_LOCK);
- }
- }
- }
|