Exemplo n.º 1
0
    public void StartEvacuationPlan()
    {
        if (Popuplist.GetComponent <UIPopupList>().items.Count == 0)
        {
            Logger.Instance.WriteLog("执行疏散预案失败,没有可执行的疏散预案");
            return;
        }
        if (Popuplist.GetComponent <UIPopupList>().value.Trim() == "")
        {
            Logger.Instance.WriteLog("执行疏散预案失败,没有可执行的疏散预案");
            return;
        }

        Logger.Instance.WriteLog("开始执行疏散预案");
        if (HasEvacuationPlanExcute)
        {
            Logger.Instance.WriteLog("已经有疏散预案正在执行");
            return;
        }
        MainMenuController.canNotOpen = true;
        Popuplist.GetComponent <BoxCollider>().enabled         = false;
        EvacuationPlanBtn.GetComponent <BoxCollider>().enabled = false;
        EvacuationPlanBtnSprite        = EvacuationPlanBtn.normalSprite;
        EvacuationPlanBtn.normalSprite = EvacuationPlanBtn.pressedSprite;
        HasEvacuationPlanExcute        = true;
        EvacuationPlanDao ePlanDao     = new EvacuationPlanDao();
        EvacuatePlan      evacuatePlan = ePlanDao.Select004(Popuplist.GetComponent <UIPopupList>().value)[0];

        PrivateStartEvacuationPlan(evacuatePlan);
    }
Exemplo n.º 2
0
 //初始化对象
 public void Init(EvacuatePlan _evacuatePlan, GameObject _areaOfPlanPanel)
 {
     Logger.Instance.WriteLog("初始化疏散预案列表项目");
     evacuatePlan    = _evacuatePlan;
     areaOfPlanPanel = _areaOfPlanPanel;
     No.text         = evacuatePlan.id;
     Name.text       = evacuatePlan.name;
 }
Exemplo n.º 3
0
    private void AddItemToEvacuatePlanItemGrid(EvacuatePlan plan)
    {
        GameObject go = GameObject.Instantiate(EditedEvacuatePlanListItemPrefab) as GameObject;

        EvacuatePlanItemGrid.AddChild(go.transform);
        go.transform.localScale = new Vector3(1, 1, 1);
        go.GetComponent <EditedEvacuatePlanListItem>().Init(plan, EvacuateAreaOfPlanPanel);
    }
Exemplo n.º 4
0
    /// <summary>
    /// 获取指定疏散预案对应的区域id列表
    /// </summary>
    /// <returns>The correlation area identifier.</returns>
    /// <param name="evacuatePlan">Evacuate plan.</param>
    List <string> GetCorrelationAreaId(EvacuatePlan evacuatePlan)
    {
        Logger.Instance.WriteLog("获取指定疏散预案对应的区域id列表");
        EvacuationPlanDao         ePlanDao  = new EvacuationPlanDao();
        List <EvacuateAreaOfPlan> eaoPlan   = ePlanDao.Select002(evacuatePlan.id);
        List <string>             areaIdLst = new List <string>();

        foreach (var eaop in eaoPlan)
        {
            areaIdLst.Add(eaop.evacuateAreaId);
        }
        return(areaIdLst);
    }
Exemplo n.º 5
0
    void PrivateStartEvacuationPlan(EvacuatePlan evacuatePlan)
    {
        GameObject go = Instantiate(WarningListItemPrefab) as GameObject;

        WarningItemContainer.AddChild(go.transform);
        go.transform.localScale = new Vector3(1, 1, 1);
        go.transform.FindChild("Label").GetComponent <UILabel>().text = evacuatePlan.name;

        UIEventListener.Get(go.transform.FindChild("Run").gameObject).onClick  = ProcessAlert;
        UIEventListener.Get(go.transform.FindChild("Stop").gameObject).onClick = AlertRelease;
        WarningList.Add(go);
        Logger.Instance.WriteLog("保存预案处理日志");
        AlertPrecessLogDao aplDao = new AlertPrecessLogDao();

        aplDao.Insert001(System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), evacuatePlan.name, "", "", "", "");
        DicAlertAndID[go]   = aplDao.currentId;
        DicAlertAndPlan[go] = evacuatePlan;
    }
Exemplo n.º 6
0
    /// <summary>
    /// 检索所有的疏散预案
    /// </summary>
    public List <EvacuatePlan> Select003()
    {
        List <EvacuatePlan> Result = new List <EvacuatePlan>();
        string  sql = "select ID,NAME from CYGJ_EVACUATE_PLAN order by ID asc";
        DataSet ds  = OdbcDataManager.Instance.odbcOra.ReturnDataSet(sql, "CYGJ_EVACUATE_PLAN");

        if (ds.Tables.Count > 0)
        {
            DataTable dt = ds.Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                EvacuatePlan info = new EvacuatePlan();
                info.id   = dr["ID"].ToString();
                info.name = dr["NAME"].ToString();
                Result.Add(info);
            }
        }
        Logger.Instance.WriteLog("向数据库检索所有的疏散预案");
        return(Result);
    }