Exemple #1
0
        public AnalogFile(AnalogDataManager manager, int type, int index)
        {
            this.dataManager = manager;
            this.Type        = type;
            this.Index       = index;
            if (type == 0x42)                              //半自动电压和电流
            {
                this.MaxFileSize = 100 * 10 * 1024 * 1024; //每天大约10M文件 按100天计算
            }
            else
            {
                this.MaxFileSize = 100 * 1024 * 1024; //每天大约1M文件
            }
            fileIndex = new AnalogIndexFile(this);
            fileData  = new AnalogRecordFile(this);

            for (int i = 0; i < BlockNum; i++)
            {
                queueBlock.Enqueue(new AnalogStoreBlock(i, this));
            }

            Random rnd = new Random();

            this.reserveCount = rnd.Next(AnalogStoreBlock.MaxPoint);
            currentBlock      = NewBlock(null, false);
            currentBlock.AddPrevNULL();
        }
        public AnalogFile(AnalogDataManager manager, int type,int index)
        {
            this.dataManager = manager;
            this.Type = type;
            this.Index = index;
            if (type == 0x42) //半自动电压和电流
            {
                this.MaxFileSize =100 * 10 * 1024 * 1024; //每天大约10M文件 按100天计算
            }
            else
            {
                this.MaxFileSize = 100 * 1024 * 1024; //每天大约1M文件
            }
            fileIndex = new AnalogIndexFile(this);
            fileData = new AnalogRecordFile(this);

            for (int i = 0; i < BlockNum; i++)
            {
                queueBlock.Enqueue(new AnalogStoreBlock(i, this));
            }

            Random rnd = new Random();

            this.reserveCount = rnd.Next(AnalogStoreBlock.MaxPoint);
            currentBlock = NewBlock(null, false);
            currentBlock.AddPrevNULL();
        }