Example #1
0
        public void FormResetCounters_Load(System.Object sender, System.EventArgs e)
        {
            CheckForIllegalCrossThreadCalls = false;

            stationList              = new StationsHashtable();
            jbc                      = new JBC_API();
            jbc.NewStationConnected += jbc_NewStationConnected;
            jbc.StationDisconnected += jbc_StationDisconnected;
            jbc.UserError           += jbc_UserError;
            jbc.StartSearch(SearchMode.USB);

            loadTexts("es");
        }
        public void FormUnlockParams_Load(System.Object sender, System.EventArgs e)
        {
            CheckForIllegalCrossThreadCalls = false;

            SplitContainer1.Panel2Collapsed = true;

            stationList              = new StationsHashtable();
            jbc                      = new JBC_API();
            jbc.NewStationConnected += jbc_NewStationConnected;
            jbc.StationDisconnected += jbc_StationDisconnected;
            jbc.UserError           += jbc_UserError;
            jbc.StartSearch(SearchMode.USB);
        }
Example #3
0
        public static void initLibrary(TestContext testContext)
        {
            jbc_api                      = new JBC_Connect.JBC_API();
            _autoResetEvent              = new AutoResetEvent(false);
            jbc_api.NewStationConnected += JBC_NewStationConnected;
            jbc_api.StationDisconnected += JBC_StationDisconnected;
            jbc_api.TransactionFinished += JBC_TransactionFinished;


            jbc_api.StartSearch();

            _autoResetEvent.WaitOne(EVENT_TIMEOUT);
        }
Example #4
0
            /// <summary>
            /// This method initialize the DLL connect and start searching devices
            /// </summary>
            /// <returns>True if the initialization was successful</returns>
            internal static bool InitDLL()
            {
                try
                {
                    if (ReferenceEquals(jbc, null))
                    {
                        jbc = new JBC_API();
                        //USB and Ethernet
                        if (My.Settings.Default.SearchUSB && My.Settings.Default.SearchETH)
                        {
                            LoggerModule.logger.Info(Localization.getResStr(modL10nData.EV_SEARCHING_USB_STATIONS_ID));
                            LoggerModule.logger.Info(Localization.getResStr(modL10nData.EV_SEARCHING_ETH_STATIONS_ID));
                            jbc.StartSearch();
                            //USB
                        }
                        else if (My.Settings.Default.SearchUSB)
                        {
                            LoggerModule.logger.Info(Localization.getResStr(modL10nData.EV_SEARCHING_USB_STATIONS_ID));
                            jbc.StartSearch(SearchMode.USB);
                            //Ethernet
                        }
                        else if (My.Settings.Default.SearchETH)
                        {
                            LoggerModule.logger.Info(Localization.getResStr(modL10nData.EV_SEARCHING_ETH_STATIONS_ID));
                            jbc.StartSearch(SearchMode.ETH);
                            //Not search
                        }
                        else
                        {
                            LoggerModule.logger.Info(Localization.getResStr(modL10nData.EV_SEARCHING_NONE_ID));
                        }
                    }
                }
                catch (Exception ex)
                {
                    LoggerModule.logger.Error(string.Format("{0} ({1})", Localization.getResStr(modL10nData.EV_ERROR_STARTING_DLL_ID), ex.Message));
                    return(false);
                }

                return(true);
            }
Example #5
0
            /// <summary>
            /// This method initialize the DLL connect and start searching devices
            /// </summary>
            /// <returns>True if the initialization was successful</returns>
            internal static bool InitDLL()
            {
                try
                {
                    if (ReferenceEquals(jbc, null))
                    {
                        jbc = new JBC_API();
                        //USB and Ethernet
                        if (My.Settings.Default.SearchUSB && My.Settings.Default.SearchETH)
                        {
                            LoggerModule.logger.Info(My.Resources.Resources.evSetSearchingUSB);
                            LoggerModule.logger.Info(My.Resources.Resources.evSetSearchingETH);
                            jbc.StartSearch();
                            //USB
                        }
                        else if (My.Settings.Default.SearchUSB)
                        {
                            LoggerModule.logger.Info(My.Resources.Resources.evSetSearchingUSB);
                            jbc.StartSearch(SearchMode.USB);
                            //Ethernet
                        }
                        else if (My.Settings.Default.SearchETH)
                        {
                            LoggerModule.logger.Info(My.Resources.Resources.evSetSearchingETH);
                            jbc.StartSearch(SearchMode.ETH);
                            //Not search
                        }
                        else
                        {
                            LoggerModule.logger.Info(My.Resources.Resources.evSearchingNone);
                        }
                    }
                }
                catch (Exception ex)
                {
                    LoggerModule.logger.Error(string.Format("{0} ({1})", My.Resources.Resources.evErrorStartingDLL, ex.Message));
                    return(false);
                }

                return(true);
            }
