diff --git a/opticsApp/Db/flexCombinedMotion.db b/opticsApp/Db/flexCombinedMotion.db index fc08f48..c3a19f4 100644 --- a/opticsApp/Db/flexCombinedMotion.db +++ b/opticsApp/Db/flexCombinedMotion.db @@ -65,6 +65,12 @@ record(longout, "$(P)$(M):retries") field(VAL, "0") } +record(longout, "$(P)$(M):maxRetries") +{ + field(DESC, "Coarse motor max retries") + field(VAL, "10") +} + record(ao, "$(P)$(M):setPoint") { field(DESC, "Combined-motion target") diff --git a/opticsApp/Db/flexCombinedMotion_settings.req b/opticsApp/Db/flexCombinedMotion_settings.req index 9f318f8..21740fc 100644 --- a/opticsApp/Db/flexCombinedMotion_settings.req +++ b/opticsApp/Db/flexCombinedMotion_settings.req @@ -7,6 +7,7 @@ $(P)$(M):setPoint.DESC $(P)$(M):setPoint.PREC $(P)$(M):deadband.VAL $(P)$(M):deadband.PREC +$(P)$(M):maxRetries.VAL $(P)$(M):upperLimit.VAL $(P)$(M):upperLimit.PREC $(P)$(M):homePos.VAL diff --git a/opticsApp/op/adl/flexCombinedMotion.adl b/opticsApp/op/adl/flexCombinedMotion.adl index 19e7127..96ea66e 100644 --- a/opticsApp/op/adl/flexCombinedMotion.adl +++ b/opticsApp/op/adl/flexCombinedMotion.adl @@ -1,14 +1,14 @@ file { - name="/home/beams3/KPETERSN/development/github-forks/optics/opticsApp/op/adl/flexCombinedMotion.adl" + name="/net/s9dserv/xorApps/epics/synApps_6_3/support/optics-git/opticsApp/op/adl/flexCombinedMotion.adl" version=030111 } display { object { - x=616 - y=127 + x=606 + y=119 width=210 - height=302 + height=325 } clr=14 bclr=4 @@ -295,10 +295,39 @@ composite { } } } +text { + object { + x=13 + y=198 + width=75 + height=18 + } + "basic attribute" { + clr=14 + fill="outline" + } + textix="Busy" +} +"text update" { + object { + x=93 + y=198 + width=100 + height=18 + } + monitor { + chan="$(P)$(M):busy" + clr=54 + bclr=3 + } + format="string" + limits { + } +} composite { object { x=13 - y=267 + y=221 width=180 height=18 } @@ -307,7 +336,7 @@ composite { text { object { x=13 - y=267 + y=221 width=75 height=18 } @@ -315,27 +344,61 @@ composite { clr=14 fill="outline" } - textix="Mode" + textix="Retries" } - menu { + "text update" { object { x=93 - y=267 + y=221 width=100 height=18 } - control { - chan="$(P)$(M):mode" - clr=14 + monitor { + chan="$(P)$(M):retries" + clr=54 bclr=3 } + format="string" + limits { + } } } } +"text update" { + object { + x=93 + y=152 + width=100 + height=18 + } + monitor { + chan="$(P)$(M):rehome" + clr=54 + bclr=3 + } + format="string" + limits { + } +} +"message button" { + object { + x=13 + y=152 + width=75 + height=18 + } + control { + chan="$(P)$(M):rehome" + clr=54 + bclr=3 + } + label="Rehome" + press_msg="1" +} composite { object { x=13 - y=244 + y=267 width=176 height=18 } @@ -344,7 +407,7 @@ composite { text { object { x=13 - y=244 + y=267 width=75 height=18 } @@ -357,7 +420,7 @@ composite { "text entry" { object { x=93 - y=244 + y=267 width=96 height=18 } @@ -371,39 +434,10 @@ composite { } } } -text { - object { - x=13 - y=198 - width=75 - height=18 - } - "basic attribute" { - clr=14 - fill="outline" - } - textix="Busy" -} -"text update" { - object { - x=93 - y=198 - width=100 - height=18 - } - monitor { - chan="$(P)$(M):busy" - clr=54 - bclr=3 - } - format="string" - limits { - } -} composite { object { x=13 - y=221 + y=290 width=180 height=18 } @@ -412,7 +446,7 @@ composite { text { object { x=13 - y=221 + y=290 width=75 height=18 } @@ -420,54 +454,48 @@ composite { clr=14 fill="outline" } - textix="Retries" + textix="Mode" } - "text update" { + menu { object { x=93 - y=221 + y=290 width=100 height=18 } - monitor { - chan="$(P)$(M):retries" - clr=54 + control { + chan="$(P)$(M):mode" + clr=14 bclr=3 } - format="string" - limits { - } } } } -"text update" { +text { object { - x=93 - y=152 - width=100 + x=13 + y=244 + width=75 height=18 } - monitor { - chan="$(P)$(M):rehome" - clr=54 - bclr=3 - } - format="string" - limits { + "basic attribute" { + clr=14 + fill="outline" } + textix="Max Retries" } -"message button" { +"text entry" { object { - x=13 - y=152 - width=75 + x=93 + y=244 + width=96 height=18 } control { - chan="$(P)$(M):rehome" - clr=54 - bclr=3 + chan="$(P)$(M):maxRetries" + clr=14 + bclr=50 + } + limits { } - label="Rehome" - press_msg="1" } diff --git a/opticsApp/op/ui/autoconvert/flexCombinedMotion.ui b/opticsApp/op/ui/autoconvert/flexCombinedMotion.ui index 81aa1e3..655d257 100644 --- a/opticsApp/op/ui/autoconvert/flexCombinedMotion.ui +++ b/opticsApp/op/ui/autoconvert/flexCombinedMotion.ui @@ -4,10 +4,10 @@ - 616 - 127 + 606 + 119 210 - 302 + 325 @@ -641,180 +641,7 @@ border-radius: 2px; - - - - 13 - 267 - 182 - 20 - - - - - QFrame::NoFrame - - - - 0 - 0 - 0 - - - - - 0 - 0 - 0 - - - - Mode - - - ESimpleLabel::WidthAndHeight - - - - 0 - 0 - 75 - 18 - - - - Qt::AlignAbsolute|Qt::AlignLeft|Qt::AlignVCenter - - - - - - 80 - 0 - 100 - 18 - - - - $(P)$(M):mode - - - - 0 - 0 - 0 - - - - - 200 - 200 - 200 - - - - caMenu::Static - - - - - - - 13 - 244 - 178 - 20 - - - - - QFrame::NoFrame - - - - 0 - 0 - 0 - - - - - 0 - 0 - 0 - - - - Debug - - - ESimpleLabel::WidthAndHeight - - - - 0 - 0 - 75 - 18 - - - - Qt::AlignAbsolute|Qt::AlignLeft|Qt::AlignVCenter - - - - - - 80 - 0 - 96 - 18 - - - - caLineEdit::WidthAndHeight - - - $(P)$(M):debug - - - - 0 - 0 - 0 - - - - - 153 - 255 - 255 - - - - caLineEdit::Channel - - - caLineEdit::Channel - - - caLineEdit::Channel - - - 0.0 - - - 1.0 - - - caLineEdit::Static - - - decimal - - - - + QFrame::NoFrame @@ -904,7 +731,7 @@ border-radius: 2px; caLineEdit::Static - + 13 @@ -913,7 +740,7 @@ border-radius: 2px; 20 - + QFrame::NoFrame @@ -1097,6 +924,266 @@ border-radius: 2px; caMessageButton::Static + + + + 13 + 267 + 178 + 20 + + + + + QFrame::NoFrame + + + + 0 + 0 + 0 + + + + + 0 + 0 + 0 + + + + Debug + + + ESimpleLabel::WidthAndHeight + + + + 0 + 0 + 75 + 18 + + + + Qt::AlignAbsolute|Qt::AlignLeft|Qt::AlignVCenter + + + + + + 80 + 0 + 96 + 18 + + + + caLineEdit::WidthAndHeight + + + $(P)$(M):debug + + + + 0 + 0 + 0 + + + + + 153 + 255 + 255 + + + + caLineEdit::Channel + + + caLineEdit::Channel + + + caLineEdit::Channel + + + 0.0 + + + 1.0 + + + caLineEdit::Static + + + decimal + + + + + + + 13 + 290 + 182 + 20 + + + + + QFrame::NoFrame + + + + 0 + 0 + 0 + + + + + 0 + 0 + 0 + + + + Mode + + + ESimpleLabel::WidthAndHeight + + + + 0 + 0 + 75 + 18 + + + + Qt::AlignAbsolute|Qt::AlignLeft|Qt::AlignVCenter + + + + + + 80 + 0 + 100 + 18 + + + + $(P)$(M):mode + + + + 0 + 0 + 0 + + + + + 200 + 200 + 200 + + + + caMenu::Static + + + + + + QFrame::NoFrame + + + + 0 + 0 + 0 + + + + + 0 + 0 + 0 + + + + Max Retries + + + ESimpleLabel::WidthAndHeight + + + + 13 + 244 + 75 + 18 + + + + Qt::AlignAbsolute|Qt::AlignLeft|Qt::AlignVCenter + + + + + + 93 + 244 + 96 + 18 + + + + caLineEdit::WidthAndHeight + + + $(P)$(M):maxRetries + + + + 0 + 0 + 0 + + + + + 153 + 255 + 255 + + + + caLineEdit::Channel + + + caLineEdit::Channel + + + caLineEdit::Channel + + + 0.0 + + + 1.0 + + + caLineEdit::Static + + + decimal + + caLabel_0 caLabel_1 caFrame_0 @@ -1109,23 +1196,25 @@ border-radius: 2px; caLabel_5 caFrame_4 caLabel_6 - caFrame_5 caLabel_7 - caFrame_6 + caFrame_5 caLabel_8 + caFrame_6 caLabel_9 caFrame_7 + caLabel_10 caLineEdit_0 caTextEntry_0 caTextEntry_1 caTextEntry_2 caTextEntry_3 - caMenu_0 - caTextEntry_4 caLineEdit_1 caLineEdit_2 caLineEdit_3 caMessageButton_0 + caTextEntry_4 + caMenu_0 + caTextEntry_5 \ No newline at end of file diff --git a/opticsApp/src/flexCombinedMotion.st b/opticsApp/src/flexCombinedMotion.st index a23c83e..c4f9bbd 100644 --- a/opticsApp/src/flexCombinedMotion.st +++ b/opticsApp/src/flexCombinedMotion.st @@ -28,6 +28,7 @@ PV(double, set_point, "{P}{M}:setPoint.VAL", EvFlag); PV(double, mode, "{P}{M}:mode.VAL", Monitor); PV(double, deadband, "{P}{M}:deadband.VAL", Monitor); PV(double, retries, "{P}{M}:retries.VAL", NoMon); +PV(double, max_retries, "{P}{M}:maxRetries.VAL", Monitor); PV(double, pos_monitor, "{P}{C}:pos", Monitor); PV(double, fine_val_put, "{P}{FM}.VAL", NoMon); PV(double, fine_rbv, "{P}{FM}.RBV", Monitor); @@ -268,6 +269,12 @@ ss combinedMotionMain DEBUG_PRINT2(5, "pos_error=%f, deadband=%f", pos_error, act_db); } + when ( num_retries >= max_retries ) + { + DEBUG_PRINT(1, "Max retries reached; Giving up.\n"); + DEBUG_PRINT(3, "maybeRetry -> resetBusy\n"); + } state resetBusy + when ( fabs(pos_error) > act_db ) { dist_calc = pos_error + fine_home;