Beispiel #1
0
 public WD_SubscriptTimeDataClass()
 {
     if (sglb == null)
     {
         sglb = new SystemGlobal(new WindAPI());
     }
 }
Beispiel #2
0
    void UpdateStatusBar()
    {
        SystemGlobal sg = SystemGlobal.Instance;

        PlugFastenGlobal pfg = PlugFastenGlobal.Instance;

        bool nf = pfg.m_PlugCorrect;

        if (nf != m_OldFastenStatus)
        {
            if (nf)
            {
                sg.m_OpRecord.Add("线路连接正确");
            }
            else
            {
                sg.m_OpRecord.Add("线路连接错误");
            }
        }
        if (nf)
        {
            m_StatusBar.text = "线路连接正确";
        }
        else
        {
            m_StatusBar.text = "线路连接错误";
        }
        m_OldFastenStatus = nf;
    }
Beispiel #3
0
        protected void Application_Start(object sender, EventArgs e)
        {
            try
            {
                var setting = new EnvironmentSetting();
                setting.ClientDesDeKey = "j6=9=1ac";
                setting.EntityAssembly = Assembly.Load("ZyGames.Tianjiexing.Model");
                ScriptEngines.AddReferencedAssembly(new string[] {
                    "ZyGames.Tianjiexing.Lang.dll",
                    "ZyGames.Tianjiexing.Model.dll",
                    "ZyGames.Tianjiexing.Component.dll",
                    "ZyGames.Tianjiexing.BLL.Combat.dll",
                    "ZyGames.Tianjiexing.BLL.GM.dll",
                    "ZyGames.Tianjiexing.BLL.dll"
                });
                GameEnvironment.Start(setting);

                SystemGlobal.Run();

#if (DEBUG)
                TraceLog.WriteError("系统正使用Debug版本");
#else
                TraceLog.ReleaseWrite("系统正使用Release版本");
#endif
            }
            catch (Exception ex)
            {
                TraceLog.WriteError("global start error:{0}", ex);
            }
        }
    public void OnClearButtonDown()
    {
        SystemGlobal sg = SystemGlobal.Instance;

        sg.m_ForceValue = 0;
        sg.m_OpRecord.Add("已清零数据");
    }
Beispiel #5
0
    // Use this for initialization
    void Start()
    {
        SystemGlobal sg = SystemGlobal.Instance;

        PlugFastenGlobal pfg = PlugFastenGlobal.Instance;

        if (pfg.m_Inited[Index] == false)
        {
            pfg.m_PlugPos[Index] = transform.position;
            m_OriginalPos        = transform.position;
            //m_OriginalPos = transform.position;
            m_OldPos = transform.position;


            //transform.position = new Vector3(m_OriginalPos.x + m_Offset.x, m_OriginalPos.y + m_Offset.y, 0);
            pfg.m_Inited[Index] = true;
        }
        else
        {
            m_OriginalPos = pfg.m_PlugPos[Index];
            m_OldPos      = pfg.m_PlugPos[Index];
        }

        m_Pos = m_OldPos;

        transform.position = m_Pos;
    }
    // Use this for initialization
    void Start()
    {
        MeshRenderer mr = GetComponent <MeshRenderer>();

        SystemGlobal sg = SystemGlobal.Instance;

        int [] mt = new int[2];
        mt[0] = sg.m_Type / 3;
        mt[1] = sg.m_Type % 3;

        switch (mt[Index])
        {
        case 0:
            mr.material = m_MFe;
            break;

        case 1:
            mr.material = m_MCu;
            break;

        case 2:
            mr.material = m_MAl;
            break;
        }
    }
    public void OnForceDown()
    {
        SystemGlobal sg = SystemGlobal.Instance;

        sg.m_ForceValue -= 100;
        sg.m_ForceValue  = Mathf.Clamp(sg.m_ForceValue, 0, 2000);
    }
Beispiel #8
0
    void Start()
    {
        UpdateContent();
        Index = 0;
        SystemGlobal sg = SystemGlobal.Instance;

        sg.m_OpRecord.ForEach(new System.Action <string>(AddRecord));
    }
