for my current project i need to determine the time and dependend on this time choose the right shift.
After the right shift and time is chosen, it should calculate remaining time until shift end and pause within given timeperiods.
Is this to much to pack into livecode?
Thats my current handler to set the shift time..
Code: Select all
command calcSchicht
local vTarget, vItems
set the itemdel to tab
put the cSchicht of this stack into vTarget
put "Administration"&tab&"QCD Anzeigetafel" into vItems
if the cSchicht of this stack is "S1" then
repeat for each item i in vItems
set the colorOverlay["opacity"] of fld vTarget of card i to "255"
set the colorOverlay["color"] of fld vTarget of card i to "blue"
set the colorOverlay["blendMode"] of fld vTarget of card i to "multiply"
set the colorOverlay["opacity"] of fld "S2" of card i to "0"
set the colorOverlay["opacity"] of fld "S3" of card i to "0"
end repeat
set the colorOverlay["opacity"] of fld "AS1" of card 1 to "255"
set the colorOverlay["color"] of fld "AS1" of card 1 to "blue"
set the colorOverlay["blendMode"] of fld "AS1" of card 1 to "multiply"
set the colorOverlay["opacity"] of fld "AS2" of card 1 to "0"
set the colorOverlay["opacity"] of fld "AS3" of card 1 to "0"
if the cWoche of this stack is "W40" then
set the cArbeitszeit of this stack to "480"
#put item 2 of line 1 of fld "40w" of card "Administration" of this stack into vStart
#put item 3 of line 1 of fld "40w" of card "Administration" of this stack into vEnd
else
set the cArbeitszeit of this stack to "450"
#put item 2 of line 1 of fld "375w" of card "Administration" of this stack into vStart
#put item 3 of line 1 of fld "375w" of card "Administration" of this stack into vEnd
end if
else if the cSchicht of this stack is "S2" then
repeat for each item i in vItems
set the colorOverlay["opacity"] of fld vTarget of card i to "255"
set the colorOverlay["color"] of fld vTarget of card i to "blue"
set the colorOverlay["blendMode"] of fld vTarget of card i to "multiply"
set the colorOverlay["opacity"] of fld "S1" of card i to "0"
set the colorOverlay["opacity"] of fld "S3" of card i to "0"
end repeat
set the colorOverlay["opacity"] of fld "AS2" of card 1 to "255"
set the colorOverlay["color"] of fld "AS2" of card 1 to "blue"
set the colorOverlay["blendMode"] of fld "AS2" of card 1 to "multiply"
set the colorOverlay["opacity"] of fld "AS1" of card 1 to "0"
set the colorOverlay["opacity"] of fld "AS3" of card 1 to "0"
if the cWoche of this stack is "W40" then
set the cArbeitszeit of this stack to "480"
#put item 2 of line 2 of fld "40w" of card "Administration" of this stack into vStart
#put item 3 of line 2 of fld "40w" of card "Administration" of this stack into vEnd
else
set the cArbeitszeit of this stack to "450"
#put item 2 of line 2 of fld "375w" of card "Administration" of this stack into vStart
#put item 3 of line 2 of fld "375w" of card "Administration" of this stack into vEnd
end if
else if the cSchicht of this stack is "S3" then
repeat for each item i in vItems
set the colorOverlay["opacity"] of fld vTarget of card i to "255"
set the colorOverlay["color"] of fld vTarget of card i to "blue"
set the colorOverlay["blendMode"] of fld vTarget of card i to "multiply"
set the colorOverlay["opacity"] of fld "S1" of card i to "0"
set the colorOverlay["opacity"] of fld "S2" of card i to "0"
end repeat
set the colorOverlay["opacity"] of fld "AS3" of card 1 to "255"
set the colorOverlay["color"] of fld "AS3" of card 1 to "blue"
set the colorOverlay["blendMode"] of fld "AS3" of card 1 to "multiply"
set the colorOverlay["opacity"] of fld "AS2" of card 1 to "0"
set the colorOverlay["opacity"] of fld "AS1" of card 1 to "0"
if the cWoche of this stack is "W40" then
set the cArbeitszeit of this stack to "480"
#put item 2 of line 3 of fld "40w" of card "Administration" of this stack into vStart
#put item 3 of line 3 of fld "40w" of card "Administration" of this stack into vEnd
else
set the cArbeitszeit of this stack to "450"
#put item 2 of line 3 of fld "375w" of card "Administration" of this stack into vStart
#put item 3 of line 3 of fld "375w" of card "Administration" of this stack into vEnd
end if
end if
#replace ":" with "" in vStart
#replace ":" with "" in vEnd
#put vEnd-vStart into vArbeitszeit
#put (vArbeitszeit *60)/100 into vArbeitszeit
#set the cArbeitszeit of this stack to vArbeitszeit
updateFields
end calcSchicht