예제 #1
0
파일: CPU.cs 프로젝트: vosechu/KOS
        public CPU(object parent, string context)
        {
            Mode         = CPUMode.READY;
            this.parent  = parent;
            this.context = context;

            bindingManager = new BindingManager(this, this.context);

            if (context == "ksp")
            {
                RunType = KOSRunType.KSP;

                if (Vessel != null)
                {
                    Archive = new Archive(Vessel);
                }
                Volumes.Add(Archive);
            }
            else
            {
                RunType = KOSRunType.WINFORMS;
            }

            RegisterkOSExternalFunction(new object[] { "test2", this, "testFunction", 2 });
        }
예제 #2
0
        public void Load(int channelId, string fileName)
        {
            var fileWaveSource = CodecFactory.Instance.GetCodec(fileName);

            const int mixerSampleRate = 44100; //44.1kHz

            VolumeSource       volsource;
            BiQuadFilterSource bqfSource;

            _mixer.AddSource(
                fileWaveSource
                .ChangeSampleRate(mixerSampleRate)
                .ToStereo()
                .AppendSource(x => new VolumeSource(x.ToSampleSource()), out volsource)
                .AppendSource(x => new BiQuadFilterSource(x), out bqfSource));
            volsource.Volume = 0;

            if (Volumes.Count < channelId)
            {
                Volumes.Add(volsource);
            }
            if (BqfSources.Count < channelId)
            {
                BqfSources.Add(bqfSource);
            }
            if (Channels.Count < channelId)
            {
                Channels.Add(new Channel(fileWaveSource));
            }

            Volumes[channelId - 1]    = volsource;
            Channels[channelId - 1]   = new Channel(fileWaveSource);
            BqfSources[channelId - 1] = bqfSource;
        }
        protected async Task ScrollLoadComics(int offset)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                var volumes = await apiComicsVine.GetMoreVolumes(Config.Apikey, offset, Publisher);

                var notNull    = from item in volumes.Volumes where item.Publisher != null select item;
                var marvelOrDc = notNull.Where(e => e.Publisher.Name.Contains(Publisher) || e.Publisher.Name.Contains(PublisherSecond) || e.Publisher.Name.Contains(PublisherThird));
                foreach (var item in marvelOrDc)
                {
                    Volumes.Add(item);
                }
                if (offset == 1000)
                {
                    ItemTreshold = -1;
                    return;
                }
            }

            catch (Exception ex)
            {
                await dialogService.DisplayAlertAsync("Error", $"{ex.Message}", "Ok");
            }
            finally
            {
                CurrentState = State.None;
            }
        }
예제 #4
0
        protected async Task ScrollLoadComics(int offset)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                var items = await apiComicsVine.GetMoreVolumes(offset, PublisherPrincipal, PublisherSecond, PublisherThird);

                foreach (var item in items)
                {
                    Volumes.Add(item);
                }
                if (offset == 1000)
                {
                    ItemTreshold = -1;
                    return;
                }
            }

            catch (Exception ex)
            {
                await dialogService.DisplayAlertAsync("Error", $"{ex.Message}", "Ok");
            }
            finally
            {
                IsBusy = false;
            }
        }
예제 #5
0
        public CPU(object parent, string context)
        {
            this.Parent  = parent;
            this.Context = context;

            Volumes.Add(archive);

            bindingManager = new BindingManager(this, Context);
        }
예제 #6
0
파일: Book.cs 프로젝트: Run2948/AbpSample
        public void AddVolume(Volume volume)
        {
            if (Volumes.Any(v => v.Title == volume.Title))
            {
                return;
            }

            Volumes.Add(volume);
        }