Beispiel #9
0
    public void OnIntrButtonDown()
    {
        SystemGlobal sg = SystemGlobal.Instance;


        sg.m_MainShowInfo = !sg.m_MainShowInfo;
        sg.m_FrozeCamera  = sg.m_MainShowInfo;
    }
Beispiel #10
0
    public void OnExpRecordButtonDown()
    {
        SystemGlobal sg = SystemGlobal.Instance;

        System.DateTime Time = System.DateTime.Now;
        sg.m_OpRecord.Add("\t" + Time.ToLongDateString() + "/" + Time.ToLongTimeString() + "\t 进入实验记录界面");

        UnityEngine.SceneManagement.SceneManager.LoadScene("ExpRecord");
    }
Beispiel #11
0
 protected override void OnStartAffer()
 {
     SystemGlobal.Start();
     //ActionFactory.SetActionIgnoreAuthorize(1002);
     //ActionFactory.SetActionIgnoreAuthorize(200);
     //Lua script regist method
     ScriptEngines.OnLoaded += ScriptProxy.Load;
     ScriptProxy.RegistMethodd();
 }
Beispiel #12
0
    public void OnButtonDownCuCu()
    {
        SystemGlobal sg = SystemGlobal.Instance;

        sg.m_Type = Type;

        sg.m_OpRecord.Add("进入主界面,实验类型代号:" + Type);
        UnityEngine.SceneManagement.SceneManager.LoadScene("MainScene");
    }
Beispiel #13
0
    public void OnReturnButtonDown()
    {
        SystemGlobal sg = SystemGlobal.Instance;

        System.DateTime Time = System.DateTime.Now;
        sg.m_OpRecord.Add("\t" + Time.ToLongDateString() + "/" + Time.ToLongTimeString() + "\t 进入初始界面");


        UnityEngine.SceneManagement.SceneManager.LoadScene("SelectExpType");
    }
Beispiel #14
0
    void UpdateContent()
    {
        SystemGlobal sg = SystemGlobal.Instance;

        Len = sg.m_OpRecord.Capacity;
        RectTransform rt = m_Content.GetComponent <RectTransform>();

        rt.sizeDelta = new Vector2(20, Len * 25 + 25);
        // rt.position
    }
Beispiel #15
0
        protected override void Run()
        {
            Console.WriteLine("Started");

            SystemGlobal.Execute();


            Console.WriteLine("Done");
            Console.ReadLine();
            Stop();
        }
Beispiel #16
0
    void Rotate()
    {
        float X = Input.GetAxis("Mouse X");

        m_RotateY         += X;
        m_RotateY          = Mathf.Clamp((m_RotateY * 1.0f), 0, 2000);
        transform.rotation = Quaternion.Euler(m_OriginalQuat.eulerAngles.x, m_OriginalQuat.eulerAngles.y, m_OriginalQuat.eulerAngles.z + m_RotateY);
        m_Text.text        = m_RotateY.ToString("F2");
        SystemGlobal sg = SystemGlobal.Instance;

        sg.m_ForceValue = m_RotateY;
    }
