예제 #1
0
        internal static void readFlipGoto()
        {
            object HC = null;

            //UPGRADE_TODO: (1069) Error handling statement (On Error Resume Next) was converted to a pattern that might have a different behavior. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1069
            try
            {
                //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                string tmptxt = Convert.ToString(HC.oPersist.ReadIniValue("DISABLE_FLIPGOTO_RESET"));
                if (tmptxt != "")
                {
                    gDisbleFlipGotoReset = Convert.ToInt32(Conversion.Val(tmptxt));
                }
                else
                {
                    //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                    HC.oPersist.WriteIniValue("DISABLE_FLIPGOTO_RESET", "0");
                    gDisbleFlipGotoReset = 0;
                }
            }
            catch (Exception exc)
            {
                NotUpgradedHelper.NotifyNotUpgradedElement("Resume in On-Error-Resume-Next Block");
            }
        }
예제 #2
0
 public Persist()
 {
     iniPath = Interaction.Environ("APPDATA") + "\\" + Definitions.AppName;
     //UPGRADE_TODO: (1069) Error handling statement (On Error Resume Next) was converted to a pattern that might have a different behavior. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1069
     try
     {
         if (FileSystem.GetAttr(iniPath) != FileAttribute.Directory)
         {
             Directory.CreateDirectory(iniPath);
         }
         INIfilename = iniPath + "\\EQMOD.ini";
         key         = "[default]";
     }
     catch (Exception exc)
     {
         NotUpgradedHelper.NotifyNotUpgradedElement("Resume in On-Error-Resume-Next Block");
     }
 }
예제 #3
0
        internal static void readGotoRate()
        {
            object gParkParams = null;
            object HC          = null;

            //UPGRADE_TODO: (1069) Error handling statement (On Error Resume Next) was converted to a pattern that might have a different behavior. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1069
            try
            {
                //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                string tmptxt = Convert.ToString(HC.oPersist.ReadIniValue("GOTO_RATE"));
                if (tmptxt != "")
                {
                    gGotoRate = Convert.ToInt32(Conversion.Val(tmptxt));
                }
                else
                {
                    gGotoRate = 0;
                    Tracking.writeCustomRa();
                }
                //    gGotoRate = 0
                if (gGotoRate == 0)
                {
                    //UPGRADE_TODO: (1067) Member HScrollSlewLimit is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                    HC.HScrollSlewLimit.value = HC.HScrollSlewLimit.min;
                }
                else
                {
                    //UPGRADE_TODO: (1067) Member HScrollSlewLimit is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                    HC.HScrollSlewLimit.value = gGotoRate;
                }
                //UPGRADE_TODO: (1067) Member rate is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                gParkParams.rate = gGotoRate;
            }
            catch (Exception exc)
            {
                NotUpgradedHelper.NotifyNotUpgradedElement("Resume in On-Error-Resume-Next Block");
            }
        }