예제 #7
0
        public VolumeEdit_Form()
        {
            InitializeComponent();

            Volumes_panel.Location = new Point(data.Divide, data.Divide);

            int LocationY = data.Divide;

            for (int i = 0; i < RCache.Volumes.Count; i++)
            {
                Volumes.Add(new Volume_class(Volumes_panel, RCache.Volumes.GetVGroupID(i), ref LocationY));
            }

            var SPoint = T.SPoint.CreateSubTable();

            if ((data.UType)data.User <uint>(C.User.UType) == data.UType.MainEmploye)
            {
                SPoint.QUERRY()
                .SHOW
                .WHERE
                .ARC(C.SPoint.Object, C.Object.OLocationFrom, C.OLocation.Volumed).EQUI.BV <bool>(true)
                .AND.AC(C.SPoint.YMDS).Less.BV(Employe_Form.SPoints.EndDay)
                .AND.OB()
                .AC(C.SPoint.YMDE).More.BV <int>(Employe_Form.SPoints.StartDay)
                .OR.AC(C.SPoint.YMDE).EQUI.BV <int>(0)
                .CB()
                .DO();
            }
            else
            {
                SPoint.QUERRY()
                .SHOW
                .WHERE
                .ARC(C.SPoint.Object, C.Object.OLocationFrom, C.OLocation.Volumed).EQUI.BV <bool>(true)
                .AND.AC(C.SPoint.YMDS).Less.BV(Employe_Form.SPoints.EndDay)
                .AND.C(C.SPoint.Podr, data.User <uint>(C.User.Podr))
                .AND.OB()
                .AC(C.SPoint.YMDE).More.BV <int>(Employe_Form.SPoints.StartDay)
                .OR.AC(C.SPoint.YMDE).EQUI.BV <int>(0)
                .CB()
                .DO();
            }

            for (int i = 0; i < SPoint.Rows.Count; i++)
            {
                var VGIndex = RCache.Volumes.GetIndex(SPoint.Rows.Get_UnShow <uint>(i, C.SPoint.Object, C.Object.OLocationFrom));
                if (VGIndex > -1)
                {
                    Volumes[VGIndex].SPointID = SPoint.Rows.GetID(i);
                    Volumes[VGIndex].UpdateName();
                }
            }

            VolumeEdit_Form_Resize(null, null);
        }
예제 #8
0
파일: CPU.cs 프로젝트: ehrenmurdick/KOS
        public CPU(object parent, string context)
        {
            this.Parent  = parent;
            this.Context = context;

            bindingManager = new BindingManager(this, Context);

            if (context == "ksp")
            {
                archive = new Archive();
                Volumes.Add(archive);
            }
        }
예제 #9
0
 public void Init(SCIPackage package, ResType type, ushort number, byte resNum, int offset)
 {
     Package = package;
     Type    = type;
     Number  = number;
     if (type == ResType.Message && package.ExternalMessages)
     {
         Volumes.Add(new VolumeOffset(resNum, offset, "RESOURCE.MSG"));
     }
     else
     {
         Volumes.Add(new VolumeOffset(resNum, offset));
     }
 }
예제 #10
0
            public virtual void ReadChildData(BinaryReader reader)
            {
                int x = 0;

                for (x = 0; (x < _volumes.Count); x = (x + 1))
                {
                    Volumes.Add(new LightVolumeVolumeBlockBlock());
                    Volumes[x].Read(reader);
                }
                for (x = 0; (x < _volumes.Count); x = (x + 1))
                {
                    Volumes[x].ReadChildData(reader);
                }
            }
        public void AddToVolumes(string productName, int quantity)
        {
            Volume volume = Volumes.FirstOrDefault(v => v.ProductName.Equals(productName));

            if (volume == null)
            {
                volume = new Volume(productName, quantity);
                Volumes.Add(volume);
            }
            else
            {
                volume.TotalQuantity += quantity;
            }
        }
예제 #12
0
 public void Init(SCIPackage package, ResType type, ushort number, byte resNum, ResourceFileInfo info)
 {
     Package = package;
     Type    = type;
     Number  = number;
     if (type == ResType.Message && package.ExternalMessages)
     {
         Volumes.Add(new VolumeOffset(resNum, -1, "RESOURCE.MSG"));
     }
     else
     {
         Volumes.Add(new VolumeOffset(resNum, -1));
     }
     _info = info;
 }
예제 #13
0
        // Token: 0x06000879 RID: 2169 RVA: 0x0003D5D4 File Offset: 0x0003B7D4
        public static Volumes GetNodeVolumes(int nodeID)
        {
            Volumes volumes = new Volumes();

            using (SqlCommand textCommand = SqlHelper.GetTextCommand("SELECT * FROM Volumes WHERE NodeID=@NodeId"))
            {
                textCommand.Parameters.Add("@NodeId", SqlDbType.Int).Value = nodeID;
                using (IDataReader dataReader = SqlHelper.ExecuteReader(textCommand))
                {
                    while (dataReader.Read())
                    {
                        volumes.Add(DatabaseFunctions.GetInt32(dataReader, "VolumeID"), VolumeDAL.CreateVolume(dataReader));
                    }
                }
            }
            return(volumes);
        }
예제 #14
0
            private async Task GetAllVolumes()
            {
                const string query = @"
SELECT Caption,
       DeviceID,
       Description,
       FreeSpace,
       Name,
       Size,
       VolumeSerialNumber
  FROM Win32_LogicalDisk
 WHERE DriveType = 3"; //fixed disks

                using (var q = Wmi.Query(Name, query))
                {
                    foreach (var disk in await q.GetDynamicResult())
                    {
                        var id = $"{disk.DeviceID}";
                        var v  = Volumes.FirstOrDefault(x => x.Id == id);
                        if (v == null)
                        {
                            v = new Volume();
                            Volumes.Add(v);
                        }

                        v.Id          = $"{disk.DeviceID}";
                        v.Available   = disk.FreeSpace;
                        v.Caption     = disk.VolumeSerialNumber;
                        v.Description = disk.Name + " - " + disk.Description;
                        v.Name        = disk.Name;
                        v.NodeId      = Id;
                        v.Size        = disk.Size;
                        v.Type        = "Fixed Disk";
                        v.Status      = NodeStatus.Active;
                        v.Used        = v.Size - v.Available;
                        if (v.Size > 0)
                        {
                            v.PercentUsed = (float)(100 * v.Used / v.Size);
                        }
                    }
                }
            }
예제 #15
0
            private async Task GetAllVolumesAsync()
            {
                const string query = @"
SELECT Caption,
       DeviceID,
       Description,
       FreeSpace,
       Name,
       Size,
       VolumeSerialNumber
  FROM Win32_LogicalDisk
 WHERE DriveType = 3"; //fixed disks

                using (var q = Wmi.Query(Endpoint, query))
                {
                    foreach (var disk in await q.GetDynamicResultAsync().ConfigureAwait(false))
                    {
                        var id = $"{disk.DeviceID}";
                        var v  = Volumes.Find(x => x.Id == id) ?? new Volume();

                        v.Id          = $"{disk.DeviceID}";
                        v.Available   = disk.FreeSpace;
                        v.Caption     = disk.VolumeSerialNumber;
                        v.Description = disk.Name + " - " + disk.Description;
                        v.Name        = disk.Name;
                        v.NodeId      = Id;
                        v.Size        = disk.Size;
                        v.Type        = "Fixed Disk";
                        v.Status      = NodeStatus.Active;
                        v.Used        = v.Size - v.Available;
                        if (v.Size > 0)
                        {
                            v.PercentUsed = 100 * v.Used / v.Size;
                        }
                        if (v.Node == null)
                        {
                            v.Node = this;
                            Volumes.Add(v);
                        }
                    }
                }
            }
예제 #16
0
        public CPU(object parent, string context)
        {
            this.Parent  = parent;
            this.Context = context;

            bindingManager = new BindingManager(this, Context);

            if (context == "ksp")
            {
                RunType = kOSRunType.KSP;

                archive = new Archive(Vessel);
                Volumes.Add(archive);
            }
            else
            {
                RunType = kOSRunType.WINFORMS;
            }

            this.RegisterkOSExternalFunction(new object[] { "test2", this, "testFunction", 2 });
        }
