| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using FluentFTP;
- using GSG.NET.Logging;
- using GSG.NET.ObjectBase;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- namespace VehicleControlSystem.Managers
- {
- /// <summary>
- /// 아날로그 입력 정보를 종합하여 로그로 남기는 역할
- /// FTP 를 이용하여 파일 전송
- /// </summary>
- class PhysicalCheckupLogger : SingletonBase<PhysicalCheckupLogger>
- {
- Logger logger = Logger.GetLogger( "PhysicalCheckup" );
- private PhysicalCheckupLogger()
- {
- }
- public void DriveStateLog(string speed, string torque, bool isFront = true )
- {
- if ( isFront )
- logger.I( $"[Front] - Speed : {speed} / Torque : {torque}" );
- else
- logger.I( $"[Rear] - Speed : {speed} / Torque : {torque}" );
- }
- //192.168.127.188 Moxa 용성 IP
- public async Task UploadPhysicalCheckupLogAsync()
- {
- var token = new CancellationToken();
- using ( var ftp = new FtpClient( "192.168.127.188") )
- {
- await ftp.ConnectAsync( token );
- // upload a folder and all its files
- await ftp.UploadDirectoryAsync( @"C:\LOG\OHV\Vehicle\PhysicalCheckup\", @"/DriveInfo", FtpFolderSyncMode.Update );
- // upload a folder and all its files, and delete extra files on the server
- //ftp.UploadDirectory( @"C:\website\assets\", @"/public_html/assets", FtpFolderSyncMode.Mirror );
- }
- }
- }
- }
|