예제 #1
0
        public double[] DataComplex(int channelNo, int shotNo, int start, int end, double stepD)
        {
            try
            {
                int step   = (int)Math.Ceiling(stepD);
                int length = (end - start) / step;

                string fileDirectory;
                if (shotNo < 0)
                {
                    throw new Exception("读取数据炮号应大于或等于0!");
                }
                else if (shotNo == 0)
                {
                    fileDirectory = DataFileParentDirectory + "\\" + CurrentShotNo.ToString() + "\\";
                }
                else
                {
                    fileDirectory = DataFileParentDirectory + "\\" + shotNo.ToString() + "\\";
                }
                dataReader = DataFileFactory.GetReader(fileDirectory, dataFileName);
                double[] data = dataReader.LoadDataFromFileComplexRam(channelNo, (ulong)start, (ulong)step, (ulong)length, 1);
                return(data);
            }
            catch
            {
                return(null);
            }
        }
예제 #2
0
 public double[] Data(int channelNo, int shotNo, int start, int length)
 {
     try
     {
         string fileDirectory;
         if (shotNo < 0)
         {
             throw new Exception("读取数据炮号应大于或等于0!");
         }
         else if (shotNo == 0)
         {
             fileDirectory = DataFileParentDirectory + "\\" + CurrentShotNo.ToString() + "\\";
         }
         else
         {
             fileDirectory = DataFileParentDirectory + "\\" + shotNo.ToString() + "\\";
         }
         dataReader = DataFileFactory.GetReader(fileDirectory, dataFileName);
         double[] data = dataReader.LoadDataFromFile(channelNo, (ulong)start, (ulong)length);
         return(data);
     }
     catch
     {
         return(null);
     }
 }
        public override void TryInit(object initObj)
        {
            myConfig = new ManagerConfig((string)initObj);

            databaseHost = myConfig.DatabaseHost;
            databaseName = myConfig.DatabaseName;

            myMongoDBOperator = new MongoDBOperator(databaseHost, databaseName);
            myExcalOperator   = new ExcelOperator();

            shotNoVersionNo = new ShotNoVersionNo();
            tagPathGroup    = new TagPathGroup();
            currentShotNo   = new CurrentShotNo();

            if (!myMongoDBOperator.IsDatabaseExist())
            {
                Console.WriteLine("The specified database does not exist! Please use the \"Import\" method to create the initial database from the configuration dir");
            }
        }