Beispiel #17
0
    void UpDateLED(int i)
    {
        SystemGlobal sg = SystemGlobal.Instance;

        int port = 0;

        port = 6 * sg.m_DataPanelPage + i;

        PlugFastenGlobal pfg = PlugFastenGlobal.Instance;

        int plugnum = -1;

        for (int pn = 0; pn < pfg.m_PlugFastenNum.Length; pn++)
        {
            if (pfg.m_PlugFastenNum[pn] == port)
            {
                plugnum = pn;
                break;
            }
        }



        string str = (i + 1).ToString().PadLeft(2, '0');

        str = "LED" + str;
        GameObject go = GameObject.Find(str);


        if (go != null)
        {
            Text tx = go.GetComponent <Text>();

            if (plugnum != -1)
            {
                tx.text = GetLEDValue(plugnum, sg.m_ForceValue, sg.m_Type).ToString("F0");
                //tx.text = GetLEDValue(PortRemap(port), sg.m_ForceValue, sg.m_Type).ToString("F2");
            }
            else
            {
                tx.text = "0.00";
            }
        }
        str = (i + 1).ToString().PadLeft(2, '0');
        str = "LABEL" + str;
        go  = GameObject.Find(str);
        if (go != null)
        {
            Text tx = go.GetComponent <Text>();

            tx.text = (port + 1).ToString("F0");
        }
    }
        public override void Process(JsonParameter[] paramList)
        {
            JsonParameterList parameters = JsonParameter.Convert(paramList);

            if (parameters["op"].Length > 0)
            {
                string userID = parameters["UserId"];
                if (!string.IsNullOrEmpty(userID) && userID.ToUpper().StartsWith("Z"))
                {
                    string          pid  = userID;
                    List <GameUser> list = new List <GameUser>();
                    new GameDataCacheSet <GameUser>().Foreach((personalId, key, user) =>
                    {
                        if (user.Pid.ToUpper() == pid.ToUpper())
                        {
                            list.Add(user);
                        }
                        return(true);
                    });
                    if (list.Count > 0)
                    {
                        userID = list[0].UserID;
                    }
                }
                if (!string.IsNullOrEmpty(userID) && parameters["op"].Equals("1"))
                {
                    UserCacheGlobal.ReLoad(userID);
                }
                else
                {
                    var cacheSet = new ConfigCacheSet <CareerInfo>();
                    if (parameters["op"].Equals("0"))
                    {
                        ConfigCacheGlobal.Load();
                        UserCacheGlobal.ReLoad(string.Empty);
                        SystemGlobal.LoadGlobalData();
                        GameConfigSet.Initialize();
                    }
                    else if (parameters["op"].Equals("2"))
                    {
                        //刷新data配置表
                        SystemGlobal.LoadGlobalData();
                        GameConfigSet.Initialize();
                    }
                    else if (parameters["op"].Equals("3"))
                    {
                        //刷新config配置表
                        ConfigCacheGlobal.Load();
                        GameConfigSet.Initialize();
                    }
                }
            }
        }
    public void OnPowerSwitchDown()
    {
        SystemGlobal sg = SystemGlobal.Instance;

        sg.m_DataPanelOn = !sg.m_DataPanelOn;
        if (sg.m_DataPanelOn)
        {
            sg.m_OpRecord.Add("面板开关已打开");
        }
        else
        {
            sg.m_OpRecord.Add("面板开关已关闭");
        }
    }
Beispiel #20
0
    public void OnButtonDownCuCu()
    {
        SystemGlobal sg = SystemGlobal.Instance;

        sg.m_Type = Type;

        sg.m_StartDateTime = System.DateTime.Now;
        sg.m_OpRecord.Add("\t" + sg.m_StartDateTime.ToLongDateString() + "/" + sg.m_StartDateTime.ToLongTimeString() + "\t 进入主界面,实验类型代号:" + Type);

        SceneTransition st = SceneTransition.Instance;

        st.TransTo("MainScene");
        //UnityEngine.SceneManagement.SceneManager.LoadScene("MainScene");
    }
Beispiel #21
0
    void Start()
    {
        // this.tag = "HellElephantButton";
        SystemGlobal sg = SystemGlobal.Instance;


        m_OriginalQuat = transform.rotation;

        m_RotateY   = sg.m_ForceValue;
        m_Text.text = m_RotateY.ToString("F2");
        MeshRenderer mr = GetComponent <MeshRenderer>();

        m_OldMat = mr.material;
    }
