예제 #1
0
파일: ACSServer.cs 프로젝트: BdGL3/CXPortal
        public ACSServer(HostComm hostComm, L3.Cargo.Communications.Common.Logger log, string localCaseListPath, out CaseList caseList)
        {
            string uri = (String)ConfigurationManager.AppSettings["ConnectionUri"];
            string AllowedIPList = (String)ConfigurationManager.AppSettings["AllowedIPList"];

            string path = localCaseListPath;
            string caseListSource = (path == null
                                         ? (String)ConfigurationManager.AppSettings["CaseListSource"]
                                         : "File System"
                                    );
            string Alias = (String)ConfigurationManager.AppSettings["ServerName"];
            m_ProfilesFolder = ConfigurationManager.AppSettings["UserProfiles"];                                  

            bool isReference;

            if (ConfigurationManager.AppSettings["ACSMode"].Equals("Archive"))
            {
                isReference = false;
                if (path == null)
                    path = ConfigurationManager.AppSettings["CaseListFileSystemPath"];
            }
            else
            {
                isReference = true;
                if (path == null)
                    path = ConfigurationManager.AppSettings["ReferenceFileSystemPath"];
            }

            if (caseListSource == "File System")
                caseList = new FSCaseList(log, path, isReference);
            else
                caseList = new DBCaseList(log, path, isReference);

            caseList.configFullSync();
            
            base.Subscribe(caseList);
            base.caseList = caseList;

            bool loginRequired = Boolean.Parse(ConfigurationManager.AppSettings["LoginRequired"]);
            acsCommHost = new NetworkHost(this, new Uri(uri), Alias, AllowedIPList, loginRequired);
            acsCommHost.SendTimeoutMin = int.Parse(ConfigurationManager.AppSettings["WcfTcpBindingSendTimeoutMin"]);
            acsCommHost.ReceiveTimeoutMin = int.Parse(ConfigurationManager.AppSettings["WcfTcpBindingReceiveTimeoutMin"]);

            EnableArchiveDecision = Boolean.Parse(ConfigurationManager.AppSettings["EnableArchiveDecision"]);

            caseList.List.CaseListTable.CaseListTableRowChanged += new CaseListDataSet.CaseListTableRowChangeEventHandler(CaseListTable_RowChanged);
            caseList.List.CaseListTable.CaseListTableRowDeleting += new CaseListDataSet.CaseListTableRowChangeEventHandler(CaseListTable_RowChanged);

            m_HostComm = hostComm;
            m_HostComm.ConnectedToHostEvent += new HostComm.ConnectedToHostHandler(hostComm_ConnectedToHostEvent);            

            m_WSCallbacks = new Dictionary<String, ICaseRequestManagerCallback>();
            m_WSLastPing = new Dictionary<String, DateTime>();

            ClientConnThread = new Thread(new ThreadStart(ClientConnState));
        }
예제 #2
0
        public static L3.Cargo.Common.ProfileObject Translate (L3.Cargo.Common.Xml.Profile_1_0.Profile commProfile, int capacity)
        {
            L3.Cargo.Common.ProfileObject profile = new L3.Cargo.Common.ProfileObject(capacity);

            try
            {
                if (commProfile != null)
                {
                    if (commProfile.Macro != null)
                    {
                        foreach (L3.Cargo.Common.Xml.Profile_1_0.ProfileMacro commMacro in commProfile.Macro)
                        {
                            L3.Cargo.Common.Macro macro = new L3.Cargo.Common.Macro(commMacro.id);

                            macro.Buffer.name = commMacro.Buffer.parameter;

                            macro.PseudoColor.name = commMacro.PseudoColor.parameter;

                            L3.Cargo.Common.Xml.History_1_0.HistoryHistogram histogram = new L3.Cargo.Common.Xml.History_1_0.HistoryHistogram();
                            histogram.effecttype = commMacro.Histogram.effectType;
                            histogram.start = commMacro.Histogram.start;
                            histogram.end = commMacro.Histogram.end;
                            macro.Histogram = histogram;

                            foreach (L3.Cargo.Common.Xml.Profile_1_0.ProfileMacroFilter filter in commMacro.Filters)
                            {
                                L3.Cargo.Common.Xml.History_1_0.HistoryFilter filterHistory = new L3.Cargo.Common.Xml.History_1_0.HistoryFilter();
                                filterHistory.name = filter.id;
                                filterHistory.parameter = filter.parameter;

                                macro.Filter.Add(filterHistory);
                            }

                            profile.UserMacros.Add(macro);
                        }
                    }
                    if (commProfile.DensityAlarm != null)
                    {
                        profile.DensityAlarmValue = commProfile.DensityAlarm.value;
                    }
                }

            }
            catch (Exception ex)
            {
                //TODO: Log exception here
            }

            return profile;
        }
예제 #3
0
        /// <summary>
        /// 创建treeview
        /// </summary>
        /// <param name="datasetALL">整表信息</param>
        private void FreshTree(DataSet datasetALL)
        {
            Tree_Factor.Nodes.Clear();
            int j = 0;

            foreach (DataRow dr in datasetALL.Tables[0].Rows)
            {
                //string ii= datasetALL.Tables[0].Rows[j]["Selected"].ToString();
                //if (datasetALL.Tables[0].Rows[j]["Selected"].ToString() == "True")
                //{}
                TreeNode tn = Tree_Factor.Nodes.Add(datasetALL.Tables[0].Rows[j]["EquipName"].ToString());

                string L1, L2, L3;

                TreeNode tn1 = new TreeNode("直采数据");
                tn.Nodes.Add(tn1);
                L1 = datasetALL.Tables[0].Rows[j]["L1"].ToString();
                string[] L1D = L1.Split(';');
                for (int i = 0; i < L1D.Count() - 1; i++)
                {
                    TreeNode tn12 = new TreeNode(L1D[i]);
                    tn1.Nodes.Add(tn12);
                }

                TreeNode tn2 = new TreeNode("操作数据");
                tn.Nodes.Add(tn2);
                L2 = datasetALL.Tables[0].Rows[j]["L2"].ToString();
                string[] L2D = L2.Split(';');
                for (int i = 0; i < L2D.Count() - 1; i++)
                {
                    TreeNode tn22 = new TreeNode(L2D[i]);
                    tn2.Nodes.Add(tn22);
                }

                TreeNode tn3 = new TreeNode("调度数据");
                tn.Nodes.Add(tn3);
                L3 = datasetALL.Tables[0].Rows[j]["L3"].ToString();
                string[] L3D = L3.Split(';');
                for (int i = 0; i < L3D.Count() - 1; i++)
                {
                    TreeNode tn32 = new TreeNode(L3D[i]);
                    tn3.Nodes.Add(tn32);
                }


                j++;
            }
        }
예제 #4
0
        private void lbox_UsedAlg_SelectedIndexChanged(object sender, EventArgs e)
        {
            //lbox_UsedAlg.Items.Clear();
            lbox_Factor.Items.Clear();
            lbox_UsedFact.Items.Clear();

            string L1, L2, L3;

            dataset.Clear();
            dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L1", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
            L1      = dataset.Tables[0].Rows[0][0].ToString();
            string[] L1D = L1.Split(';');
            for (int i = 0; i < L1D.Count() - 1; i++)
            {
                lbox_Factor.Items.Add(L1D[i]);
            }

            dataset.Clear();
            dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L2", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
            L2      = dataset.Tables[0].Rows[0][0].ToString();
            string[] L2D = L2.Split(';');
            for (int i = 0; i < L2D.Count() - 1; i++)
            {
                lbox_Factor.Items.Add(L2D[i]);
            }

            dataset.Clear();
            dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L3", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
            L3      = dataset.Tables[0].Rows[0][0].ToString();
            string[] L3D = L3.Split(';');
            for (int i = 0; i < L3D.Count() - 1; i++)
            {
                lbox_Factor.Items.Add(L3D[i]);
            }

            /*
             * string Factor;
             * dataset.Clear();
             * dataset = ServiceContainer.GetService<IGasDAL>().QueryData("Factor", "EquipAlgSlet", "EquipName", cbox_Eq.Text, "AlgName", lbox_UsedAlg.SelectedItem.ToString());
             * Factor = dataset.Tables[0].Rows[0][0].ToString();
             * string[] FactorD = Factor.Split(';');
             * for (int i = 0; i < FactorD.Count() - 1; i++)
             * {
             *  lbox_UsedFact.Items.Add(FactorD[i]);
             * }
             */
        }
예제 #5
0
        public void Update(GameTime gameTime)
        {
            if (!start)
            {
                L1.Update();
                L2.Update();
                L3.Update();
            }

            if (!start && Keyboard.GetState().IsKeyDown(Keys.Enter))
            {
                start = true;
            }

            if (hasLost)
            {
                start = false;

                if (Keyboard.GetState().IsKeyDown(Keys.Enter))
                {
                    hasLost       = false;
                    Player.energy = 3;
                    CreateLevel();
                }
            }

            if (!songstart && start && !hasLost)
            {
                MediaPlayer.Play(brinstar);
                songstart = true;
            }
            foreach (SuperClass g in gameObjs)
            {
                if (g != null)
                {
                    g.Update(gameTime);
                }
            }
            foreach (Bubble bub in gameObjList.OfType <Bubble>())
            {
                bub.Update(gameTime);
                if (!bub.IsActive)
                {
                    break;
                }
            }
        }
