Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
feb40121
Commit
feb40121
authored
Aug 15, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Operator to be able to lock and not undertake jobs when near the end of shift
parent
8b67f2bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
dream/simulation/ObjectResource.py
dream/simulation/ObjectResource.py
+3
-1
No files found.
dream/simulation/ObjectResource.py
View file @
feb40121
...
...
@@ -56,13 +56,15 @@ class ObjectResource(ManPyObject):
self
.
coreObjectIds
=
[]
# list with the coreObjects that the resource services
self
.
coreObjects
=
[]
# flag that locks the resource so that it cannot get new jobs
self
.
isLocked
=
False
# =======================================================================
# checks if the worker is available
# =======================================================================
def
checkIfResourceIsAvailable
(
self
,
callerObject
=
None
):
# return true if the operator is idle and on shift
return
len
(
self
.
Res
.
users
)
<
self
.
capacity
and
self
.
onShift
return
len
(
self
.
Res
.
users
)
<
self
.
capacity
and
self
.
onShift
and
(
not
self
.
isLocked
)
# =======================================================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment