Пример #1
0
        public static List <FormulaData> GetBlockFormulaList(int blockID)
        {
            List <FormulaData> result = new List <FormulaData>();
            var block = GetFunctionBlockByBlockID(blockID);

            if (block != null)
            {
                var config = Config.ConfigData.BlockConfigData.configData.Find(x => x.configName == block.BlockName);
                if (config == null)
                {
                    return(null);
                }
                if (config.manuConfig != null)
                {
                    for (int i = 0; i < config.manuConfig.formulaIDList.Count; i++)
                    {
                        var formulaData = FormulaModule.GetFormulaDataByID(config.manuConfig.formulaIDList[i]);
                        if (formulaData != null)
                        {
                            result.Add(formulaData);
                        }
                    }
                    return(result);
                }
            }
            return(null);
        }
Пример #2
0
 public void RefreshFormula(int formulaID)
 {
     CurrentFormulaID   = formulaID;
     currentFormulaData = FormulaModule.GetFormulaDataByID(formulaID);
     currentInputItem   = FormulaModule.GetFormulaItemList(formulaID, FormulaModule.MaterialProductType.Input);
     currentOutputItem  = FormulaModule.GetFormulaOutputMaterial(formulaID);
     currentEnhanceItem = FormulaModule.GetFormulaEnhanceMaterial(CurrentFormulaID);
 }
Пример #3
0
 public bool Create(int id)
 {
     if (FormulaModule.GetFormulaDataByID(id) == null)
     {
         return(false);
     }
     _id = id;
     return(true);
 }
Пример #4
0
 public ManufactFormulaInfo(int currentFormulaID)
 {
     CurrentFormulaID   = currentFormulaID;
     currentFormulaData = FormulaModule.GetFormulaDataByID(currentFormulaID);
     currentInputItem   = FormulaModule.GetFormulaItemList(currentFormulaID, FormulaModule.MaterialProductType.Input);
     currentOutputItem  = FormulaModule.GetFormulaOutputMaterial(currentFormulaID);
     currentEnhanceItem = FormulaModule.GetFormulaEnhanceMaterial(currentFormulaID);
     MaxNeedTime        = currentFormulaData.ProductSpeed;
     NotChoose          = false;
 }
Пример #5
0
        public ManufactFormulaInfo(int currentFormulaID, FunctionBlock block)
        {
            CurrentFormulaID   = currentFormulaID;
            FormulaChooseList  = FunctionBlockModule.GetBlockFormulaList(block.FunctionBlockID);
            currentFormulaData = FormulaModule.GetFormulaDataByID(currentFormulaID);
            currentInputItem   = FormulaModule.GetFormulaItemList(currentFormulaID, FormulaModule.MaterialProductType.Input);
            currentOutputItem  = FormulaModule.GetFormulaOutputMaterial(currentFormulaID);
            currentEnhanceItem = FormulaModule.GetFormulaEnhanceMaterial(currentFormulaID);
            MaxNeedTime        = currentFormulaData.ProductSpeed;

            for (int i = 0; i < currentInputItem.Count; i++)
            {
                realInputItem.Add(new FormulaItem(currentInputItem[i].model, 0));
            }

            realOutputItem  = new FormulaItem(currentOutputItem.model, 0);
            realEnhanceItem = new FormulaItem(currentEnhanceItem.model, 0);
            NotChoose       = false;
        }