Open KaushikMalapati opened 3 days ago
Mismatches I have found so far
Type PV MES title actual title
PP XPP:SB2:MMS:29 Aerotech motor IMS Motor Control
AeroTech XCS:SND:T1:Y1 Aerotech motor SmarAct Motor Control
SmarAct XPP:MCS2:01:m1 Aerotech motor SmarAct Motor Control
How title variables are set (no fall through)
title
Newport XPS Positioner rtyp == xps8p
IMS Motor Control -- Main rtyp == ims
Typhos Suite - $(PREFIX) rtyp == motor and caget "${PREFIX}:PLC:nErrorId_RBV"
Aerotech motor rtyp = motor
IMS Motor Control -- Main rtyp != motor and caget "$PREFIX.PN"
IMS Motor Control rtyp != motor
How the screen is decided (also no fall through)
screen
typhos rtyp == motor and caget "${PREFIX}:PLC:nErrorId_RBV"
xps8 rtyp == xps8p
mmc rtyp == mmca
pcds_motion rtyp == motor and caget "$PREFIX:PN"
mcs2_main rtyp == motor and ($PREFIX == *"MCS2"* || $(caget "$PREFIX:PTYPE_RBV") and enc == *"Yes"*
mcs2_openloop rtyp == motor and ($PREFIX == *"MCS2"* || $(caget "$PREFIX:PTYPE_RBV") and enc != *"Yes"*
aerotech rtyp == motor
ims rtyp != motor
Expected Behavior
motor-expert-screen should finish executing and move the screen to the cursor irrespective of the type of motor
Current Behavior
For certain types of motors including but not limited to pulsepickers, aerotechs, and smaracts, the variabel title will not match the actual title of the screen opened, resulting in xdotool search --sync hanging forever, the screen never being aligned to the cursor, and motor-expert-screen never completing.
Possible Solution
I think the way title is set should be changed. Instead of having on if-elif-else block to set the title, and another to open the screen, we should only have one block where we set the title variable and another variable containing the command that will open the screen. At the end of the block, xdotool search for old windows, then execute the command. This will make it easier to make sure each different type of screen correctly sets the title variable.
Steps to Reproduce (for bugs)
Context
I noticed it while working on #233. I also feel like I've noticed this before but never paid it much attention.
Your Environment