예제 #1
0
        public frmMain(string[] args)
        {
            Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
            //System.Threading.Thread.CurrentThread.CurrentUICulture
            CultureInfo tci = new CultureInfo("nl-NL");
            Thread.CurrentThread.CurrentCulture = tci;
            splash = new frmSplash();
            splash.Show();
            System.Windows.Forms.Application.DoEvents();
            InitializeComponent();
            m_AFRMap = new AFRMap();
            m_AFRMap.onCellLocked += m_AFRMap_onCellLocked;
            m_AFRMap.onFuelmapCellChanged += m_AFRMap_onFuelmapCellChanged;

            try
            {
                sndplayer = new System.Media.SoundPlayer();
            }
            catch (Exception E)
            {
                logger.Debug(E.Message);
            }
            if (args.Length > 0)
            {
                if (args[0].ToUpper().EndsWith(".BIN"))
                {
                    if(File.Exists(args[0]))
                    {
                        m_commandLineFile = args[0];
                        m_startFromCommandLine = true;
                    }
                }
            }

            m_DelegateUpdateRealTimeValue = UpdateRealtimeInformationValue;
            m_DelegateUpdateBDMProgress = ReportBDMProgress;
            m_DelegateUpdateMapViewer = UpdateMapViewer;

            m_DelegateUpdateStatus = updateStatusInBox;
            m_DelegateProgressStatus = SetProgressPercentage;
            m_DelegateCanFrame = trionic7_onCanFrame;

            trionic7.onReadProgress += trionicCan_onReadProgress;
            trionic7.onWriteProgress += trionicCan_onWriteProgress;
            trionic7.onCanInfo += trionicCan_onCanInfo;
            trionic7.onCanFrame += trionicCan_onCanFrame;

            try
            {
                RegistryKey TempKeyCM = null;
                TempKeyCM = Registry.ClassesRoot.CreateSubKey(@"SystemFileAssociations\.bin\shell\Edit in T7 Suite\command");
                string StartKey = System.Windows.Forms.Application.ExecutablePath + " \"%1\"";
                TempKeyCM.SetValue("", StartKey);
                TempKeyCM.Close();
            }
            catch (Exception E)
            {
                logger.Debug(E.Message);
            }
            try
            {
                RegistryKey TempKeyCM = null;
                TempKeyCM = Registry.ClassesRoot.CreateSubKey(@"SystemFileAssociations\.bin\shell\Auto detect Trionic file type\command");
                string StartKey = System.Windows.Forms.Application.StartupPath + "\\SuiteLauncher.exe" + " \"%1\"";
                TempKeyCM.SetValue("", StartKey);
                TempKeyCM.Close();
            }
            catch (Exception E)
            {
                logger.Debug(E.Message);
            }

            try
            {
                // should be done only once!
                this.fio_callback = this.on_fio;
                BdmAdapter_SetFIOCallback(this.fio_callback);
                logger.Debug("BDM adapter callback set!");
                // should be done only once!

            }
            catch (Exception BDMException)
            {
                logger.Debug("BDM init failed: " + BDMException.Message);
            }

            try
            {
                m_DelegateStartReleaseNotePanel = this.StartReleaseNotesViewer;

            }
            catch (Exception E)
            {
                logger.Debug(E.Message);
            }
        }
예제 #2
0
        public Form1(string[] args)
        {
            frmSplash splash = new frmSplash();
            splash.Show();
            System.Windows.Forms.Application.DoEvents();
            InitializeComponent();
            addWizTuneFilePacks();
            // Only have this enabled in debug mode until ready
            this.barButtonItem29.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;

            try
            {
                RegistryKey TempKeyCM = null;
                TempKeyCM = Registry.ClassesRoot.CreateSubKey(@"SystemFileAssociations\.bin\shell\Edit in T8 Suite\command");
                string StartKey = System.Windows.Forms.Application.ExecutablePath + " \"%1\"";
                TempKeyCM.SetValue("", StartKey);
                TempKeyCM.Close();
            }
            catch (Exception E)
            {
                logger.Debug(E.Message);
            }
            try
            {
                RegistryKey TempKeyCM = null;
                TempKeyCM = Registry.ClassesRoot.CreateSubKey(@"SystemFileAssociations\.bin\shell\Auto detect Trionic file type\command");
                string StartKey = System.Windows.Forms.Application.StartupPath + "\\SuiteLauncher.exe" + " \"%1\"";
                TempKeyCM.SetValue("", StartKey);
                TempKeyCM.Close();
            }
            catch (Exception E)
            {
                logger.Debug(E.Message);
            }
            if (args.Length > 0)
            {
                if (args[0].ToString().ToUpper().EndsWith(".BIN"))
                {
                    if (File.Exists(args[0].ToString()))
                    {
                        m_startFromCommandLine = true;
                        m_commandLineFile = args[0].ToString();
                    }
                }
            }
            try
            {
                m_DelegateStartReleaseNotePanel = new DelegateStartReleaseNotePanel(this.StartReleaseNotesViewer);
                m_DelegateUpdateRealTimeValue = new DelegateUpdateRealTimeValue(this.UpdateRealtimeInformationValue);

            }
            catch (Exception E)
            {
                logger.Debug(E.Message);
            }

            try
            {
                sndplayer = new System.Media.SoundPlayer();
                t8can.onReadProgress += new ITrionic.ReadProgress(t8can_onReadProgress);
                t8can.onWriteProgress += new ITrionic.WriteProgress(t8can_onWriteProgress);
                t8can.onCanInfo += new ITrionic.CanInfo(t8can_onCanInfo);
            }
            catch (Exception E)
            {
                logger.Debug(E.Message);
            }

            splash.Close();
        }