예제 #17
0
        private void ReadFromIni(ACBrIniFile iniData)
        {
            iniData.ReadFromIni(ProcNFe, "procNFe");
            iniData.ReadFromIni(InfNFe, "infNFe");
            iniData.ReadFromIni(Identificacao, "Identificacao");

            var   i = 0;
            NFRef nfRef;

            do
            {
                i++;
                nfRef = iniData.ReadFromIni <NFRef>($"NFRef{i:000}");
                if (nfRef == null)
                {
                    continue;
                }

                Identificacao.NFref.Add(nfRef);
            } while (nfRef != null);

            iniData.ReadFromIni(Emitente, "Emitente");
            iniData.ReadFromIni(Avulsa, "Avulsa");
            iniData.ReadFromIni(Destinatario, "Destinatario");
            iniData.ReadFromIni(Retirada, "Retirada");
            iniData.ReadFromIni(Entrega, "Entrega");

            i = 0;
            AutXML autXml;

            do
            {
                i++;
                autXml = iniData.ReadFromIni <AutXML>($"autXML{i:00}");
                if (autXml == null)
                {
                    continue;
                }

                AutXml.Add(autXml);
            } while (autXml != null);

            i = 0;
            ProdutoNFe produto;

            do
            {
                i++;
                produto = iniData.ReadFromIni <ProdutoNFe>($"Produto{i:000}");
                if (produto == null)
                {
                    continue;
                }

                var    k = 0;
                NVENFe nveItem;
                do
                {
                    k++;
                    nveItem = iniData.ReadFromIni <NVENFe>($"NVE{i:000}{k:000}");
                    if (nveItem == null)
                    {
                        continue;
                    }

                    produto.NVE.Add(nveItem);
                } while (nveItem != null);

                k = 0;
                DINFe diItem;
                do
                {
                    k++;
                    diItem = iniData.ReadFromIni <DINFe>($"DI{i:000}{k:000}");
                    if (diItem == null)
                    {
                        continue;
                    }

                    var     j = 0;
                    LADINFe ladiItem;
                    do
                    {
                        j++;
                        ladiItem = iniData.ReadFromIni <LADINFe>($"DI{i:000}{k:000}{j:000}");
                        if (ladiItem != null)
                        {
                            diItem.LADI.Add(ladiItem);
                        }
                    } while (ladiItem != null);

                    produto.DI.Add(diItem);
                } while (diItem != null);

                k = 0;
                RastroNFe rastroItem;
                do
                {
                    k++;
                    rastroItem = iniData.ReadFromIni <RastroNFe>($"rastro{i:000}{k:000}");
                    if (rastroItem == null)
                    {
                        continue;
                    }

                    produto.Rastro.Add(rastroItem);
                } while (rastroItem != null);

                k = 0;
                MedicamentoNFe medItem;
                do
                {
                    k++;
                    medItem = iniData.ReadFromIni <MedicamentoNFe>($"Medicamento{i:000}{k:000}");
                    if (medItem == null)
                    {
                        continue;
                    }

                    produto.Medicamento.Add(medItem);
                } while (medItem != null);

                k = 0;
                ArmaNFe armaItem;
                do
                {
                    k++;
                    armaItem = iniData.ReadFromIni <ArmaNFe>($"Arma{i:000}{k:000}");
                    if (armaItem == null)
                    {
                        continue;
                    }

                    produto.Arma.Add(armaItem);
                } while (armaItem != null);

                iniData.ReadFromIni(produto.ImpostoDevol, $"impostoDevol{i:000}");
                iniData.ReadFromIni(produto.Veiculo, $"Veiculo{i:000}");
                iniData.ReadFromIni(produto.Combustivel, $"Combustivel{i:000}");
                iniData.ReadFromIni(produto.Combustivel.CIDE, $"CIDE{i:000}");
                iniData.ReadFromIni(produto.Combustivel.Encerrante, $"encerrante{i:000}");
                iniData.ReadFromIni(produto.ICMS, $"ICMS{i:000}");
                iniData.ReadFromIni(produto.IPI, $"IPI{i:000}");
                iniData.ReadFromIni(produto.II, $"II{i:000}");
                iniData.ReadFromIni(produto.PIS, $"PIS{i:000}");
                iniData.ReadFromIni(produto.PISST, $"PISST{i:000}");
                iniData.ReadFromIni(produto.COFINS, $"COFINS{i:000}");
                iniData.ReadFromIni(produto.COFINSST, $"COFINSST{i:000}");
                iniData.ReadFromIni(produto.ISSQN, $"ISSQN{i:000}");

                Produtos.Add(produto);
            } while (produto != null);

            iniData.ReadFromIni(Total, "Total");
            iniData.ReadFromIni(ISSQNtot, "ISSQNtot");
            iniData.ReadFromIni(RetTrib, "retTrib");
            iniData.ReadFromIni(Transportador, "Transportador");

            i = 0;
            ReboqueNFe reboque;

            do
            {
                i++;
                reboque = iniData.ReadFromIni <ReboqueNFe>($"Reboque{i:000}");
                if (reboque == null)
                {
                    continue;
                }

                Transportador.Reboque.Add(reboque);
            } while (reboque != null);

            i = 0;
            VolumeNFe volume;

            do
            {
                i++;
                volume = iniData.ReadFromIni <VolumeNFe>($"Volume{i:000}");
                if (volume == null)
                {
                    continue;
                }

                var       k = 0;
                LacresNFe lacre;
                do
                {
                    k++;
                    lacre = iniData.ReadFromIni <LacresNFe>($"Lacre{i:000}{k:000}");
                    if (lacre == null)
                    {
                        continue;
                    }

                    volume.Lacres.Add(lacre);
                } while (lacre != null);

                Volumes.Add(volume);
            } while (volume != null);

            iniData.ReadFromIni(Fatura, "Fatura");

            i = 0;
            DuplicataNFe duplicata;

            do
            {
                i++;
                duplicata = iniData.ReadFromIni <DuplicataNFe>($"Duplicata{i:000}");
                if (duplicata == null)
                {
                    continue;
                }

                Duplicatas.Add(duplicata);
            } while (duplicata != null);

            i = 0;
            PagamentoNFe pag;

            do
            {
                i++;
                pag = iniData.ReadFromIni <PagamentoNFe>($"pag{i:000}");
                if (pag == null)
                {
                    continue;
                }

                Pagamentos.Add(pag);
            } while (pag != null);

            iniData.ReadFromIni(DadosAdicionais, "DadosAdicionais");

            i = 0;
            InfoAdicionalNfe info;

            do
            {
                i++;
                info = iniData.ReadFromIni <InfoAdicionalNfe>($"obsCont{i:000}");
                if (info == null)
                {
                    continue;
                }

                DadosAdicionais.ObsCont.Add(info);
            } while (info != null);

            i = 0;
            do
            {
                i++;
                info = iniData.ReadFromIni <InfoAdicionalNfe>($"obsFisco{i:000}");
                if (info == null)
                {
                    continue;
                }

                DadosAdicionais.ObsFisco.Add(info);
            } while (info != null);

            i = 0;
            ProcRefNFe procRef;

            do
            {
                i++;
                procRef = iniData.ReadFromIni <ProcRefNFe>($"procRef{i:000}");
                if (procRef == null)
                {
                    continue;
                }

                DadosAdicionais.ProcRef.Add(procRef);
            } while (procRef != null);

            iniData.ReadFromIni(Exporta, "Exporta");
            iniData.ReadFromIni(Compra, "compra");
            iniData.ReadFromIni(Cana, "cana");

            i = 0;
            ForDiaNFe forDia;

            do
            {
                i++;
                forDia = iniData.ReadFromIni <ForDiaNFe>($"forDia{i:000}");
                if (forDia == null)
                {
                    continue;
                }

                Cana.forDia.Add(forDia);
            } while (forDia != null);

            i = 0;
            DeducNFe deduc;

            do
            {
                i++;
                deduc = iniData.ReadFromIni <DeducNFe>($"deduc{i:000}");
                if (deduc == null)
                {
                    continue;
                }

                Cana.deduc.Add(deduc);
            } while (deduc != null);

            iniData.ReadFromIni(InfRespTec, "infRespTec");
        }