예제 #6
0
        public int CreatEquipTab()
        {
            DataSet dataset = new DataSet();


            dataset = dataControl.QueryData("EquipTypeSlet", "Selected", "1");
            int j = 0;

            foreach (DataRow dr in dataset.Tables[0].Rows)
            {
                for (int i = 0; i < int.Parse(dataset.Tables[0].Rows[j]["EquipNum"].ToString()); i++)
                {
                    tabControl.CreatEquipTabPart1(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString());
                    string L1, L2, L3;

                    L1 = dataset.Tables[0].Rows[j]["L1"].ToString();
                    string[] L1D = L1.Split(';');

                    for (int k = 0; k < L1D.Count() - 1; k++)
                    {
                        tabControl.AddTableColum(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString() + "_L1", L1D[k]);
                    }

                    L2 = dataset.Tables[0].Rows[j]["L2"].ToString();
                    string[] L2D = L2.Split(';');

                    for (int k = 0; k < L2D.Count() - 1; k++)
                    {
                        tabControl.AddTableColum(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString() + "_L2", L2D[k]);
                    }

                    L3 = dataset.Tables[0].Rows[j]["L3"].ToString();
                    string[] L3D = L3.Split(';');

                    for (int k = 0; k < L3D.Count() - 1; k++)
                    {
                        tabControl.AddTableColum(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString() + "_L3", L3D[k]);
                    }
                }
                j++;
            }



            return(0);
        }
