Exemplo n.º 1
0
		static void Main(string[] args)
		{
			Console.WriteLine("Start");
			scheduler = new SpringCardIWM2_Serial_Scheduler("COM11");
			scheduler.SetReaderFoundCallback(new SpringCardIWM2_Serial_Scheduler.ReaderFoundCallback(OnReaderFound));
			scheduler.Start((byte) 1, (byte) 10);
		}
		void BtStartClick(object sender, EventArgs e)
		{
			/* Create a new SpringCardIWM2_Serial_Scheduler object on this port, ... */
			selectedScheduler = new SpringCardIWM2_Serial_Scheduler(cbCOMPorts.Text);
			
			/* ... indicate whether all sent/received frames must be printed ...   */
			selectedScheduler.SetShowFrames(show_frames);
			
			/* ... sets all the callcacks to be informed of its activities ... */
			SetCallbacks(selectedScheduler);
			
			/* ... and launch it ! */ 
			selectedScheduler.Start((byte) nudAddMin.Value, (byte) nudAddMax.Value);

			/* If the user switches in the future to another port, remember this scheduler is active and running */ 
			MF.RefineSchedulersList(schedulers, cbCOMPorts.Text);
			schedulers.Add(selectedScheduler);
			
			/* Finally, enable the "Stop" and disable the "start" buttons */
			btStart.Enabled = false;
			btStop.Enabled = true;
			
		}