예제 #18
0
파일: Cfg.cs 프로젝트: Daoting/dt
        /// <summary>
        /// 初始化文件服务
        /// </summary>
        public static void Init()
        {
            // BaseDirectory程序集所在的目录,不可用Directory.GetCurrentDirectory()!
            Root = Path.Combine(AppContext.BaseDirectory, "drive");
            var dir = new DirectoryInfo(Root);

            if (!dir.Exists)
            {
                dir.Create();
            }

            // 固定卷
            var           fv = Kit.GetCfg <string>("FixedVolume");
            StringBuilder sb = new StringBuilder("初始化固定卷");

            if (!string.IsNullOrEmpty(fv))
            {
                var vols = fv.Split(';');
                foreach (var vol in vols)
                {
                    var v = vol.Trim().ToLower();
                    if (v != string.Empty)
                    {
                        string path = Path.Combine(Root, v);
                        if (!Directory.Exists(path))
                        {
                            Directory.CreateDirectory(path);
                        }
                        FixedVolumes.Add(v);
                        sb.Append(" ");
                        sb.Append(v);
                    }
                }
            }
            sb.Append(",普通卷");

            // 普通卷
            SortedSetCache cache = new SortedSetCache(VolumeKey);
            var            subs  = dir.GetDirectories();

            if (subs != null && subs.Length > 0)
            {
                foreach (var sub in subs)
                {
                    // 非固定卷
                    string v = sub.Name.ToLower();
                    if (!FixedVolumes.Contains(v))
                    {
                        Volumes.Add(sub.Name);
                        // 加入缓存
                        cache.Increment(v, 0).Wait();
                        sb.Append(" ");
                        sb.Append(v);
                    }
                }
            }
            // 无普通卷时创建默认卷v0
            if (Volumes.Count == 0)
            {
                Volumes.Add(_defaultVol);
                Directory.CreateDirectory(Path.Combine(Root, _defaultVol));
                cache.Increment(_defaultVol, 0).Wait();
                sb.Append(" ");
                sb.Append(_defaultVol);
            }

            Log.Information(sb.ToString());
        }
예제 #19
0
 public void AddVolume(float volume)
 {
     Volumes.Add(volume);
 }
예제 #20
0
파일: CPU.cs 프로젝트: ehrenmurdick/KOS
 public void AttachHardDisk(Harddisk hardDisk)
 {
     Volumes.Add(hardDisk);
     SelectedVolume = hardDisk;
 }
예제 #21
0
파일: CPU.cs 프로젝트: vosechu/KOS
 public void AttachVolume(IVolume hardDisk)
 {
     Volumes.Add(hardDisk);
     SelectedVolume = hardDisk;
 }