} // end frmMain_Activated //-SUB------------------------------------------------------------------------ // Event : frmMain_FormClosing //---------------------------------------------------------------------------- private void frmMain_FormClosing(object sender, FormClosingEventArgs e) { // Make sure the COM port is open to receive the reset command COMPort.Initialize(cboCOMPort.SelectedIndex); // Reset the gateway jCOM1939.RESET_J1939(); // Close the COM port COMPort.Terminate(); }// end frmMain_FormClosing
}// end btnStart_Click //-SUB------------------------------------------------------------------------ // Event : btnStop_Click //---------------------------------------------------------------------------- private void btnStop_Click(object sender, EventArgs e) { // Enable/disable start/stop buttons btnStart.Enabled = true; btnStop.Enabled = false; // Disable further buttons btnRequestStatus.Enabled = false; btnClaimAddr.Enabled = false; btnAddFilter.Enabled = false; btnDelFilter.Enabled = false; btnTransmit.Enabled = false; loadLog.Enabled = false; TrLog.Enabled = false; timerLoop.Stop(); COMPort.Terminate(); dataFile.Close(); }// end buttonStopCOM_Click