예제 #7
0
        private void btn_Read_Click(object sender, EventArgs e)
        {
            if (lbox_Equip.SelectedItems.Count != 0)
            {
                string L1, L2, L3;

                dataset.Clear();
                dataset         = ServiceContainer.GetService <IGasDAL>().QueryData("EquipNum", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                txtbox_Num.Text = dataset.Tables[0].Rows[0][0].ToString();

                dataset.Clear();
                dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L1", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                L1      = dataset.Tables[0].Rows[0][0].ToString();
                string[] L1D = L1.Split(';');
                dgv_L1.Rows.Clear();
                for (int i = 0; i < L1D.Count() - 1; i++)
                {
                    dgv_L1.Rows.Add(L1D[i]);
                }

                dataset.Clear();
                dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L2", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                L2      = dataset.Tables[0].Rows[0][0].ToString();
                string[] L2D = L2.Split(';');
                dgv_L2.Rows.Clear();
                for (int i = 0; i < L2D.Count() - 1; i++)
                {
                    dgv_L2.Rows.Add(L2D[i]);
                }

                dataset.Clear();
                dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L3", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                L3      = dataset.Tables[0].Rows[0][0].ToString();
                string[] L3D = L3.Split(';');
                dgv_L3.Rows.Clear();
                for (int i = 0; i < L3D.Count() - 1; i++)
                {
                    dgv_L3.Rows.Add(L3D[i]);
                }
            }
            else
            {
                MessageBox.Show("选择设备");
            }
        }
예제 #8
0
        public ControllerPS3(params int[] joystickId)
        {
            AddButton(Controls.Triangle);
            AddButton(Controls.Circle);
            AddButton(Controls.Cross);
            AddButton(Controls.Square);
            AddButton(Controls.R1);
            AddButton(Controls.L1);
            AddButton(Controls.L3);
            AddButton(Controls.R3);
            AddButton(Controls.Start);
            AddButton(Controls.Select);
            AddButton(Controls.R2);
            AddButton(Controls.L2);

            AddAxis(Controls.LStick);
            AddAxis(Controls.RStick);
            AddAxis(Controls.DPad);

            foreach (var joy in joystickId)
            {
                Triangle.AddJoyButton(0, joy);
                Circle.AddJoyButton(1, joy);
                Cross.AddJoyButton(2, joy);
                Square.AddJoyButton(3, joy);
                L2.AddJoyButton(4, joy);
                R2.AddJoyButton(5, joy);
                L1.AddJoyButton(6, joy);
                R1.AddJoyButton(7, joy);
                Select.AddJoyButton(8, joy);
                Start.AddJoyButton(9, joy);
                L3.AddJoyButton(10, joy);
                R3.AddJoyButton(11, joy);

                R2.AddAxisButton(AxisButton.ZMinus, joy);
                L2.AddAxisButton(AxisButton.ZPlus, joy);

                LeftStick.AddJoyAxis(JoyAxis.X, JoyAxis.Y, joy);
                RightStick.AddJoyAxis(JoyAxis.U, JoyAxis.R, joy);
                DPad.AddJoyAxis(JoyAxis.PovX, JoyAxis.PovY, joy);
            }
        }
예제 #9
0
    // Update is called once per frame
    void Update()
    {
        countFrames++;
        //lava raises and stays for this long
        if (countFrames >= 1725 && countFrames <= 2150 && hasRaised == false)
        {
            if (countFrames % 10 == 0)
            {
                L1.SetActive(true);
                L2.SetActive(true);
                L3.SetActive(true);
                L4.SetActive(true);
                text.SetActive(true);
            }
            if (countFrames % 30 == 0)
            {
                L1.SetActive(false);
                L2.SetActive(false);
                L3.SetActive(false);
                L4.SetActive(false);
                text.SetActive(false);
            }
        }
        if (countFrames == 2150 && hasRaised == false)
        {
            countFrames = 0;
            L1.SetActive(false);
            L2.SetActive(false);
            L3.SetActive(false);
            L4.SetActive(false);
            text.SetActive(false);
            hasRaised = true;
        }

        //Keeps it lined up with the lava
        if (countFrames == 450 && hasRaised == true)
        {
            countFrames = 0;
            hasRaised   = false;
        }
    }
예제 #10
0
        private void button8_Click(object sender, EventArgs e)
        {
            double CGCSa = 6378137.0, CGCSf = 1 / 298.257222101;
            double CGCSb = CGCSa * (1 - CGCSf);
            double CGCSe = Math.Sqrt(CGCSa * CGCSa - CGCSb * CGCSb) / CGCSa;
            double CGCSe1 = Math.Sqrt(CGCSa * CGCSa - CGCSb * CGCSb) / CGCSb;
            double B, L, H, X, Y, Z;

            X = double.Parse(textBox10.Text);
            Y = double.Parse(textBox11.Text);
            Z = double.Parse(textBox12.Text);
            double CGCSu = Math.Atan((CGCSa * Z) / (CGCSb * Math.Sqrt(X * X + Y * Y)));

            B = Math.Atan((Z + CGCSe1 * CGCSe1 * CGCSb * Math.Pow(Math.Sin(CGCSu), 3)) / (Math.Sqrt(X * X + Y * Y) - CGCSe * CGCSe * CGCSa * Math.Pow(Math.Cos(CGCSu), 3)));
            L = Math.Atan2(Y, X);
            double WGSw = Math.Sqrt(1 - Math.Pow(CGCSe * Math.Sin(B), 2));
            double WGSn = CGCSa / WGSw;

            H = Math.Sqrt(X * X + Y * Y) / Math.Cos(B) - WGSn;
            B = B * 180 / Math.PI;
            L = L * 180 / Math.PI;
            double B1, B2, B3;

            B1 = Math.Truncate(B);
            B2 = Math.Truncate((B - B1) * 60);
            B3 = ((B - B1) * 60 - B2) * 60;
            string strB = B1.ToString() + '.' + B2.ToString() + B3.ToString("f6");
            double L1, L2, L3;

            L1 = Math.Truncate(L);
            L2 = Math.Truncate((L - L1) * 60);
            L3 = ((L - L1) * 60 - L2) * 60;
            string strL = L1.ToString() + '.' + L2.ToString() + L3.ToString("f6");

            textBox4.Text = strB;
            textBox5.Text = strL;
            textBox6.Text = H.ToString("f4");
        }
예제 #11
0
        private void button6_Click(object sender, EventArgs e)
        {
            double WGSa = 6378137.0, WGSb = 6356752.3;
            double WGSe = Math.Sqrt(WGSa * WGSa - WGSb * WGSb) / WGSa;
            double WGSe1 = Math.Sqrt(WGSa * WGSa - WGSb * WGSb) / WGSb;
            double B, L, H, X, Y, Z;

            X = double.Parse(textBox7.Text);
            Y = double.Parse(textBox8.Text);
            Z = double.Parse(textBox9.Text);
            double WGSu = Math.Atan((WGSa * Z) / (WGSb * Math.Sqrt(X * X + Y * Y)));

            B = Math.Atan((Z + WGSe1 * WGSe1 * WGSb * Math.Pow(Math.Sin(WGSu), 3)) / (Math.Sqrt(X * X + Y * Y) - WGSe * WGSe * WGSa * Math.Pow(Math.Cos(WGSu), 3)));
            L = Math.Atan2(Y, X);
            double WGSw = Math.Sqrt(1 - Math.Pow(WGSe * Math.Sin(B), 2));
            double WGSn = WGSa / WGSw;

            H = Math.Sqrt(X * X + Y * Y) / Math.Cos(B) - WGSn;
            B = B * 180 / Math.PI;
            L = L * 180 / Math.PI;
            double B1, B2, B3;

            B1 = Math.Truncate(B);
            B2 = Math.Truncate((B - B1) * 60);
            B3 = ((B - B1) * 60 - B2) * 60;
            string strB = B1.ToString() + '.' + B2.ToString() + B3.ToString("f6");
            double L1, L2, L3;

            L1 = Math.Truncate(L);
            L2 = Math.Truncate((L - L1) * 60);
            L3 = ((L - L1) * 60 - L2) * 60;
            string strL = L1.ToString() + '.' + L2.ToString() + L3.ToString("f6");

            textBox1.Text = strB;
            textBox2.Text = strL;
            textBox3.Text = H.ToString("f4");
        }
예제 #12
0
        private void frm_PSC_CG_Load(object sender, EventArgs e)
        {
            dgv.Rows.Clear();

            dgv.Rows.Add("Distance (m)",
                         L1.ToString("f3"),
                         L2.ToString("f3"),
                         L3.ToString("f3"),
                         L4.ToString("f3"),
                         L5.ToString("f3"),
                         L6.ToString("f3"),
                         L7.ToString("f3"),
                         L8.ToString("f3"),
                         L9.ToString("f3"));

            dgv.Rows.Add("Cable 'e' (mm)",
                         Cable_E.F1.ToString("f3"),
                         Cable_E.F2.ToString("f3"),
                         Cable_E.F3.ToString("f3"),
                         Cable_E.F4.ToString("f3"),
                         Cable_E.F5.ToString("f3"),
                         Cable_E.F6.ToString("f3"),
                         Cable_E.F7.ToString("f3"),
                         Cable_E.F8.ToString("f3"),
                         Cable_E.F9.ToString("f3"));
            dgv.Rows.Add("Cable 'd' (mm)",
                         Cable_D.F1.ToString("f3"),
                         Cable_D.F2.ToString("f3"),
                         Cable_D.F3.ToString("f3"),
                         Cable_D.F4.ToString("f3"),
                         Cable_D.F5.ToString("f3"),
                         Cable_D.F6.ToString("f3"),
                         Cable_D.F7.ToString("f3"),
                         Cable_D.F8.ToString("f3"),
                         Cable_D.F9.ToString("f3"));
            dgv.Rows.Add("Cable 'c' (mm)",
                         Cable_C.F1.ToString("f3"),
                         Cable_C.F2.ToString("f3"),
                         Cable_C.F3.ToString("f3"),
                         Cable_C.F4.ToString("f3"),
                         Cable_C.F5.ToString("f3"),
                         Cable_C.F6.ToString("f3"),
                         Cable_C.F7.ToString("f3"),
                         Cable_C.F8.ToString("f3"),
                         Cable_C.F9.ToString("f3"));


            dgv.Rows.Add("Cable 'b' (mm)",
                         Cable_B.F1.ToString("f3"),
                         Cable_B.F2.ToString("f3"),
                         Cable_B.F3.ToString("f3"),
                         Cable_B.F4.ToString("f3"),
                         Cable_B.F5.ToString("f3"),
                         Cable_B.F6.ToString("f3"),
                         Cable_B.F7.ToString("f3"),
                         Cable_B.F8.ToString("f3"),
                         Cable_B.F9.ToString("f3"));
            dgv.Rows.Add("Cable 'a' (mm)",
                         Cable_A.F1.ToString("f3"),
                         Cable_A.F2.ToString("f3"),
                         Cable_A.F3.ToString("f3"),
                         Cable_A.F4.ToString("f3"),
                         Cable_A.F5.ToString("f3"),
                         Cable_A.F6.ToString("f3"),
                         Cable_A.F7.ToString("f3"),
                         Cable_A.F8.ToString("f3"),
                         Cable_A.F9.ToString("f3"));

            //Average
            Cable_CG = ((Cable_A + Cable_B + Cable_C + Cable_D + Cable_E) / 5.0);


            dgv.Rows.Add("CG",
                         Cable_CG.F1.ToString("f3"),
                         Cable_CG.F2.ToString("f3"),
                         Cable_CG.F3.ToString("f3"),
                         Cable_CG.F4.ToString("f3"),
                         Cable_CG.F5.ToString("f3"),
                         Cable_CG.F6.ToString("f3"),
                         Cable_CG.F7.ToString("f3"),
                         Cable_CG.F8.ToString("f3"),
                         Cable_CG.F9.ToString("f3"));


            dgv.Rows[0].ReadOnly = true;
            dgv.Rows[0].Frozen   = true;
            dgv.Rows[0].DefaultCellStyle.ForeColor = Color.Blue;

            dgv.Rows[6].ReadOnly = true;
            dgv.Rows[6].Frozen   = true;
            dgv.Rows[6].DefaultCellStyle.ForeColor = Color.Blue;
        }
예제 #13
0
 public override void Update()
 {
     Total = L1.GetComponent <Levier>().ValeurL1 + L2.GetComponent <Levier>().ValeurL2 + L3.GetComponent <Levier>().ValeurL3 + L4.GetComponent <Levier>().ValeurL4;
     print("Valeur Solution: " + Solution);
     print("Valeur Levier: " + Total);
     if (CanOpen)
     {
         if (maxOpen < 180 && maxOpen > 0)
         {
             if (transform.localEulerAngles.y < maxOpen)
             {
                 transform.Rotate(new Vector3(0, 100, 0) * Time.deltaTime);
             }
             else
             {
                 base.Declencher_Etape_Suivante_Du_Scenario();
             }
         }
         if (maxOpen >= 180)
         {
             if (transform.localEulerAngles.y <= 45 && transform.localEulerAngles.y > 0 || transform.localEulerAngles.y > maxOpen)
             {
                 transform.Rotate(new Vector3(0, -100, 0) * Time.deltaTime);
             }
             else
             {
                 base.Declencher_Etape_Suivante_Du_Scenario();
             }
         }
     }
 }
예제 #14
0
        //public async Task<ActionResult<oneStock>> company([FromBody] searchStock searchCondition)
        //List<oneDayHoldingCount>
        public async Task <ActionResult <oneStock> > company([FromBody] searchStock searchCondition)
        //public IEnumerable<WeatherForecast> comapny()
        {
            //var result = new ResultModel();

            //result.Data= uContext.Companydata.Where(x=>x.Id<10);
            int      period   = 0;
            oneStock findData = null;

            if (searchCondition.stockNum == null)
            {
                findData           = new oneStock();
                findData.whichpage = -1;
                return(findData);
            }
            if (searchCondition.periodWeek > 0 && searchCondition.periodWeek <= 20)
            {
                period = searchCondition.periodWeek;
            }
            else
            {
                findData           = new oneStock();
                findData.whichpage = -1;
                return(findData);
            }
            string stockNumForStr = searchCondition.stockNum.ToString().PadLeft(5, '0');
            //todayStockRecord.AllStock.Exists();
            //oneStock existsOrNot=null;
            oneStock L3 = null;

            //L3.allCompanyHoldingCount=new List<oneCompanyAllDayHolding>{};
            for (int a = 0; a < todayStockRecord.AllStock.Count(); a++)
            {
                if (todayStockRecord.AllStock[a].periodWeek == searchCondition.periodWeek && todayStockRecord.AllStock[a].stockID == stockNumForStr)
                {
                    L3 = todayStockRecord.AllStock[a];
                    break;
                }
            }
            if (L3 == null)
            {
                var readidAndName = await uContext.Stockcompany.Where(x => x.SNo.Equals(stockNumForStr)).Select(x => new { x.Id, x.SName, x.SNo }).FirstOrDefaultAsync();

                if (readidAndName == null)
                {
                    findData           = new oneStock();
                    findData.whichpage = -1;
                    return(findData);
                }

                //short testNum=1543;
                DateTime beforeWeek = DateTime.Today.AddDays(-(searchCondition.periodWeek * 5));
                //var result= uContext.Companydata.Where(x=>x.Id>2240&&x.Id<2340).Select(commmm=>commmm.Id);

                List <middleOutput> holdingdata2 = await uContext.Holdingdaily
                                                   //.Where(x=>x.Keepdata.Date>beforeWeek && x.Stockid==readidAndName.Id)
                                                   .Where(x => x.Keepdata > beforeWeek && x.Stockid == readidAndName.Id)
                                                   .OrderBy(x => x.Keepdata)
                                                   .OrderBy(x => x.Companyid)
                                                   .Join(uContext.Companydata, x => x.Companyid, y => y.Id,
                                                         (x, y) =>
                                                         new middleOutput()
                {
                    keepdata     = x.Keepdata,
                    companyid    = y.Id,
                    holdingcount = x.Holdingcount ?? 0,
                    companyname  = y.Companyname,
                    govcompanyid = y.Govcompanyid,
                    stockid      = stockNumForStr
                })

                                                   .ToListAsync();

                if (holdingdata2.Count() == 0 || holdingdata2 == null)
                {
                    findData           = new oneStock();
                    findData.whichpage = -1;
                    return(findData);
                }

                //
                //oneStock     L3
                //oneCompanyAllDayHolding      L2
                //oneDayHoldingCount      L1

                oneDayHoldingCount      L1 = new oneDayHoldingCount();
                oneCompanyAllDayHolding L2 = new oneCompanyAllDayHolding();
                L2.allDayHoldingCount = new List <oneDayHoldingCount> {
                };
                //oneStock L3=new oneStock();
                L3 = new oneStock();
                L3.allCompanyHoldingCount = new List <oneCompanyAllDayHolding> {
                };

                //List<oneDayHoldingCount> oneCompanyHold=new List<oneDayHoldingCount>{};
                //oneDayHoldingCount ODHC =new oneDayHoldingCount();

                var     tempcompanyid    = holdingdata2[0].companyid;
                var     tempcompanyname  = holdingdata2[0].companyname;
                decimal tempSumDiffCount = 0;
                int     innerLoop        = 0;

                Boolean  newCompany = true;
                oneStock sample     = new oneStock();
                for (int i = 0; i < holdingdata2.Count; i++)
                {
                    if (newCompany)
                    {
                        tempcompanyname  = holdingdata2[i].companyname;
                        tempcompanyid    = holdingdata2[i].companyid;
                        tempSumDiffCount = 0;
                        innerLoop        = 1;


                        L1                    = new oneDayHoldingCount();
                        L1.holdingDate        = holdingdata2[i].keepdata;
                        L1.holdingCount       = holdingdata2[i].holdingcount;
                        L1.holdingDiff        = 0;
                        L2                    = new oneCompanyAllDayHolding();
                        L2.allDayHoldingCount = new List <oneDayHoldingCount> {
                        };
                        L2.companyid          = holdingdata2[i].govcompanyid;
                        L2.companyname        = holdingdata2[i].companyname;
                        L2.allDayHoldingCount.Add(L1);

                        newCompany = false;
                        continue;
                    }
                    else
                    {
                        if (tempcompanyid != holdingdata2[i].companyid)
                        {
                            L2.allDayDiff = tempSumDiffCount;
                            L3.allCompanyHoldingCount.Add(L2);
                            newCompany = true;
                            i--;

                            continue;
                        }
                        else
                        {
                            L1                = new oneDayHoldingCount();
                            L1.holdingDate    = holdingdata2[i].keepdata;
                            L1.holdingCount   = holdingdata2[i].holdingcount;
                            L1.holdingDiff    = L1.holdingCount - L2.allDayHoldingCount[innerLoop - 1].holdingCount;
                            tempSumDiffCount += System.Math.Abs(L1.holdingDiff);
                            L2.allDayHoldingCount.Add(L1);
                            innerLoop++;
                        }
                    }
                }
                L3.allCompanyHoldingCount.Sort();

                L3.whichpage  = 0;
                L3.periodWeek = searchCondition.periodWeek;
                L3.stockID    = readidAndName.SNo;
                L3.stockName  = readidAndName.SName;
                if (todayStockRecord.AllStock.Count() < 100)
                {
                    todayStockRecord.AllStock.Add(L3);
                }
            }
            int temppage = L3.allCompanyHoldingCount.Count() - searchCondition.whichPage * 5;

            L3.whichpage = searchCondition.whichPage;
            var newL3 = new oneStock();

            newL3 = (oneStock)L3.Clone();
            if (temppage >= 5)
            //L3.allCompanyHoldingCount=L3.allCompanyHoldingCount.GetRange(searchCondition.whichPage*5,5);
            {
                newL3.allCompanyHoldingCount = L3.allCompanyHoldingCount.GetRange(searchCondition.whichPage * 5, 5);
                newL3.endOrNot = 0;
            }
            else if (temppage < 5 && temppage > 0)
            {
                newL3.allCompanyHoldingCount = L3.allCompanyHoldingCount.GetRange(searchCondition.whichPage * 5, temppage);
                newL3.endOrNot = 1;
            }
            else
            {
                newL3.allCompanyHoldingCount = L3.allCompanyHoldingCount.GetRange(0, 0);
                newL3.endOrNot = 1;
            }


            return(newL3);
            //return newL3;
        }
예제 #15
0
파일: Form32.cs 프로젝트: Minteger/gts3v4
        public void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                Hpl = Convert.ToDouble(textBox1.Text.Replace('.', ','));
                H1  = Convert.ToDouble(textBox2.Text.Replace('.', ','));
                h0  = Convert.ToDouble(textBox4.Text.Replace('.', ','));
                d0  = Convert.ToDouble(textBox3.Text.Replace('.', ','));

                b   = Convert.ToDouble(textBox8.Text.Replace('.', ','));
                m1  = Convert.ToDouble(textBox7.Text.Replace('.', ','));
                m2  = Convert.ToDouble(textBox6.Text.Replace('.', ','));
                Kt  = Convert.ToDouble(textBox5.Text.Replace('.', ','));
                Ke  = Convert.ToDouble(textBox41.Text.Replace('.', ','));
                tzv = Convert.ToDouble(textBox44.Text.Replace('.', ','));
                tzn = Convert.ToDouble(textBox43.Text.Replace('.', ','));

                E = Convert.ToDouble(textBox9.Text.Replace('.', ','));

                delta_v = Convert.ToDouble(textBox39.Text.Replace('.', ','));
                delta_n = Convert.ToDouble(textBox40.Text.Replace('.', ','));
            }
            catch
            {
                MessageBox.Show("Введите корректные данные");
            }


            delta_sr = (delta_n + delta_v) / 2;
            tzsr     = (tzn + tzv) / 2;
            teta     = Math.Atan(m1);
            n        = Kt / Ke;
            z0       = delta_sr * Math.Cos(teta);



            h2isk = 0;
            do
            {
                h2isk += 0.001f;
                Lisk   = (Hpl - h2isk) * m1 + b + m2 * Hpl - (delta_sr + tzsr) / Math.Sin(teta);
                h1isk  = Lisk / m2 - Math.Sqrt(Math.Pow(Lisk, 2) / Math.Pow(m2, 2) - Math.Pow(h2isk - h0, 2)) + h0;
                F1     = (Math.Pow(h2isk, 2) - Math.Pow(h1isk, 2)) / (2 * (Lisk - m2 * h1isk));
                F2     = (Math.Pow(H1, 2) - Math.Pow(h2isk, 2) - Math.Pow(z0, 2)) / (2 * delta_sr * n * Math.Sin(teta));
            }while (F1 < F2);   //находим h2 при пересечении функций



            h23 = 1.3f * h2isk;
            h22 = h2isk;
            h21 = 0.7f * h2isk;

            L1 = (Hpl - h21) * m1 + b + m2 * Hpl - (delta_sr + tzsr) / Math.Sin(teta);
            L2 = (Hpl - h22) * m1 + b + m2 * Hpl - (delta_sr + tzsr) / Math.Sin(teta);
            L3 = (Hpl - h23) * m1 + b + m2 * Hpl - (delta_sr + tzsr) / Math.Sin(teta);

            h11 = L1 / m2 - Math.Sqrt(Math.Pow(L1, 2) / Math.Pow(m2, 2) - Math.Pow(h21 - h0, 2)) + h0;
            h12 = L2 / m2 - Math.Sqrt(Math.Pow(L2, 2) / Math.Pow(m2, 2) - Math.Pow(h22 - h0, 2)) + h0;
            h13 = L3 / m2 - Math.Sqrt(Math.Pow(L3, 2) / Math.Pow(m2, 2) - Math.Pow(h23 - h0, 2)) + h0;

            F11 = (Math.Pow(h21, 2) - Math.Pow(h11, 2)) / (2 * (L1 - m2 * h11));
            F12 = (Math.Pow(h22, 2) - Math.Pow(h12, 2)) / (2 * (L2 - m2 * h12));
            F13 = (Math.Pow(h23, 2) - Math.Pow(h13, 2)) / (2 * (L3 - m2 * h13));

            F21 = (Math.Pow(H1, 2) - Math.Pow(h21, 2) - Math.Pow(z0, 2)) / (2 * delta_sr * n * Math.Sin(teta));
            F22 = (Math.Pow(H1, 2) - Math.Pow(h22, 2) - Math.Pow(z0, 2)) / (2 * delta_sr * n * Math.Sin(teta));
            F23 = (Math.Pow(H1, 2) - Math.Pow(h23, 2) - Math.Pow(z0, 2)) / (2 * delta_sr * n * Math.Sin(teta));    //данные для таблицы



            qt = (Kt * (Math.Pow(h2isk, 2) - Math.Pow(h1isk, 2))) / (2 * (Lisk - m2 * h1isk));
            H  = H1 - h0;


            x1 = 0;
            x6 = Lisk - m2 * h1isk;
            x2 = x1 + (x6 - x1) / 5;
            x3 = x2 + (x6 - x1) / 5;
            x4 = x3 + (x6 - x1) / 5;
            x5 = x4 + (x6 - x1) / 5;



            r1 = Math.Round((2 * qt * x1) / Kt, 2);
            r2 = Math.Round((2 * qt * x2) / Kt, 2);
            r3 = Math.Round((2 * qt * x3) / Kt, 2);
            r4 = Math.Round((2 * qt * x4) / Kt, 2);
            r5 = Math.Round((2 * qt * x5) / Kt, 2);
            r6 = Math.Round((2 * qt * x6) / Kt, 2);


            yq1 = Math.Pow(h2isk, 2) - (2 * qt / Kt) * x1;
            yq2 = Math.Pow(h2isk, 2) - (2 * qt / Kt) * x2;
            yq3 = Math.Pow(h2isk, 2) - (2 * qt / Kt) * x3;
            yq4 = Math.Pow(h2isk, 2) - (2 * qt / Kt) * x4;
            yq5 = Math.Pow(h2isk, 2) - (2 * qt / Kt) * x5;
            yq6 = Math.Pow(h2isk, 2) - (2 * qt / Kt) * x6;

            x1 = Math.Round(x1, 2);
            x2 = Math.Round(x2, 2);
            x3 = Math.Round(x3, 2);
            x4 = Math.Round(x4, 2);
            x5 = Math.Round(x5, 2);
            x6 = Math.Round(x6, 2);


            y1 = Math.Round(Math.Sqrt(yq1), 2);
            y2 = Math.Round(Math.Sqrt(yq2), 2);
            y3 = Math.Round(Math.Sqrt(yq3), 2);
            y4 = Math.Round(Math.Sqrt(yq4), 2);
            y5 = Math.Round(Math.Sqrt(yq5), 2);
            y6 = Math.Round(Math.Sqrt(yq6), 2);

            yq1 = Math.Round(yq1, 2);
            yq2 = Math.Round(yq2, 2);
            yq3 = Math.Round(yq3, 2);
            yq4 = Math.Round(yq4, 2);
            yq5 = Math.Round(yq5, 2);
            yq6 = Math.Round(yq6, 2);


            h2isk    = Math.Round(h2isk, 2);
            h1isk    = Math.Round(h1isk, 2);
            Lisk     = Math.Round(Lisk, 2);
            qt       = Math.Round(qt, 5);
            tzsr     = Math.Round(tzsr, 2);
            delta_sr = Math.Round(delta_sr, 2);

            h21 = Math.Round(h21, 2);
            h22 = Math.Round(h22, 2);
            h23 = Math.Round(h23, 2);

            L1 = Math.Round(L1, 2);
            L2 = Math.Round(L2, 2);
            L3 = Math.Round(L3, 2);

            h11 = Math.Round(h11, 2);
            h12 = Math.Round(h12, 2);
            h13 = Math.Round(h12, 2);

            F11 = Math.Round(F11, 2);
            F12 = Math.Round(F12, 2);
            F13 = Math.Round(F13, 2);

            F21 = Math.Round(F21, 2);
            F22 = Math.Round(F22, 2);
            F23 = Math.Round(F23, 2);


            textBox47.Text = h21.ToString();
            textBox48.Text = h22.ToString();
            textBox49.Text = h23.ToString();

            textBox52.Text = L1.ToString();
            textBox51.Text = L2.ToString();
            textBox50.Text = L3.ToString();

            textBox55.Text = h11.ToString();
            textBox54.Text = h12.ToString();
            textBox53.Text = h13.ToString();

            textBox58.Text = F11.ToString();
            textBox57.Text = F12.ToString();
            textBox56.Text = F13.ToString();

            textBox61.Text = F21.ToString();
            textBox60.Text = F22.ToString();
            textBox59.Text = F23.ToString();



            textBox34.Text = h1isk.ToString();
            textBox45.Text = h2isk.ToString();
            textBox35.Text = Lisk.ToString();
            textBox36.Text = qt.ToString();
            textBox42.Text = delta_sr.ToString();
            textBox46.Text = tzsr.ToString();

            textBox10.Text = x1.ToString();
            textBox11.Text = x2.ToString();
            textBox12.Text = x3.ToString();
            textBox13.Text = x4.ToString();
            textBox14.Text = x5.ToString();
            textBox15.Text = x6.ToString();

            textBox21.Text = r1.ToString();
            textBox20.Text = r2.ToString();
            textBox19.Text = r3.ToString();
            textBox18.Text = r4.ToString();
            textBox17.Text = r5.ToString();
            textBox16.Text = r6.ToString();

            textBox27.Text = yq1.ToString();
            textBox26.Text = yq2.ToString();
            textBox25.Text = yq3.ToString();
            textBox24.Text = yq4.ToString();
            textBox23.Text = yq5.ToString();
            textBox22.Text = yq6.ToString();

            textBox33.Text = y1.ToString();
            textBox32.Text = y2.ToString();
            textBox31.Text = y3.ToString();
            textBox30.Text = y4.ToString();
            textBox29.Text = y5.ToString();
            textBox28.Text = y6.ToString();

            linkLabel1.Enabled = true;
            linkLabel3.Enabled = true;
            linkLabel5.Enabled = true;
            linkLabel4.Enabled = true;
            linkLabel6.Enabled = true;
            linkLabel7.Enabled = true;
        }
