예제 #1
0
파일: Bike.cs 프로젝트: rene1997/ip2
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="commportNumber">The number of the commport the bike is connected to.</param>
 public Bike(string commportNumber)
 {
     bikeCommunication = new BikeCommunication(this);
     if (bikeCommunication.ConnectToCom(commportNumber))
     {
         usingComm = true;
         status = "Connected to " + commportNumber;
     }
     else //When there is nothing connected to the commport;
     {
         simulator = new Simulator();
         status = "Simulator";
     }
 }
예제 #2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="commportNumber">The number of the commport the bike is connected to.</param>
 public Bike(string commportNumber)
 {
     bikeCommunication = new BikeCommunication(this);
     if (bikeCommunication.ConnectToCom(commportNumber))
     {
         usingComm = true;
         status    = "Connected to " + commportNumber;
     }
     else //When there is nothing connected to the commport;
     {
         simulator = new Simulator();
         status    = "Simulator";
     }
 }