예제 #4
0
        internal static bool LoadAlignmentPreset(int preset)
        {
            object         HC         = null;
            string         tmptxt2    = "";
            string         VarStr     = "";
            int            pos        = 0;
            int            Index      = 0;
            int            ValidCount = 0;
            int            MaxCount   = 0;
            AlignmentPoint NewData    = new AlignmentPoint();

            bool ret = false;

            // set up a file path for the align.ini file
            //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
            string Alignini = Convert.ToString(HC.oPersist.GetIniPath) + "\\ALIGN.ini";

            string key = "[alignment_preset" + preset.ToString() + "]";

            //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
            string tmptxt = Convert.ToString(HC.oPersist.ReadIniValueEx("STAR_COUNT", key, Alignini));

            if (tmptxt != "")
            {
                MaxCount = Convert.ToInt32(Conversion.Val(tmptxt));
                if (MaxCount > MAX_STARS)
                {
                    MaxCount = MAX_STARS;
                }
            }
            else
            {
                MaxCount = 0;
            }

            //UPGRADE_TODO: (1065) Error handling statement (On Error Goto) could not be converted. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1065
            UpgradeHelpers.Helpers.NotUpgradedHelper.NotifyNotUpgradedElement("On Error Goto Label (DecodeError)");
            if (MaxCount != 0)
            {
                ValidCount = 0;
                int tempForEndVar = MaxCount;
                for (Index = 1; Index <= tempForEndVar; Index++)
                {
                    VarStr = "Star" + Index.ToString();
                    //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                    tmptxt = Convert.ToString(HC.oPersist.ReadIniValueEx(VarStr, key, Alignini));
                    if (tmptxt != "")
                    {
                        pos = (tmptxt.IndexOf(';') + 1);
                        if (pos == 0)
                        {
                            goto DecodeError;
                        }
                        tmptxt2           = tmptxt.Substring(0, Math.Min(pos - 1, tmptxt.Length));
                        tmptxt            = tmptxt.Substring(Math.Max(tmptxt.Length - (Strings.Len(tmptxt) - pos), 0));
                        NewData.AlignTime = DateTime.Parse(tmptxt2);

                        pos = (tmptxt.IndexOf(';') + 1);
                        if (pos == 0)
                        {
                            goto DecodeError;
                        }
                        tmptxt2 = tmptxt.Substring(0, Math.Min(pos - 1, tmptxt.Length));
                        tmptxt  = tmptxt.Substring(Math.Max(tmptxt.Length - (Strings.Len(tmptxt) - pos), 0));
                        NewData.OrigTargetRA = Double.Parse(tmptxt2);

                        pos = (tmptxt.IndexOf(';') + 1);
                        if (pos == 0)
                        {
                            goto DecodeError;
                        }
                        tmptxt2 = tmptxt.Substring(0, Math.Min(pos - 1, tmptxt.Length));
                        tmptxt  = tmptxt.Substring(Math.Max(tmptxt.Length - (Strings.Len(tmptxt) - pos), 0));
                        NewData.OrigTargetDEC = Double.Parse(tmptxt2);

                        pos = (tmptxt.IndexOf(';') + 1);
                        if (pos == 0)
                        {
                            goto DecodeError;
                        }
                        tmptxt2          = tmptxt.Substring(0, Math.Min(pos - 1, tmptxt.Length));
                        tmptxt           = tmptxt.Substring(Math.Max(tmptxt.Length - (Strings.Len(tmptxt) - pos), 0));
                        NewData.TargetRA = Double.Parse(tmptxt2);

                        pos = (tmptxt.IndexOf(';') + 1);
                        if (pos == 0)
                        {
                            goto DecodeError;
                        }
                        tmptxt2           = tmptxt.Substring(0, Math.Min(pos - 1, tmptxt.Length));
                        tmptxt            = tmptxt.Substring(Math.Max(tmptxt.Length - (Strings.Len(tmptxt) - pos), 0));
                        NewData.TargetDEC = Double.Parse(tmptxt2);

                        pos = (tmptxt.IndexOf(';') + 1);
                        if (pos == 0)
                        {
                            goto DecodeError;
                        }
                        tmptxt2           = tmptxt.Substring(0, Math.Min(pos - 1, tmptxt.Length));
                        tmptxt            = tmptxt.Substring(Math.Max(tmptxt.Length - (Strings.Len(tmptxt) - pos), 0));
                        NewData.EncoderRA = Double.Parse(tmptxt2);

                        pos = (tmptxt.IndexOf(';') + 1);
                        if (pos == 0)
                        {
                            goto DecodeError;
                        }
                        tmptxt2            = tmptxt.Substring(0, Math.Min(pos - 1, tmptxt.Length));
                        NewData.EncoderDEC = Double.Parse(tmptxt2);

                        // all data read ok - copy to alignment stars
                        AlignmentStars[Index] = NewData;
                        ValidCount++;
                    }
                    else
                    {
                        goto DecodeError;
                    }
                }

DecodeError:
                //UPGRADE_TODO: (1069) Error handling statement (On Error Resume Next) was converted to a pattern that might have a different behavior. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1069
                try
                {
                    gAlignmentStars_count = ValidCount;

                    // send to matrix will initialise the catalog and measured points arrays
                    SendtoMatrix();

                    ret = true;
                }
                catch (Exception exc)
                {
                    NotUpgradedHelper.NotifyNotUpgradedElement("Resume in On-Error-Resume-Next Block");
                }
            }

            return(ret);
        }
