예제 #1
0
 public static BasicConf GetInstance()
 {
     lock (SyncObject)
     {
         return _basicConf ?? (_basicConf = new BasicConf());
     }
 }
예제 #2
0
 public static BasicConf GetInstance()
 {
     lock (SyncObject)
     {
         return(_basicConf ?? (_basicConf = new BasicConf()));
     }
 }
예제 #3
0
        public static ICommCore GetInstance(BasicConf conf, Observer<DataEventArgs> observer)
        {
            lock (SyncObject)
            {

                return _CommInstance ?? (_CommInstance = new CommService(conf, observer));
            }
        }
예제 #4
0
        public bool LoadConfiguration()
        {
            bool ret = true;

            try
            {
                _appConf = BasicConf.GetInstance();
                ret      = UpdateSonarConfig();
            }
            catch (Exception ex)
            {
                ret = false;
            }
            return(ret);
        }
예제 #5
0
 public bool LoadConfiguration()
 {
     bool ret = true;
     try
     {
         _appConf = BasicConf.GetInstance();
         ret = UpdateSonarConfig();
     }
     catch (Exception ex)
     {
         ret = false;
         
     }
     return ret;
 }
예제 #6
0
 protected NetWorkService(BasicConf conf, Observer<DataEventArgs> observe)
 {
     _conf = conf;
     _dataObserver = observe;
 }
예제 #7
0
        private bool CreateTCPService(BasicConf conf)
        {
            // 同步方法,会阻塞进程,调用init用task
            if (!SonarIsOK)
            {
                TCPDataService.ConnectSync();
                TCPDataService.Register(NetDataObserver);
                TCPCmdService.ConnectSync();
                TCPCmdService.Register(NetDataObserver);

            }
            if (!PoseIsOK)
            {
                TCPPoseService.ConnectSync();
                TCPPoseService.Register(NetDataObserver);

            }
            if (SonarIsOK && PoseIsOK)
                return true;
            return false;
        }
예제 #8
0
 public static INetCore GetInstance(BasicConf conf, Observer<DataEventArgs> observer)
 {
     lock (SyncObject)
     {
         if (conf != null)
             return _netInstance ?? (_netInstance = new NetWorkService(conf, observer));
         else
         {
             return null;
         }
     }
 }
예제 #9
0
 protected CommService(BasicConf conf, Observer<DataEventArgs> observer)
 {
     _commConf = conf;
     _DataObserver = observer;
 }
예제 #10
0
 /// <summary>
 ///  初始化串口数据服务
 /// </summary>
 /// <param name="configure">通信参数</param>
 /// <returns>成功or失败</returns>
 private bool CreateSerialService(BasicConf configure)
 {
     _serialPort = new SerialPort(configure.GetCommGPS(),int.Parse(configure.GetGPSDataRate()));
     if (!SerialService.Init(_serialPort) || !SerialService.Start()) return false;
     SerialService.Register(CommDataObserver);
     return true;
 }