Beispiel #22
0
    // Use this for initialization
    void Start () {

        SystemGlobal sg = SystemGlobal.Instance;

        sg.m_FrozeCamera = false;

        Vector3 offset;
        offset.x = 0f;
        offset.y = 0f;
        offset.z = -12.0f;
        this.transform.position = offset;
        this.transform.LookAt(target);

    }
    public void OnSubmit()
    {
        int score = 0;

        for (int i = 0; i < 8; i++)
        {
            GameObject   go      = GameObject.Find("InputField0" + (i + 1));
            Text         t       = go.GetComponentInChildren <Text>();
            InputField   infield = go.GetComponent <InputField>();
            SystemGlobal sg      = SystemGlobal.Instance;

            float vo = 0, va = 0;
            float.TryParse(t.text, out vo);
            va = GetMuValue(i, sg.m_ForceValue, sg.m_Type);

            if (Mathf.Abs(vo - va) > 0.025)
            {
                t.color = Color.red;
            }
            else
            {
                t.color = Color.green;
                score++;
            }
            infield.text = va.ToString("F2");



            go      = GameObject.Find("InputField1" + (i + 1));
            t       = go.GetComponentInChildren <Text>();
            infield = go.GetComponent <InputField>();
            vo      = 0;
            float.TryParse(t.text, out vo);
            va = GetLEDValue(i, sg.m_ForceValue, sg.m_Type);

            if (Mathf.Abs(vo - va) > 0.025)
            {
                t.color = Color.red;
            }
            else
            {
                t.color = Color.green;
                score++;
            }
            infield.text = va.ToString("F2");
        }
        Record(score);
    }
Beispiel #24
0
    // Update is called once per frame
    void Update()
    {
        SystemGlobal sg = SystemGlobal.Instance;

        if (!sg.m_Enable3DInput)
        {
            return;
        }

        bool         mouse = Input.GetMouseButton(0);
        MeshRenderer mr    = GetComponent <MeshRenderer>();

        mr.material = m_OldMat;
        Ray        camRay = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit Hit;

        if (Physics.Raycast(camRay, out Hit))
        {
            if (Hit.collider.name == "LabSim_Model1")
            {
                mr.material = m_HLMat;
                if (mouse == true && m_OldMouse == false)
                {
                    m_Text.text = m_RotateY.ToString();
                    m_Capture   = true;
                }
            }
        }



        if (mouse == false && m_OldMouse == true)
        {
            m_Capture = false;

            sg.m_FrozeCamera = false;
        }

        if (m_Capture == true)
        {
            Rotate();
            sg.m_FrozeCamera = true;
            mr.material      = m_HLMat;
        }


        m_OldMouse = mouse;
    }
Beispiel #25
0
    static private void Init(SystemGlobal sg)
    {
        //int fcount = 24;
        //sg.m_DataPanelPlugPos.Count = fcount;
        //sg.m_DataPanelPlugPos.Initated = new bool[fcount];
        //sg.m_DataPanelPlugPos.Fastener = new int[fcount];
        //for(int i=0;i< fcount; i++)
        //{
        //    sg.m_DataPanelPlugPos.Initated[i] = false;
        //    sg.m_DataPanelPlugPos.Fastener[i] = 0;
        //}
        //sg.m_DataPanelPlugPos.m_OriginalPos = new Vector2[fcount];
        //sg.m_DataPanelPlugPos.m_Offset = new Vector2[fcount];

        sg.m_OpRecord = new List <string>();
    }
Beispiel #26
0
    void FixedUpdate()
    {

        CameraGlobal cg = CameraGlobal.Instance;

        SystemGlobal sg = SystemGlobal.Instance;
        if (sg.m_FrozeCamera == true) return;
        if (!sg.m_Enable3DInput) return;
        bool md = Input.GetMouseButton(0);
        float x=0, y=0;
        if(md==true && m_OldMouseDown==false)
        {
            m_MouseOldY = -Input.mousePosition.y;
            m_MouseOldX = Input.mousePosition.x;
            m_OldRotation = m_Rotation;
            m_OldCameraHeight = m_CameraHeight;
        }
        if (md == true && m_OldMouseDown == true)
        {
            y = -Input.mousePosition.y;
            x = Input.mousePosition.x;
            m_Rotation = m_OldRotation + (x - m_MouseOldX);
            m_CameraHeight = m_OldCameraHeight + (y - m_MouseOldY);
            m_CameraHeight = Mathf.Clamp(m_CameraHeight, 0, 256.0f);


            Quaternion q = Quaternion.Euler(0, m_Rotation, 0);
            Vector3 offset = q * Vector3.forward* cg.m_CameraDist;
            offset += target.position;
            offset *= Mathf.Cos(m_CameraHeight / 256.0f);
            offset.y = cg.m_CameraDist * Mathf.Sin(m_CameraHeight/256.0f);

            this.transform.position = offset;
            this.transform.LookAt(target);

        }
        if (md == false && m_OldMouseDown == true)
        {
            y = Input.mousePosition.y;
            x = Input.mousePosition.x;

        }


        m_OldMouseDown = md;
    }