예제 #5
0
        internal static void readCustomMount()
        {
            object HC = null;

            int i = 0;

            int NF1 = FileSystem.FreeFile();

            //UPGRADE_TODO: (1069) Error handling statement (On Error Resume Next) was converted to a pattern that might have a different behavior. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1069
            try
            {
                FileSystem.FileClose(NF1);
                //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                FileSystem.FileOpen(NF1, (Convert.ToDouble(HC.oPersist.GetIniPath()) + Double.Parse("\\mountparams.txt")).ToString(), OpenMode.Output, OpenAccess.Default, OpenShare.Default, -1);
                for (i = 10000; i <= 10007; i++)
                {
                    FileSystem.PrintLine(NF1, "0," + i.ToString() + ":" + Common.EQGP(0, i).ToString());
                    FileSystem.PrintLine(NF1, "1," + i.ToString() + ":" + Common.EQGP(1, i).ToString());
                }
                FileSystem.FileClose(NF1);

                //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                string tmptxt = Convert.ToString(HC.oPersist.ReadIniValue("CUSTOM_MOUNT"));
                if (tmptxt != "")
                {
                    gCustomMount = Convert.ToInt32(Conversion.Val(tmptxt));
                }
                else
                {
                    gCustomMount = 0;
                    //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                    HC.oPersist.WriteIniValue("CUSTOM_MOUNT", "0");
                }

                //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                tmptxt = Convert.ToString(HC.oPersist.ReadIniValue("CUSTOM_RA_STEPS_360"));
                if (tmptxt != "")
                {
                    gCustomRA360 = Convert.ToInt32(Conversion.Val(tmptxt));
                }
                else
                {
                    gCustomRA360 = 9024000;
                    //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                    HC.oPersist.WriteIniValue("CUSTOM_RA_STEPS_360", "9024000");
                }

                //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                tmptxt = Convert.ToString(HC.oPersist.ReadIniValue("CUSTOM_DEC_STEPS_360"));
                if (tmptxt != "")
                {
                    gCustomDEC360 = Convert.ToInt32(Conversion.Val(tmptxt));
                }
                else
                {
                    gCustomDEC360 = 9024000;
                    //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                    HC.oPersist.WriteIniValue("CUSTOM_DEC_STEPS_360", "9024000");
                }

                //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                tmptxt = Convert.ToString(HC.oPersist.ReadIniValue("CUSTOM_RA_STEPS_WORM"));
                if (tmptxt != "")
                {
                    gCustomRAWormSteps = Conversion.Val(tmptxt);
                }
                else
                {
                    gCustomRAWormSteps = 50133;
                    //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                    HC.oPersist.WriteIniValue("CUSTOM_RA_STEPS_WORM", "50133");
                }

                //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                tmptxt = Convert.ToString(HC.oPersist.ReadIniValue("CUSTOM_DEC_STEPS_WORM"));
                if (tmptxt != "")
                {
                    gCustomDECWormSteps = Conversion.Val(tmptxt);
                }
                else
                {
                    gCustomDECWormSteps = 50133;
                    //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                    HC.oPersist.WriteIniValue("CUSTOM_DEC_STEPS_WORM", "50133");
                }

                //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                tmptxt = Convert.ToString(HC.oPersist.ReadIniValue("CUSTOM_TRACKING_OFFSET_RA"));
                if (tmptxt != "")
                {
                    Tracking.gCustomTrackingOffsetRA = Convert.ToInt32(Conversion.Val(tmptxt));
                }
                else
                {
                    Tracking.gCustomTrackingOffsetRA = 0;
                    //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                    HC.oPersist.WriteIniValue("CUSTOM_TRACKING_OFFSET_RA", "0");
                }

                //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                tmptxt = Convert.ToString(HC.oPersist.ReadIniValue("CUSTOM_TRACKING_OFFSET_DEC"));
                if (tmptxt != "")
                {
                    Tracking.gCustomTrackingOffsetDEC = Convert.ToInt32(Conversion.Val(tmptxt));
                }
                else
                {
                    Tracking.gCustomTrackingOffsetDEC = 0;
                    //UPGRADE_TODO: (1067) Member oPersist is not defined in type Variant. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1067
                    HC.oPersist.WriteIniValue("CUSTOM_TRACKING_OFFSET_DEC", "0");
                }

                Common.EQSetOffsets();
            }
            catch (Exception exc)
            {
                NotUpgradedHelper.NotifyNotUpgradedElement("Resume in On-Error-Resume-Next Block");
            }
        }
예제 #6
0
        // write using any key and path
        public void DeleteSection(string IniKey, string filepath)
        {
            int    NF1       = 0;
            int    NF2       = 0;
            string filepath2 = "";
            bool   skip      = false;
            string temp1     = "";

            //UPGRADE_TODO: (1065) Error handling statement (On Error Goto) could not be converted. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1065
            UpgradeHelpers.Helpers.NotUpgradedHelper.NotifyNotUpgradedElement("On Error Goto Label (handleErr)");


            filepath2 = filepath.Substring(0, Math.Min(Strings.Len(filepath) - 4, filepath.Length)) + "_tmp.ini";

            NF1 = FileSystem.FreeFile();
            NF2 = FileSystem.FreeFile();

            FileSystem.FileClose(NF1);
            FileSystem.FileClose(NF2);
            FileSystem.FileOpen(NF1, filepath, OpenMode.Input, OpenAccess.Default, OpenShare.Default, -1);
            FileSystem.FileOpen(NF2, filepath2, OpenMode.Output, OpenAccess.Default, OpenShare.Default, -1);

            skip = false;
            while (!FileSystem.EOF(NF1))
            {
                temp1 = FileSystem.LineInput(NF1);

                if (temp1.StartsWith("["))
                {
                    if (temp1 == IniKey)
                    {
                        // found secion to skip
                        skip = true;
                    }
                    else
                    {
                        skip = false;
                    }
                }
                if (!skip)
                {
                    // copy to tempfile
                    FileSystem.PrintLine(NF2, temp1);
                }
            }

            FileSystem.FileClose(NF1);
            FileSystem.FileClose(NF2);

            //UPGRADE_TODO: (1069) Error handling statement (On Error Resume Next) was converted to a pattern that might have a different behavior. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1069
            try
            {
                File.Delete(filepath);
                FileSystem.Rename(filepath2, filepath);

                FileSystem.FileClose(NF1);
                FileSystem.FileClose(NF2);
                return;

handleErr:
                FileSystem.FileClose(NF1);
                FileSystem.FileClose(NF2);
            }
            catch (Exception exc)
            {
                NotUpgradedHelper.NotifyNotUpgradedElement("Resume in On-Error-Resume-Next Block");
            }
        }