示例#1
0
    public void SelectStructList()
    {
        //连接本地数据库
        var local_db = new DbRepository <GetStructList>();

        local_db.DataService("vesali.db");
        IEnumerable <GetStructList> dbs = local_db.Select <GetStructList>((tempt) => {
            if (tempt.nounNo == null)
            {
                DebugLog.DebugLogInfo("数据异常,或表为空");
                return(false);
            }
            else
            {
                return(true);
            }
        });

        GetStructList one_struct = local_db.SelectOne <GetStructList>((Struct) => {
            if (Struct.nounName == typeof(GetStructList).Name)
            {
                return(true);
            }
            return(false);
        });
    }
示例#2
0
    List <string> GetNounoNameList(string app_id)
    {
        List <string> submodelList = new List <string>();
        var           local_db     = new DbRepository <GetStructList>();

        //获取名词范围
        local_db.DataService("vesali.db");
        GetStructList tmpIe = local_db.SelectOne <GetStructList>((tempNo) =>
        {
            if (tempNo.nounNo == app_id)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        });

        if (tmpIe == null)
        {
            local_db.Close();
        }
        submodelList = new List <string>(JsonConvert.DeserializeObject <Dictionary <string, float> >(tmpIe.submodelList).Keys);
        return(submodelList);
    }
示例#3
0
    public static void update_GetStructList_db(string dbfile)
    {
        DbRepository <GetStructList> temp_db;

        temp_db = new DbRepository <GetStructList>();
        temp_db.DataService(dbfile);
        temp_db.CreateTable();
        IEnumerable <GetStructList> res = temp_db.Select <GetStructList>((temp_fbx) =>
        {
            if (temp_fbx.nounNo != "")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        });

        if (res.GetEnumerator().MoveNext())
        {
            DbRepository <GetStructList> anim_db;
            anim_db = new DbRepository <GetStructList>();
            anim_db.DataService("vesali.db");
            foreach (GetStructList item in res)
            {
                GetStructList fbx_info = anim_db.SelectOne <GetStructList>((temp_fbx_anim) =>
                {
                    if (temp_fbx_anim.nounNo == item.nounNo)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                });


                if (fbx_info != null)
                {
                    anim_db.Update(item);
                }
                else
                {
                    anim_db.Insert(item);
                }
            }
            anim_db.Close();
        }
        temp_db.Close();
    }
示例#4
0
        public string getType(string modelId)
        {
            var local_db = new DbRepository <GetStructList>();

            local_db.DataService("vesali.db");
            GetStructList tmpIe = local_db.SelectOne <GetStructList>((tempNo) =>
            {
                if (tempNo.nounNo == modelId)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            });

            if (tmpIe == null)
            {
                local_db.Close();
                return(null);
            }
            local_db.Close();
            string result = null;

            if (tmpIe.nounType == "1")
            {
                int    founded  = 0;
                string jsonPath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.LastIndexOf("AppData") + 7) + "/roaming/Vesal/sign/NewAndOldSign.json";
                Dictionary <int, NewAndOldSign> nao = JsonConvert.DeserializeObject <Dictionary <int, NewAndOldSign> >(File.ReadAllText(jsonPath));
                foreach (NewAndOldSign tmpNao in nao.Values)
                {
                    if (modelId == tmpNao.app_id_old && tmpNao.app_id_new != "")
                    {
                        founded = 1;
                        result  = "newSign@" + tmpNao.app_id_new;
                        break;
                    }
                }
                if (founded == 0)
                {
                    result = "oldSign@" + tmpIe.nounName;
                }
            }
            else
            {
                result = "model";
            }
            return(result);
        }
    public void ResetDBCamera()
    {
        DbRepository <GetStructList> local_db2;

        //local_db2 = new DbRepository<MotorAnatomy_submodel>();
        local_db2 = new DbRepository <GetStructList>();
        local_db2.DataService("vesali.db");
        Debug.Log(PublicClass.app.app_id);
        GetStructList scope_Ie = local_db2.SelectOne <GetStructList>((tempNo) =>
        {
            if (tempNo.nounNo == PublicClass.app.app_id)
            {
                Debug.Log(tempNo.nounName);
                //DebugLog.DebugLogInfo(ss_id.bone_name+" "+ss_id.main_tex+" "+ ss_id.mask_tex);
                return(true);
            }
            else
            {
                return(false);
            }
        });

        Camera.main.transform.parent.localPosition = PublicTools.Str2Vector3(scope_Ie.camParentPos);
        Camera.main.transform.parent.rotation      = Quaternion.Euler(PublicTools.Str2Vector3(scope_Ie.camParentRot));
        Camera.main.transform.localPosition        = new Vector3(0, 0, PublicTools.Str2Vector3(scope_Ie.camPos).z);
        float z = Camera.main.transform.rotation.z;

        if (z < 90 && z > -90)
        {
            Interaction.instance.setParamValue2();
        }
        else
        {
            Interaction.instance.setParamValue3();
        }
    }
示例#6
0
    bool showTissueModel()
    {
        isShowTissueModel = false;
        DbRepository <GetStructList> local_db2;

        //local_db2 = new DbRepository<MotorAnatomy_submodel>();
        local_db2 = new DbRepository <GetStructList>();
        local_db2.DataService("vesali.db");
        Debug.Log(PublicClass.app.signModelName);
        GetStructList scope_Ie = local_db2.SelectOne <GetStructList>((tempNo) =>
        {
            if (tempNo.nounName == PublicClass.app.tissueModelName)
            {
                Debug.Log(tempNo.nounName);
                //DebugLog.DebugLogInfo(ss_id.bone_name+" "+ss_id.main_tex+" "+ ss_id.mask_tex);
                return(true);
            }
            else
            {
                return(false);
            }
        });


        List <GetStructList> texInfoList = new List <GetStructList>();

        List <string> initList = SceneModels.instance.getListByObj(scope_Ie);//getListByNo(nounNo);

        if (initList.Count == 0)
        {
            return(false);
        }
        Vector3 campos = PublicTools.Str2Vector3(scope_Ie.camPos);

        //  Camera.main.transform.parent.localPosition = PublicTools.Str2Vector3(texInfoList[0].camParentPos);

        Debug.Log(PublicTools.Str2Vector3(scope_Ie.camPos));
        Debug.Log(initList.Count);
        local_db2.Close();
        bool ishave = false;

        XT_AllButton.Instance.OpenMultipleModel();
        foreach (string tmp in initList)
        {
            if (SceneModels.instance.IsChooseModelByName(tmp))
            {
                ishave = true;
            }
        }
        if (ishave)
        {
            // XT_AllButton.Instance.TranslucentOther();
            XT_AllButton.Instance.ISO();
            foreach (string tmp in initList)
            {
                SceneModels.instance.ChooseModelByName(tmp);
            }
            XT_AllButton.Instance.OpenMultipleModel();

            if (campos != null)
            {
                Camera.main.transform.localPosition = campos;
                Interaction.instance.setParamValue2();
            }
        }
        //  XT_MouseFollowRotation.instance.To_360();
        isShowSignModel = false;
        return(true);
    }