internal static void Limits_Execute() { object oLangDll = null; object[] emergency_stop = null; object HC = null; LimitStatus.Horizon = false; LimitStatus.RA = false; LimitStatus.LimitDetected = false; //UPGRADE_TODO: (1067) Member ChkEnableLimits is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067 if (Convert.ToDouble(HC.ChkEnableLimits.Value) == 1) { if (EQMath.gEQparkstatus == 0) { if ((EQMath.gSlewStatus && gLimitSlews == 1) || (!EQMath.gSlewStatus && EQMath.gTrackingStatus > 0)) { LimitStatus = Limits_Detect(); if (Limits_Detect().LimitDetected) { LimitStatus.AtLimit = true; object[] tempAuxVar = emergency_stop; //UPGRADE_TODO: (1067) Member GetLangString is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067 //UPGRADE_TODO: (1067) Member Add_Message is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067 HC.Add_Message(oLangDll.GetLangString(5017)); if (gLimitPark != 0) { // park using currently selected park mode. //UPGRADE_TODO: (1067) Member ApplyParkMode is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067 HC.ApplyParkMode(); } } else { LimitStatus.AtLimit = false; } } else { if (LimitStatus.AtLimit) { // Currently in the limit state so look for clear. LimitStatus = Limits_Detect(); LimitStatus.AtLimit = Limits_Detect().LimitDetected; } } } else { //If unparking, parking or parked, limits don't apply LimitStatus.AtLimit = false; } } else { //limits not enabled so we can't be at the limit can we! LimitStatus.AtLimit = false; } }
private static TLIMIT_STATUS Limits_Detect() { TLIMIT_STATUS result = new TLIMIT_STATUS(); object oLangDll = null; object[] EQ_Beep = null; object HC = null; double Alt = 0; bool LimitDetected = false; result.LimitDetected = false; result.Horizon = false; result.RA = false; // Routine to handle RA LIMIT processing if ((EQMath.gRA_Limit_East != 0) && (EQMath.gEmulRA < EQMath.gRAEncoder_Zero_pos)) { if (EQMath.gEmulRA < EQMath.gRA_Limit_East) { if (gAutoFlipEnabled) { switch (AutoFlipState) { case 0: //we've hit the RA limit so initiate autoflip! Goto.gTargetRA = EQMath.gRA; Goto.gTargetDec = EQMath.gDec; //UPGRADE_TODO: (1067) Member GetLangString is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067 //UPGRADE_TODO: (1067) Member Add_Message is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067 HC.Add_Message("CoordSlew: " + Convert.ToString(oLangDll.GetLangString(105)) + "[ " + EQMath.FmtSexa(Goto.gTargetRA, false) + " ] " + Convert.ToString(oLangDll.GetLangString(106)) + "[ " + EQMath.FmtSexa(Goto.gTargetDec, true) + " ]"); Goto.gSlewCount = Goto.gMaxSlewCount; //NUM_SLEW_RETRIES 'Set initial iterative slew count object tempAuxVar = EQ_Beep[2]; Goto.radecAsyncSlew(Goto.gGotoRate); AutoFlipState = 1; break; default: break; } } else { result.RA = true; } goto endsub; } else { AutoFlipState = 0; } } if ((EQMath.gRA_Limit_West != 0) && (EQMath.gEmulRA > EQMath.gRAEncoder_Zero_pos)) { if (EQMath.gEmulRA > EQMath.gRA_Limit_West) { if (gAutoFlipEnabled) { switch (AutoFlipState) { case 0: //we've hit the RA limit so initiate autoflip! Goto.gTargetRA = EQMath.gRA; Goto.gTargetDec = EQMath.gDec; //UPGRADE_TODO: (1067) Member GetLangString is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067 //UPGRADE_TODO: (1067) Member Add_Message is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067 HC.Add_Message("CoordSlew: " + Convert.ToString(oLangDll.GetLangString(105)) + "[ " + EQMath.FmtSexa(Goto.gTargetRA, false) + " ] " + Convert.ToString(oLangDll.GetLangString(106)) + "[ " + EQMath.FmtSexa(Goto.gTargetDec, true) + " ]"); Goto.gSlewCount = Goto.gMaxSlewCount; //NUM_SLEW_RETRIES 'Set initial iterative slew count object tempAuxVar2 = EQ_Beep[2]; Goto.radecAsyncSlew(Goto.gGotoRate); AutoFlipState = 1; break; default: break; } } else { result.RA = true; } goto endsub; } else { AutoFlipState = 0; } } endsub: // get altitude limit for current azimuth if (!gSupressHorizonLimits) { if (EQMath.gAlt <= LimitArray2[Convert.ToInt32(EQMath.gAz)].Alt) { result.Horizon = true; } } else { result.Horizon = false; } result.LimitDetected = result.Horizon || result.RA; return(result); }