예제 #16
0
파일: Base.cs 프로젝트: BdGL3/CXPortal
 public WorkstationResult (L3.Cargo.Common.result result)
 {
     m_AnalysisTime = Convert.ToUInt32(result.AnalysisTime);
     m_Comment = result.Comment;
     m_CreateTime = result.CreateTime;
     m_Decision = (WorkstationDecision) Enum.Parse(typeof(WorkstationDecision), result.Decision, true);
     m_Reason = (WorkstationReason) Enum.Parse(typeof(WorkstationReason), result.Reason, true);
     m_UserName = result.User;
     m_WorkstationType = result.StationType;
     m_CaseId = result.CaseId;
     m_CaseType = (CaseType)Enum.Parse(typeof(CaseType), result.CaseType.ToString(), true);
     m_WorkstationId = result.WorkstationId;
 }
예제 #17
0
    // Update is called once per frame
    void Update()
    {
        if (FindEnemyL)
        {
            Vector3 closeEnemyPos1;
            Vector3 closeEnemyPos2;
            Vector3 closeEnemyPos3;
            if (GameObject.FindGameObjectWithTag("EnemyL") != null)
            {
                CloseEn1       = FindClosestEnemyC1();
                CloseEn2       = FindClosestEnemyC2();
                CloseEn3       = FindClosestEnemyC3();
                closeEnemyPos1 = new Vector3(CloseEn1.transform.position.x, CloseEn1.transform.position.y, CloseEn1.transform.position.z);
                closeEnemyPos2 = new Vector3(CloseEn2.transform.position.x, CloseEn2.transform.position.y, CloseEn2.transform.position.z);
                closeEnemyPos3 = new Vector3(CloseEn3.transform.position.x, CloseEn3.transform.position.y, CloseEn3.transform.position.z);

                WhereToFireLC1 = closeEnemyPos1 - Fire_1.position;
                WhereToFireLC2 = closeEnemyPos2 - Fire_2.position;
                WhereToFireLC3 = closeEnemyPos3 - Fire_3.position;
            }
            else
            {
                time = 0;
            }
        }

        if (TimerOn)
        {
            time++;
            if (time == reload)
            {
                //Debug.Log ("대포 발사1");
                Vector3 FirePos_1 = Fire_1.position;

                GameObject Bullet = ObjectPooling.pool.GetPoolObject_Bullet();
                if (Bullet == null)
                {
                    return;
                }

                Bullet.GetComponent <BulletCtrl> ().Enemy = CloseEn1;

                Bullet.transform.position = FirePos_1;


                Bullet.SetActive(true);
                L1.Play();
                Bullet.GetComponent <Rigidbody> ().velocity = WhereToFireLC1.normalized * bullectLSpeed;

                Bullet.GetComponent <TrailRenderer> ().Clear();
            }
            else if (time == reload * 2)
            {
                //Debug.Log ("대포 발사2");
                Vector3 FirePos_2 = Fire_2.position;

                GameObject Bullet = ObjectPooling.pool.GetPoolObject_Bullet();
                if (Bullet == null)
                {
                    return;
                }

                Bullet.GetComponent <BulletCtrl> ().Enemy = CloseEn2;

                Bullet.transform.position = FirePos_2;

                Bullet.SetActive(true);
                L2.Play();
                Bullet.GetComponent <Rigidbody> ().velocity = WhereToFireLC2.normalized * bullectLSpeed;

                Bullet.GetComponent <TrailRenderer> ().Clear();
            }
            else if (time == reload * 3)
            {
                //Debug.Log ("대포 발사3");
                Vector3 FirePos_3 = Fire_3.position;

                GameObject Bullet = ObjectPooling.pool.GetPoolObject_Bullet();
                if (Bullet == null)
                {
                    return;
                }

                Bullet.GetComponent <BulletCtrl> ().Enemy = CloseEn3;

                Bullet.transform.position = FirePos_3;

                Bullet.SetActive(true);
                L3.Play();
                Bullet.GetComponent <Rigidbody> ().velocity = WhereToFireLC3.normalized * bullectLSpeed;

                Bullet.GetComponent <TrailRenderer> ().Clear();
                time = 0;

                TimerOn = false;
            }
        }
        else
        {
            FindEnemyL = false;
        }
    }