Beispiel #27
0
        private static bool MulticastToCandidates(byte[] message, int messageLength)
        {
            ushort[] candidates = CandidateTable.GetCandidateNames();

            if (candidates != null)
            {
#if DBG_VERBOSE
                SystemGlobal.PrintNumericVals("Candidate List [for " + _distResetPipe.MACRadioObj.RadioAddress + "] ", candidates);
#endif
            }
            else
            {
                return(false);
            }

#if DBG_VERBOSE
            if (_distResetPipe != null)
            {
                SystemGlobal.PrintNumericVals("Multicast (on MACPipe " + _distResetPipe.PayloadType + "): ", message, messageLength);
            }
            else
            {
                SystemGlobal.PrintNumericVals("Multicast: ", message, messageLength);
            }
#endif
            foreach (var theNeighbor in candidates)
            {
                if (theNeighbor == 0)
                {
                    continue;
                }
                var status = _distResetPipe.Send(theNeighbor, message, 0, (ushort)messageLength);
#if DBG_VERBOSE
                if (status != NetOpStatus.S_Success)
                {
                    Debug.Print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Send status: " + status);
                }

                Debug.Print("\tSent to " + theNeighbor);
#elif DBG_SIMPLE
                Debug.Print("\tSent to " + theNeighbor + ", status: " + status);
#endif
            }
            return(true);
        }
    private void Record(int score)
    {
        SystemGlobal sg = SystemGlobal.Instance;

        System.DateTime Time = System.DateTime.Now;
        sg.m_SubmitDateTime = Time;
        sg.m_OpRecord.Add("\t" + Time.ToLongDateString() + "/" + Time.ToLongTimeString() + "\t 提交数据" + "数据得分:" + score);
        PlugFastenGlobal pg = PlugFastenGlobal.Instance;

        System.TimeSpan span = new System.TimeSpan();
        span = sg.m_SubmitDateTime - sg.m_StartDateTime;

        sg.m_OpRecord.Add("\t" + Time.ToLongDateString() + "/" + Time.ToLongTimeString() + "\t 提交数据" + "用时:" + span.TotalMinutes + "分钟");

        if (pg.m_PlugCorrect)
        {
        }
    }
    public void OnShowJointMap(GameObject go)
    {
        SystemGlobal sg = SystemGlobal.Instance;

        sg.m_DataPanelShowInfo = !sg.m_DataPanelShowInfo;

        //Text t = GetComponentInChildren<Text>();
        //if (m_DataPanelShowInfo)
        //{
        //    t.text = "关闭接线方式";
        //
        //    go.SetActive(true);
        //}
        //else
        //{
        //    t.text = "打开接线方式";
        //
        //    go.SetActive(false);
        //}
    }
Beispiel #30
0
    public void UpdateInfoPanel()
    {
        SystemGlobal sg = SystemGlobal.Instance;



        Text t = m_InfoButton.GetComponentInChildren <Text>();

        if (sg.m_DataPanelShowInfo)
        {
            t.text = "关闭接线方式";

            m_InfoPanel.SetActive(true);
        }
        else
        {
            t.text = "打开接线方式";

            m_InfoPanel.SetActive(false);
        }
    }