Example #6
0
        public CTraceLocal(JBC_API _jbc, int _FileMaxSequence = 0)
        {
            // VBConversions Note: Non-static class variable initialization is below.  Class variables cannot be initially assigned non-static values in C#.
            m_TraceControlLogFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles), "JBC\\JBC Station Controller Service\\TraceData");


            LoggerModule.InitLogger();

            jbc             = _jbc;
            FileMaxSequence = _FileMaxSequence;

            m_Trace = new CTraceData(6000);

            //CheckForIllegalCrossThreadCalls = False

            //butStartTrace.Enabled = True
            //butStopTrace.Enabled = False
            //nudFileMaxSequence.Enabled = butStartTrace.Enabled

            m_TimerStart           = new System.Timers.Timer();
            m_TimerStart.Elapsed  += TimerStart_Elapsed;
            m_TimerStart.AutoReset = false;
            m_TimerStart.Interval  = TIME_START;
            m_TimerStart.Stop();

            m_TimerDiscover           = new System.Timers.Timer();
            m_TimerDiscover.Elapsed  += TimerDiscover_Elapsed;
            m_TimerDiscover.AutoReset = false;
            m_TimerDiscover.Interval  = TIME_DISCOVER;
            m_TimerDiscover.Stop();

            m_TimerCopyFiles           = new System.Timers.Timer();
            m_TimerCopyFiles.Elapsed  += TimerCopyFiles_Elapsed;
            m_TimerCopyFiles.AutoReset = false;
            m_TimerCopyFiles.Interval  = TIME_COPY_FILES;
            m_TimerCopyFiles.Stop();

            m_TimerStart.Start();
        }
		private void init()
		{
			//creating the API, the timer and configuring VBasic properly
			JBC = new JBC_API();
			JBC.NewStationConnected += JBC_NewStationConnected;
			JBC.StationDisconnected += JBC_StationDisconnected;
			JBC.UserError += JBC_UserError;
			tmr = new System.Timers.Timer();
			tmr.Elapsed += tmr_Elapsed;
			CheckForIllegalCrossThreadCalls = false;
			
			CSpeedContinuousModeBindingSource.DataSource = typeof(SpeedContinuousMode);
			
			// start searching stations
			JBC.StartSearch();
			
			//configuring the timer
			tmr.Interval = 100;
			tmr.AutoReset = false;
			
			//setting the combobox speed values
			Array items = System.Enum.GetNames(typeof(SpeedContinuousMode));
			foreach (string field in items)
			{
				cbxSpeed.Items.Add(field);
			}
			cbxSpeed.SelectedIndex = 0;
			
			//setting the initial tmr interval
			cbxTick.SelectedIndex = 0;
			tmr.Interval = 1000;
			
			//initially disabling the start and stop buttons
			butStart.Enabled = false;
			butStop.Enabled = false;
		}
Example #8
0
        private void init()
        {
            //creating the API object
            JBC = new JBC_API();
            JBC.NewStationConnected        += JBC_NewStationConnected;
            JBC.StationDisconnected        += JBC_StationDisconnected;
            JBC.UserError                  += JBC_UserError;
            CheckForIllegalCrossThreadCalls = false;

            // start searching stations
            JBC.StartSearch();

            //clearing the combobox
            cbxStations.Items.Clear();
            cbxStations.SelectedIndex = -1;

            //disabling the params
            gbxStationParams.Enabled = false;
            gbxStationData.Enabled   = false;
            gbxPort1.Enabled         = false;
            gbxPort2.Enabled         = false;
            gbxPort3.Enabled         = false;
            gbxPort4.Enabled         = false;

            //initial values for the comboboxes
            cbxUnits.SelectedIndex = 0;
            cbxN2.SelectedIndex    = 0;
            cbxHelp.SelectedIndex  = 0;
            cbxBeep.SelectedIndex  = 0;

            //configuring timer
            tmr           = new System.Timers.Timer();
            tmr.Elapsed  += tmr_Elapsed;
            tmr.Interval  = 500;
            tmr.AutoReset = false;
        }