예제 #18
0
    // Update is called once per frame
    void Update()
    {
        NowCursorState = tmpCursor.GetComponent <AnimatedCursor>().tmpCursorState;

        PlaceBtnState  = PlaceButton.GetComponent <ButtonInteraction>().NowButtonState;
        DeleteBtnState = DeleteButton.GetComponent <ButtonInteraction>().NowButtonState;
        CancelBtnState = CancelButton.GetComponent <ButtonInteraction>().NowButtonState;


        lineRenderer = GetComponent <LineRenderer>();

        //Debug.Log("Cursor Position: " + tmpCursor.transform.position);

        //Vector3 CursorPosition = tmpCursor.GetComponent<Transform>().position;

        if ((ButtonInteraction.PosState == PosButtonType.PLACE) && (NowCursorState == CursorStateEnum.Release) &&
            (PlaceBtnState != ButtonStateEnum.Targeted) && (PlaceBtnState != ButtonStateEnum.Pressed) &&
            (DeleteBtnState != ButtonStateEnum.Observation) && (CancelBtnState != ButtonStateEnum.Observation))
        {
            if (SizeButtonCollection.SizeButtonState == SizeButtonType.MEDIUM)
            {
                offset = 6.0f;
            }
            else if (SizeButtonCollection.SizeButtonState == SizeButtonType.LARGE)
            {
                offset = 8.0f;
            }
            else if (SizeButtonCollection.SizeButtonState == SizeButtonType.SMALL)
            {
                offset = 5.0f;
            }

            Vector3 FinalPos = tmpCursor.transform.position - new Vector3(0f, 0f, 0.1f) * offset;
            Instantiate(PlaneObject, FinalPos, transform.rotation, this.transform);   //Genarate the drone

            ChildCount = this.transform.childCount;

            /*Use to process the three Red Light*/

            if (ChildCount > 1)
            {
                Vector3 pos1, pos2;                                                                          //the position of two way point(drone)
                Vector3 p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18; //Red light initial position
                pos1 = this.gameObject.transform.GetChild(ChildCount - 2).transform.position;
                pos2 = this.gameObject.transform.GetChild(ChildCount - 1).transform.position;

                p0  = (pos1 * 1 + pos2 * 19) / 20;
                p1  = (pos1 * 2 + pos2 * 18) / 20;
                p2  = (pos1 * 3 + pos2 * 17) / 20;
                p3  = (pos1 * 4 + pos2 * 16) / 20;
                p4  = (pos1 * 5 + pos2 * 15) / 20;
                p5  = (pos1 * 6 + pos2 * 14) / 20;
                p6  = (pos1 * 7 + pos2 * 13) / 20;
                p7  = (pos1 * 8 + pos2 * 12) / 20;
                p8  = (pos1 * 9 + pos2 * 11) / 20;
                p9  = (pos1 * 10 + pos2 * 10) / 20;
                p10 = (pos1 * 11 + pos2 * 9) / 20;
                p11 = (pos1 * 12 + pos2 * 8) / 20;
                p12 = (pos1 * 13 + pos2 * 7) / 20;
                p13 = (pos1 * 14 + pos2 * 6) / 20;
                p14 = (pos1 * 15 + pos2 * 5) / 20;

                p15 = (pos1 * 16 + pos2 * 4) / 20;
                p16 = (pos1 * 17 + pos2 * 3) / 20;
                p17 = (pos1 * 18 + pos2 * 2) / 20;
                p18 = (pos1 * 19 + pos2 * 1) / 20;


                L0 = Instantiate(CloneRedLight_0, p0, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L0.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L0.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L0.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L1 = Instantiate(CloneRedLight_1, p1, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L1.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L1.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L1.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L2 = Instantiate(CloneRedLight_2, p2, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L2.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L2.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L2.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L3 = Instantiate(CloneRedLight_3, p3, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L3.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L3.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L3.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L4 = Instantiate(CloneRedLight_4, p4, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L4.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L4.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L4.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L5 = Instantiate(CloneRedLight_5, p5, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L5.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L5.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L5.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L6 = Instantiate(CloneRedLight_6, p6, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L6.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L6.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L6.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L7 = Instantiate(CloneRedLight_7, p7, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L7.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L7.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L7.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L8 = Instantiate(CloneRedLight_8, p8, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L8.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L8.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L8.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L9 = Instantiate(CloneRedLight_9, p9, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L9.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L9.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L9.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L10 = Instantiate(CloneRedLight_10, p10, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L10.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L10.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L10.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L11 = Instantiate(CloneRedLight_11, p11, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L11.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L11.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L11.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L12 = Instantiate(CloneRedLight_12, p12, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L12.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L12.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L12.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L13 = Instantiate(CloneRedLight_13, p13, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L13.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L13.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L13.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L14 = Instantiate(CloneRedLight_14, p14, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L14.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L14.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L14.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;


                /////////////////////////////////////////
                L15 = Instantiate(CloneRedLight_15, p15, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L15.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L15.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L15.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L16 = Instantiate(CloneRedLight_16, p16, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L16.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L16.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L16.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L17 = Instantiate(CloneRedLight_17, p17, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L17.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L17.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L17.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;

                L18 = Instantiate(CloneRedLight_18, p18, this.gameObject.transform.GetChild(ChildCount - 2).transform.rotation, LightManager.transform);
                L18.GetComponent <RedLightPos>().Obj1        = this.gameObject.transform.GetChild(ChildCount - 2).gameObject;
                L18.GetComponent <RedLightPos>().Obj2        = this.gameObject.transform.GetChild(ChildCount - 1).gameObject;
                L18.GetComponent <RedLightPos>().Current_Num = ChildCount - 2;
            }

            //WayPoint.Add(tmp);
            //Debug.Log("InstantiateInstantiateInstantiateInstantiateInstantiateInstantiate");
        }


        /* Line Process*/
        ChildCount = this.transform.childCount;
        lineRenderer.SetVertexCount(ChildCount);


        if (ChildCount > 1)
        {
            for (int i = 0; i < ChildCount; i++)
            {
                tmp = this.gameObject.transform.GetChild(i).gameObject;
                lineRenderer.SetPosition(i, tmp.transform.position);
            }


            /*Obstacle Detect*/
            for (int i = 0; i < ChildCount - 1; i++)
            {
                Obj1 = this.gameObject.transform.GetChild(i).gameObject;
                Obj2 = this.gameObject.transform.GetChild(i + 1).gameObject;
                Ray        ray = new Ray(Obj1.transform.position, Obj2.transform.position - Obj1.transform.position);
                RaycastHit hit;

                //Debug.Log( i + " -> " + (i+1) + " distance : " + Vector3.Distance(Obj1.transform.position, Obj2.transform.position));
                float distance = Vector3.Distance(Obj1.transform.position, Obj2.transform.position) - 0.1f;

                Physics.Raycast(ray, out hit, distance, mask);

                //When collision is NOT NULL, there is obstacles
                if (hit.transform != null)
                {
                    lineRenderer.material = LineMat2; // if collision the line become red
                    //Debug.Log("BBBBBBBBB");

                    //LineCollision = false;   // Let Other Script Know Collision State
                    //LineCollisionNum = i + 1;

                    Debug.Log("Blocked by : " + hit.transform.name);
                }
                //If is NULL -> No Obstacles
                else if (hit.transform == null)
                {
                    lineRenderer.material = LineMat1;
                    //LineCollision = true;
                    //LineCollisionNum = -1;
                    //Debug.Log("NNNNNNNNN");
                }

                //Debug.Log("Line color : " + lineRenderer.material);
            }
        }

        //if(ChildCount == 2) lineRenderer.SetPosition(2, new Vector3(0,0,1));
    }
예제 #19
0
 public static L1 RL1PL3(L3 d)
 {
     return(new L1());
 }
예제 #20
0
        private void lbox_Equip_SelectedValueChanged(object sender, EventArgs e)
        {
            if (lbox_Equip.SelectedItems.Count != 0)
            {
                string L1, L2, L3;

                dataset.Clear();
                try
                {
                    dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L1", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                }
                catch (Exception ex)
                {
                    Console.WriteLine("查询异常" + ex.Message);
                    return;
                }
                L1 = dataset.Tables[0].Rows[0][0].ToString();
                string[] L1D = L1.Split(';');
                dgv_L1.Rows.Clear();
                for (int i = 0; i < L1D.Count() - 1; i++)
                {
                    dgv_L1.Rows.Add(L1D[i]);
                }

                dataset.Clear();
                try
                {
                    dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L2", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                }
                catch (Exception ex)
                {
                    Console.WriteLine("查询异常" + ex.Message);
                    return;
                }
                L2 = dataset.Tables[0].Rows[0][0].ToString();
                string[] L2D = L2.Split(';');
                dgv_L2.Rows.Clear();
                for (int i = 0; i < L2D.Count() - 1; i++)
                {
                    dgv_L2.Rows.Add(L2D[i]);
                }

                dataset.Clear();
                try
                {
                    dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L3", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                }
                catch (Exception ex)
                {
                    Console.WriteLine("查询异常" + ex.Message);
                    return;
                }
                L3 = dataset.Tables[0].Rows[0][0].ToString();
                string[] L3D = L3.Split(';');
                dgv_L3.Rows.Clear();
                for (int i = 0; i < L3D.Count() - 1; i++)
                {
                    dgv_L3.Rows.Add(L3D[i]);
                }
            }
            //else
            //    MessageBox.Show("选择设备");
        }
예제 #21
0
 public void UpdateCase(String sourceAlias, String caseId, CaseUpdateEnum type, String filename, Stream file, AttachFileTypeEnum attachFileType,
     WorkstationResult result, String ContainerNum, String UserName, String CreateTime, L3.Cargo.Communications.Interfaces.CaseType caseType)
 {
     m_CaseSourceManager.UpdateCase(sourceAlias, caseId, type, filename, file, attachFileType, result, ContainerNum, UserName, CreateTime, caseType);
 }
예제 #22
0
 public void CaseListTable_CaseListTableRowChanged (object sender, L3.Cargo.Communications.Common.CaseListDataSet.CaseListTableRowChangeEvent e)
 {
     //notify presentation layer
     CaseAvailableEvent.Set();
 }
예제 #23
0
    // Update is called once per frame
    void Update()
    {
        if (FindPlayerL)
        {
            Vector3 PlayerPos1;

            PlayerPos1     = FindPlayer().transform.position;
            WhereToFireLC1 = PlayerPos1 - FirePos1.transform.position;
            WhereToFireLC2 = PlayerPos1 - FirePos2.transform.position;
            WhereToFireLC3 = PlayerPos1 - FirePos3.transform.position;
        }

        if (TimerOn)
        {
            time++;
            if (time == reload)
            {
                //Debug.Log ("대포 발사1");
                GameObject enemyBullet1 = ObjectPooling.pool.GetPoolObject_EnemyBullet();
                if (enemyBullet1 == null)
                {
                    return;
                }

                enemyBullet1.transform.position = FirePos1.transform.position;
                enemyBullet1.transform.GetChild(0).GetComponent <TrailRenderer>().Clear();

                enemyBullet1.SetActive(true);
                L1.Play();
                enemyBullet1.GetComponent <Rigidbody> ().velocity = WhereToFireLC1.normalized * bullectLSpeed;
            }
            else if (time == reload * 2)
            {
                GameObject enemyBullet2 = ObjectPooling.pool.GetPoolObject_EnemyBullet();
                if (enemyBullet2 == null)
                {
                    return;
                }

                enemyBullet2.transform.position = FirePos2.transform.position;
                enemyBullet2.transform.GetChild(0).GetComponent <TrailRenderer>().Clear();

                enemyBullet2.SetActive(true);
                L2.Play();
                enemyBullet2.GetComponent <Rigidbody>().velocity = WhereToFireLC2.normalized * bullectLSpeed;
            }
            else if (time == reload * 3)
            {
                GameObject enemyBullet3 = ObjectPooling.pool.GetPoolObject_EnemyBullet();
                if (enemyBullet3 == null)
                {
                    return;
                }

                enemyBullet3.transform.position = FirePos3.transform.position;
                enemyBullet3.transform.GetChild(0).GetComponent <TrailRenderer>().Clear();

                enemyBullet3.SetActive(true);
                L3.Play();
                enemyBullet3.GetComponent <Rigidbody>().velocity = WhereToFireLC3.normalized * bullectLSpeed;


                time    = 0;
                TimerOn = false;
            }
        }
        else
        {
            FindPlayerL = false;
        }
    }
예제 #24
0
        private void cbox_Eq_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbox_Eq.Text.Trim() != "")
            {
                lbox_UsedAlg.Items.Clear();
                //FreshLbox("EquipName", "EquipAlgSlet", "lbox_UsedAlg");
                dataset.Clear();
                try
                {
                    dataset = ServiceContainer.GetService <IGasDAL>().QueryData("AlgName", "EquipAlgSlet", "EquipName", cbox_Eq.Text);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("查询异常" + ex.Message);
                    return;
                }

                int j = 0;
                foreach (DataRow dr in dataset.Tables[0].Rows)
                {
                    lbox_UsedAlg.Items.Add(dataset.Tables[0].Rows[j][0]);
                    j++;
                }



                lbox_Factor.Items.Clear();
                lbox_UsedFact.Items.Clear();

                string L1, L2, L3;

                dataset.Clear();
                try
                {
                    dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L1", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("查询异常" + ex.Message);
                    return;
                }
                L1 = dataset.Tables[0].Rows[0][0].ToString();
                string[] L1D = L1.Split(';');
                for (int i = 0; i < L1D.Count() - 1; i++)
                {
                    lbox_Factor.Items.Add(L1D[i]);
                }

                dataset.Clear();
                try
                {
                    dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L2", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("查询异常" + ex.Message);
                    return;
                }
                L2 = dataset.Tables[0].Rows[0][0].ToString();
                string[] L2D = L2.Split(';');
                for (int i = 0; i < L2D.Count() - 1; i++)
                {
                    lbox_Factor.Items.Add(L2D[i]);
                }

                dataset.Clear();
                try
                {
                    dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L3", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("查询异常" + ex.Message);
                    return;
                }
                L3 = dataset.Tables[0].Rows[0][0].ToString();
                string[] L3D = L3.Split(';');
                for (int i = 0; i < L3D.Count() - 1; i++)
                {
                    lbox_Factor.Items.Add(L3D[i]);
                }
            }
        }
예제 #25
0
    // Update is called once per frame
    void Update()
    {
        if (doorOpenInCurrentLoop)
        {
            door.SetActive(false);
        }
        else if (M.stepCount > 1)
        {
            door.SetActive(true);
        }

        if (loopCount == 1)
        {
            doorOpenInCurrentLoop = true;
        }

        if (loopCount == 2)
        {
            if (AudiSou.volume <= 0.1)
            {
                if (!c2p)
                {
                    c2p = true;
                    Debug.Log("Swapping Tracks");
                    AudiSou.clip = c2;
                    AudiSou.Play();
                }
            }
            else if (c1 == AudiSou.clip)
            {
                fadeOut(c1, AudiSou, c2);
            }


            if (c2p)
            {
                fadeIn(AudiSou);
            }


            t1.gameObject.SetActive(true);
            t2.gameObject.SetActive(true);
            if (t1.touch == true && t2.touch == true)
            {
                doorOpenInCurrentLoop = true;
            }
        }

        if (loopCount == 3)
        {
            t3.gameObject.SetActive(true);
            t4.gameObject.SetActive(true);
            if (t1.touch == true && t2.touch == true && t3.touch == true && t4.touch == true)
            {
                doorOpenInCurrentLoop = true;
            }
        }

        if (loopCount == 4)
        {
            stepObject.SetActive(true);
            stepLimit     = 80;
            steptext.text = M.stepCount.ToString() + "/" + stepLimit.ToString() + "Steps";
            if (stepLimit <= M.stepCount)
            {
                M.playerReset();
            }

            if (t1.touch == true && t2.touch == true && t3.touch == true && t4.touch == true)
            {
                doorOpenInCurrentLoop = true;
            }
        }

        if (loopCount == 5)
        {
            if (AudiSou.volume <= 0.1)
            {
                if (!c3p)
                {
                    c3p = true;
                    Debug.Log("Swapping Tracks");
                    AudiSou.clip = c3;
                    AudiSou.Play();
                }
            }
            else if (c2 == AudiSou.clip)
            {
                fadeOut(c2, AudiSou, c3);
            }


            if (c3p)
            {
                fadeIn(AudiSou);
            }


            stepObject.SetActive(true);
            stepLimit     = 80;
            steptext.text = M.stepCount.ToString() + "/" + stepLimit.ToString() + "Steps";
            li1.SetActive(true);
            li2.SetActive(true);

            if (stepLimit <= M.stepCount)
            {
                M.playerReset();
            }

            if (M.stepCount % 2 == 0)
            {
                L1.SetActive(true);
                L2.SetActive(true);
            }
            else
            {
                L1.SetActive(false);
                L2.SetActive(false);
            }

            if (t1.touch == true && t2.touch == true && t3.touch == true && t4.touch == true)
            {
                doorOpenInCurrentLoop = true;
            }
        }

        if (loopCount == 6)
        {
            stepObject.SetActive(true);
            sb1.gameObject.SetActive(true);
            sb2.gameObject.SetActive(true);
            sb3.gameObject.SetActive(true);
            sb4.gameObject.SetActive(true);
            stepLimit     = 80;
            steptext.text = M.stepCount.ToString() + "/" + stepLimit.ToString() + "Steps";

            if (stepLimit <= M.stepCount)
            {
                M.playerReset();
            }

            if (M.stepCount % 2 == 0)
            {
                L1.SetActive(true);
                L2.SetActive(true);
            }
            else
            {
                L1.SetActive(false);
                L2.SetActive(false);
            }

            if (t1.touch == true && t2.touch == true && t3.touch == true && t4.touch == true)
            {
                doorOpenInCurrentLoop = true;
            }
        }

        if (loopCount == 7)
        {
            if (AudiSou.volume <= 0.1)
            {
                if (!c4p)
                {
                    c4p = true;
                    Debug.Log("Swapping Tracks");
                    AudiSou.clip = c4;
                    AudiSou.Play();
                }
            }
            else if (c3 == AudiSou.clip)
            {
                fadeOut(c3, AudiSou, c4);
            }


            if (c4p)
            {
                fadeIn(AudiSou);
            }



            li3.SetActive(true);
            li4.SetActive(true);
            stepLimit     = 80;
            steptext.text = M.stepCount.ToString() + "/" + stepLimit.ToString() + "Steps";

            if (stepLimit <= M.stepCount)
            {
                M.playerReset();
            }

            if (M.stepCount % 2 == 0)
            {
                L1.SetActive(true);
                L2.SetActive(true);
            }
            else
            {
                L1.SetActive(false);
                L2.SetActive(false);
            }

            if (M.stepCount % 4 == 0)
            {
                L3.SetActive(true);
                L4.SetActive(true);
            }
            else
            {
                L3.SetActive(false);
                L4.SetActive(false);
            }


            if (t1.touch == true && t2.touch == true && t3.touch == true && t4.touch == true)
            {
                doorOpenInCurrentLoop = true;
            }
        }

        if (loopCount == 8)
        {
            if (AudiSou.volume <= 0.1)
            {
                if (!c5p)
                {
                    c5p = true;
                    Debug.Log("Swapping Tracks");
                    AudiSou.clip = c5;
                    AudiSou.Play();
                }
            }
            else if (c4 == AudiSou.clip)
            {
                fadeOut(c4, AudiSou, c5);
            }


            if (c5p)
            {
                fadeIn(AudiSou);
            }


            sb5.gameObject.SetActive(true);
            sb6.gameObject.SetActive(true);
            stepLimit     = 80;
            steptext.text = M.stepCount.ToString() + "/" + stepLimit.ToString() + "Steps";

            if (stepLimit <= M.stepCount)
            {
                M.playerReset();
            }

            if (M.stepCount % 2 == 0)
            {
                L1.SetActive(true);
                L2.SetActive(true);
            }
            else
            {
                L1.SetActive(false);
                L2.SetActive(false);
            }

            if (M.stepCount % 4 == 0)
            {
                L3.SetActive(true);
                L4.SetActive(true);
            }
            else
            {
                L3.SetActive(false);
                L4.SetActive(false);
            }


            if (t1.touch == true && t2.touch == true && t3.touch == true && t4.touch == true)
            {
                doorOpenInCurrentLoop = true;
            }
        }

        if (loopCount == 9)
        {
            if (AudiSou.volume <= 0.1)
            {
                if (!c6p)
                {
                    c6p = true;
                    Debug.Log("Swapping Tracks");
                    AudiSou.clip = c6;
                    AudiSou.Play();
                }
            }
            else if (c5 == AudiSou.clip)
            {
                fadeOut(c5, AudiSou, c6);
            }


            if (c6p)
            {
                fadeIn(AudiSou);
            }



            t1.gameObject.SetActive(true);
            t2.gameObject.SetActive(true);
            t3.gameObject.SetActive(true);
            t4.gameObject.SetActive(true);
            stepObject.SetActive(true);
            sb1.gameObject.SetActive(true);
            sb2.gameObject.SetActive(true);
            sb3.gameObject.SetActive(true);
            sb4.gameObject.SetActive(true);
            sb5.gameObject.SetActive(true);
            sb6.gameObject.SetActive(true);
            ES.gameObject.SetActive(true);
            stepLimit     = 80;
            steptext.text = M.stepCount.ToString() + "/" + stepLimit.ToString() + "Steps";

            if (stepLimit <= M.stepCount)
            {
                M.playerReset();
            }

            if (M.stepCount % 2 == 0)
            {
                L1.SetActive(true);
                L2.SetActive(true);
            }
            else
            {
                L1.SetActive(false);
                L2.SetActive(false);
            }

            if (M.stepCount % 4 == 0)
            {
                L3.SetActive(true);
                L4.SetActive(true);
            }
            else
            {
                L3.SetActive(false);
                L4.SetActive(false);
            }


            if (t1.touch == true && t2.touch == true && t3.touch == true && t4.touch == true)
            {
                doorOpenInCurrentLoop = true;
            }
        }

        if (loopCount == 10)
        {
            if (AudiSou.volume <= 0.1)
            {
                if (!c7p)
                {
                    c7p = true;
                    Debug.Log("Swapping Tracks");
                    AudiSou.clip = c7;
                    AudiSou.Play();
                }
            }
            else if (c6 == AudiSou.clip)
            {
                fadeOut(c6, AudiSou, c7);
            }


            if (c7p)
            {
                fadeIn(AudiSou);
            }



            t1.gameObject.SetActive(true);
            t2.gameObject.SetActive(true);
            t3.gameObject.SetActive(true);
            t4.gameObject.SetActive(true);
            stepObject.SetActive(true);
            sb1.gameObject.SetActive(true);
            sb2.gameObject.SetActive(true);
            sb3.gameObject.SetActive(true);
            sb4.gameObject.SetActive(true);
            sb5.gameObject.SetActive(true);
            sb6.gameObject.SetActive(true);
            ES.gameObject.SetActive(true);
            ES2.gameObject.SetActive(true);
            stepLimit     = 80;
            steptext.text = M.stepCount.ToString() + "/" + stepLimit.ToString() + "Steps";

            if (stepLimit <= M.stepCount)
            {
                M.playerReset();
            }

            if (M.stepCount % 2 == 0)
            {
                L1.SetActive(true);
                L2.SetActive(true);
            }
            else
            {
                L1.SetActive(false);
                L2.SetActive(false);
            }

            if (M.stepCount % 4 == 0)
            {
                L3.SetActive(true);
                L4.SetActive(true);
            }
            else
            {
                L3.SetActive(false);
                L4.SetActive(false);
            }


            if (t1.touch == true && t2.touch == true && t3.touch == true && t4.touch == true)
            {
                doorOpenInCurrentLoop = true;
            }
        }

        if (loopCount == 11)
        {
            if (AudiSou.volume <= 0.1)
            {
                if (!c8p)
                {
                    c8p = true;
                    Debug.Log("Swapping Tracks");
                    AudiSou.clip = c8;
                    AudiSou.Play();
                }
            }
            else if (c7 == AudiSou.clip)
            {
                fadeOut(c7, AudiSou, c8);
            }


            if (c8p)
            {
                fadeIn(AudiSou);
            }



            if (M.stepCount >= 1)
            {
                currentTime   -= Time.deltaTime;
                timerText.text = "Time Remaining: " + currentTime;

                if (currentTime <= 0)
                {
                    resetLoop();
                }
            }

            t1.gameObject.SetActive(true);
            t2.gameObject.SetActive(true);
            t3.gameObject.SetActive(true);
            t4.gameObject.SetActive(true);
            stepObject.SetActive(true);
            sb1.gameObject.SetActive(true);
            sb2.gameObject.SetActive(true);
            sb3.gameObject.SetActive(true);
            sb4.gameObject.SetActive(true);
            sb5.gameObject.SetActive(true);
            sb6.gameObject.SetActive(true);
            ES.gameObject.SetActive(true);

            ES2.gameObject.SetActive(true);
            timerObject.SetActive(true);

            stepLimit     = 80;
            steptext.text = M.stepCount.ToString() + "/" + stepLimit.ToString() + "Steps";

            if (stepLimit <= M.stepCount)
            {
                M.playerReset();
            }

            if (M.stepCount % 2 == 0)
            {
                L1.SetActive(true);
                L2.SetActive(true);
            }
            else
            {
                L1.SetActive(false);
                L2.SetActive(false);
            }

            if (M.stepCount % 4 == 0)
            {
                L3.SetActive(true);
                L4.SetActive(true);
            }
            else
            {
                L3.SetActive(false);
                L4.SetActive(false);
            }


            if (t1.touch == true && t2.touch == true && t3.touch == true && t4.touch == true)
            {
                doorOpenInCurrentLoop = true;
            }
        }

        if (loopCount == 12)
        {
            if (AudiSou.volume <= 0.1)
            {
                if (!c9p)
                {
                    c9p = true;
                    Debug.Log("Swapping Tracks");
                    AudiSou.clip = c9;
                    AudiSou.Play();
                }
            }
            else if (c8 == AudiSou.clip)
            {
                fadeOut(c8, AudiSou, c9);
            }


            if (c9p)
            {
                fadeIn(AudiSou);
            }
            SceneManager.LoadScene(2);
        }
    }
예제 #26
0
        public static L3.Cargo.Common.Xml.Profile_1_0.Profile Translate (L3.Cargo.Common.ProfileObject profileObj)
        {
            L3.Cargo.Common.Xml.Profile_1_0.Profile profile = new L3.Cargo.Common.Xml.Profile_1_0.Profile();
            profile.Macro = new L3.Cargo.Common.Xml.Profile_1_0.ProfileMacro[profileObj.UserMacros.Count];

            try
            {

                if (profileObj != null)
                {
                    if (profileObj.UserMacros != null)
                    {
                        int macroCount = 0;
                        foreach (L3.Cargo.Common.Macro macro in profileObj.UserMacros)
                        {
                            L3.Cargo.Common.Xml.Profile_1_0.ProfileMacro profileMacro = new L3.Cargo.Common.Xml.Profile_1_0.ProfileMacro();

                            profileMacro.id = macro.Name;

                            profileMacro.Buffer = new L3.Cargo.Common.Xml.Profile_1_0.ProfileMacroBuffer();
                            profileMacro.Buffer.parameter = macro.Buffer.name;

                            profileMacro.PseudoColor = new L3.Cargo.Common.Xml.Profile_1_0.ProfileMacroPseudoColor();
                            profileMacro.PseudoColor.parameter = macro.PseudoColor.name;

                            profileMacro.Histogram = new L3.Cargo.Common.Xml.Profile_1_0.ProfileMacroHistogram();
                            profileMacro.Histogram.effectType = macro.Histogram.effecttype;
                            profileMacro.Histogram.start = macro.Histogram.start;
                            profileMacro.Histogram.end = macro.Histogram.end;

                            profileMacro.Filters = new L3.Cargo.Common.Xml.Profile_1_0.ProfileMacroFilter[macro.Filter.Count];
                            int count = 0;

                            foreach (L3.Cargo.Common.Xml.History_1_0.HistoryFilter filterHistory in macro.Filter)
                            {
                                L3.Cargo.Common.Xml.Profile_1_0.ProfileMacroFilter filter = new L3.Cargo.Common.Xml.Profile_1_0.ProfileMacroFilter();
                                filter.id = filterHistory.name;
                                filter.parameter = filterHistory.parameter;

                                profileMacro.Filters[count] = filter;
                                count++;
                            }

                            profile.Macro[macroCount] = profileMacro;

                            macroCount++;
                        }
                    }

                    profile.DensityAlarm = new L3.Cargo.Common.Xml.Profile_1_0.ProfileDensityAlarm();
                    if (profileObj.DensityAlarmValue == 0.0)
                    {
                        // clear the element if the value is 0
                        profile.DensityAlarm = null;
                    }
                    else
                    {
                        profile.DensityAlarm.value = profileObj.DensityAlarmValue;
                    }
                }

            }
            catch (Exception ex)
            {
                //TODO: Log exception here
            }

            return profile;
        }