コード例 #1
0
        private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            double width = HalconWPFWindow.Width;

            rectHalcon.Width = (int)width;
            double height = HalconWPFWindow.Height;

            rectHalcon.Height = (int)height;

            hWindow = HalconWPFWindow.HalconWindow;

            if (hWindow == null)
            {
                return;
            }

            Thread thread = new Thread(new ThreadStart(ThreadRun));

            thread.Start();

            unsafe
            {
                enumStatus status = (enumStatus)pclSetup();

                status = (enumStatus)pclDownloadParameter(ref para1, ref para2, ref para3, ref para4);

                txtBoxResult.Text = status.ToString();
            }
        }
コード例 #2
0
        private string getColor(enumStatus status)
        {
            var color = "";

            switch (status)
            {
            case enumStatus.Pending:
                color = "#0073b7";
                break;

            case enumStatus.Confirmed:
                color = "#00a65a";
                break;

            case enumStatus.Cancelled:
                color = "#f39c12";
                break;

            case enumStatus.Rejected:
                color = "#f56954";
                break;

            default:
                color = "#00c0ef";
                break;
            }

            return(color);
        }
コード例 #3
0
 private void saveAGS()
 {
     // Write ags_data to database
     saveFileAGS();
     saveDatabaseAGS();
     status = enumStatus.AGSSaved;
 }
コード例 #4
0
        // 操作完毕
        public void endOne(object sender)
        {
            // 将操作数交给计算模块
            try
            {
                c.Db1 = Convert.ToDouble(db1Temp);
                c.Ope = opeTemp;
                c.Db2 = Convert.ToDouble(db2Temp);
            }
            catch (System.FormatException)  // 输入 2.3.5 * 6 = ? 报错
            {
                MessageBox.Show("请按照正确的格式输入行不???");
                System.Diagnostics.Process.Start("WindowsApplication.exe"); // 启动你的程序;
                Application.Exit();                                         //退出当前的程序
            }

            // 将结果显示在计算器屏幕上
            tbshow.PushChar("=");//(((Button)(sender)).Text);
            tbshow.AppendLine(Convert.ToString(c.Res));

            // 恢复初始化值
            db1Temp = null;
            db2Temp = null;
            opeTemp = compute.Operator.Null;
            status  = enumStatus.db1;
        }
コード例 #5
0
        /// <summary>
        ///
        /// </summary>
        private void sendAGS()
        {
            try {
                StringBuilder sb = new StringBuilder();
                sb.Append(AGS_START);
                sb.AppendLine();
                sb.Append(ags_data);
                sb.AppendLine();
                sb.Append(AGS_END);

                String wrapped_ags_data = sb.ToString();

                TextReader tr = new StringReader(wrapped_ags_data);

                String line = "";

                while ((line = tr.ReadLine()) != null)
                {
                    s_out.Write(line);
                    s_out.WriteLine();
                }

                s_out.Flush();

                status = enumStatus.AGSSent;
            } catch (Exception e)  {
                Console.WriteLine(e.Message);
            }
        }
コード例 #6
0
        private string getProp(enumStatus status)
        {
            var prop = "";

            switch (status)
            {
            case enumStatus.Pending:
                prop = "info";
                break;

            case enumStatus.Confirmed:
                prop = "success";
                break;

            case enumStatus.Cancelled:
                prop = "warning";
                break;

            case enumStatus.Rejected:
                prop = "danger";
                break;

            default:
                prop = "primary";
                break;
            }

            return(prop);
        }
コード例 #7
0
 private void saveXML()
 {
     // Write xmldata to database
     saveFileXML();
     saveDatabaseXML();
     status = enumStatus.XMLSaved;
 }
コード例 #8
0
        public static String ObterTexto(enumStatus enmStatus)
        {
            String texto = String.Empty;

            //System.Globalization.CultureInfo myCultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture;
            //System.Resources.ResourceManager myResManager = new System.Resources.ResourceManager("CaseBusiness.Resources.CC.ALM.StatusFila", System.Reflection.Assembly.GetExecutingAssembly());

            switch (enmStatus)
            {
            case enumStatus.ATIVA: texto = "Ativa"; break;

            case enumStatus.INATIVA: texto = "Inativa"; break;

            case enumStatus.ELABORACAO: texto = "Em Elaboração"; break;

            case enumStatus.TESTE: texto = "Em Teste"; break;

            case enumStatus.TSTEXECUTADO: texto = "Teste Executado"; break;

            case enumStatus.EMEXECUCAO: texto = "Em Execução"; break;

            case enumStatus.TSTEXECUTANDO: texto = "Teste Executando"; break;
            }

            //myCultureInfo = null;
            // myResManager = null;

            return(texto);
        }
コード例 #9
0
ファイル: AGS_Client.cs プロジェクト: simon969/ge_repository
        protected async virtual Task <int> saveAGS()
        {
            // Default status is AGS saved,
            // if ags file needs to be actually saved override function with save file routine.

            status = enumStatus.AGSSaved;
            return(1);
        }
コード例 #10
0
ファイル: AGS_Client.cs プロジェクト: simon969/ge_repository
        public bool IsConnected()
        {
            if (!socket.Connected)
            {
                status = AGS_Client_Base.enumStatus.NotConnected;
            }

            return(status != AGS_Client_Base.enumStatus.NotConnected);
        }
コード例 #11
0
        // 删除字符
        public void delOneChar()
        {
            // status == db1 && db1Temp == null 此时用户什么都没输入
            // status == db1 && db1Temp != null 此时用户输入第一个操作数未完成
            // status == db2 && db2Temp == null 此时用户输入了左操作数和一个操作符
            // status == db2 && db2Temp != null 此时用户输入了左操作数, 操作符, 并且输入右操作数未完成

            if (enumStatus.db1 == status && null == db1Temp)
            {
                MessageBox.Show("没有可以删除的数据了 囧rz");
            }
            else if (enumStatus.db1 == status && null != db1Temp)
            {
                tbshow.PopChar();
                string temp = db1Temp;
                db1Temp = temp.Remove(temp.Length - 1, 1);
                if (db1Temp.Length == 0)
                {
                    db1Temp = null;
                }
            }
            else if (enumStatus.db2 == status && null == db2Temp)
            {
                if (opeTemp == compute.Operator.OpeSin ||
                    opeTemp == compute.Operator.OpeCos ||
                    opeTemp == compute.Operator.OpeTan)
                {
                    tbshow.PopChar();
                    tbshow.PopChar();
                    tbshow.PopChar();
                }
                else
                {
                    tbshow.PopChar();
                }
                // 删除一个正好把操作符删除了
                status  = enumStatus.db1;
                opeTemp = compute.Operator.Null;
            }
            else if (enumStatus.db2 == status && null != db2Temp)
            {
                string temp = db2Temp;
                db2Temp = temp.Remove(temp.Length - 1, 1);
                tbshow.PopChar();
                if (db2Temp.Length == 0)
                {
                    db2Temp = null;
                }
            }
            else
            {
                MessageBox.Show("class _01HeabCalculatorIO => " +
                                "public void delOneChar() 中出现了异常, 请联系大雄([email protected])解决问题");
            }
        }
コード例 #12
0
    // Update is called once per frame
    void Update()
    {
        if (gameState == GameStatesEnum.Ready && breathingStatus.value == enumStatus.Exhale)
        {
            gameState = GameStatesEnum.BreathingSet;
        }


        // Check for a good breath ending and add to the count
        if (lastBreathingStatus == enumStatus.Exhale && breathingStatus.value == enumStatus.Inhale)
        {
            breathCount += 1;
            if (lastBreathLength > minGoodTime)
            {
                breathGoodCount += 1;
            }
        }

        if (breathCount > maxBreathCount || breathGoodCount > breathsMin)
        {
            gameState = GameStatesEnum.RestBetweenSets;

            // resets the counts for breaths
            breathCount     = 0;
            breathGoodCount = 0;

            // increases the set counter
            setCount += 1;
            restTimer = 0f;

            if (setCount > minSetNum)
            {
                gameState = GameStatesEnum.FinishSets;
            }
        }

        // If the player should be resting, add a timer onto the system.
        if (gameState == GameStatesEnum.RestBetweenSets)
        {
            restTimer += Time.deltaTime;
        }

        // If the resting time is over, ready to play again
        if (restTimer > minRestTime && gameState == GameStatesEnum.RestBetweenSets)
        {
            gameState = GameStatesEnum.Ready;
        }

        // Update the last frame

        lastBreathingStatus = breathingStatus.value;
        lastBreathLength    = breathLength.value;
    }
コード例 #13
0
        public static String ObterDBValue(enumStatus enmStatus)
        {
            String DBValue = String.Empty;

            switch (enmStatus)
            {
            case enumStatus.ATIVA: DBValue = kStatus_ATIVA; break;

            case enumStatus.INATIVA: DBValue = kStatus_INATIVA; break;
            }

            return(DBValue);
        }
コード例 #14
0
        //private const string kStatus_Texto_ATIVA_ptBR = "Ativa";
        //private const string kStatus_Texto_INATIVA_ptBR = "Inativa";
        #endregion Enums e Constantes

        #region Métodos
        public static enumStatus ObterEnum(String status_DBValue)
        {
            enumStatus enm = enumStatus.EMPTY;

            switch (status_DBValue.Trim().ToUpper())
            {
            case kStatus_ATIVA: enm = enumStatus.ATIVA; break;

            case kStatus_INATIVA: enm = enumStatus.INATIVA; break;
            }

            return(enm);
        }
コード例 #15
0
        public static String ObterDBValue(enumStatus enmstatus)
        {
            String _dbvalue = String.Empty;

            switch (enmstatus)
            {
            case enumStatus.ATIVO: _dbvalue = kStatus_ATIVO_DBValue; break;

            case enumStatus.INATIVO: _dbvalue = kStatus_INATIVO_DBValue; break;
            }

            return(_dbvalue);
        }
コード例 #16
0
ファイル: DbHandler.cs プロジェクト: wwkkww1983/LeProj
        public void UpdateScheduleFinishCount(int scheduleId, int count, enumStatus status)
        {
            string strSql = @"UPDATE Schedules SET FinishCount=FinishCount+@FinishCount,Status=@Status WHERE ID=@ID;";

            using (SqlCommand cmd = new SqlCommand(strSql, conn))
            {
                cmd.Parameters.AddWithValue("@ID", scheduleId);
                cmd.Parameters.AddWithValue("@FinishCount", count);
                cmd.Parameters.AddWithValue("@Status", (int)status);

                cmd.ExecuteNonQuery();
            }
        }
コード例 #17
0
ファイル: AGS_Client.cs プロジェクト: simon969/ge_repository
        protected async virtual Task <int> readAGS()
        {
            // Default status is AGS has been read, just check size of data string
            // if ags file needs to be actually read override function to with read file routine.

            if (ags_data.Length >= 0)
            {
                status = AGS_Client_Base.enumStatus.AGSReceived;
                return(1);
            }

            return(-1);
        }
コード例 #18
0
ファイル: ValeIngresso.cs プロジェクト: icaroferj/ir-api
 /// <summary>
 /// Utilizar somente no momento de vender, alternativa para a proc de atualizar valeingresso,
 /// (Utiliza Transaction)
 /// </summary>
 /// <param name="bd"></param>
 /// <param name="Status"></param>
 /// <param name="valeIngressoID"></param>
 /// <returns></returns>
 public int AlterarStatus(BD bd, enumStatus Status, int valeIngressoID)
 {
     try
     {
         StringBuilder stbSQL = new StringBuilder();
         stbSQL.Append("UPDATE tValeIngresso SET Status = '" + (char)Status + "' ");
         stbSQL.Append("WHERE ID = " + valeIngressoID + " AND Status <> 'T' ");
         return(bd.Executar(stbSQL.ToString()));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #19
0
ファイル: ActionProcessor.cs プロジェクト: yanhan-dev/MatchMe
        public string AddUser(string UserName, string Balance, string jsonInput)
        {
            User       user    = null;
            string     message = string.Empty;
            enumStatus status  = enumStatus.Unknown;
            double     balance = 0.0;

            try
            {
                if (!double.TryParse(Balance, out balance))
                {
                    message = string.Format("Error: Invalid Balance: {0}", Balance);
                }
                if (!string.IsNullOrEmpty(jsonInput))
                {
                    user = new User(jsonInput);
                }
                else
                {
                    user = new User(UserName, balance);
                }

                if (MatchMeDB.Instance.UserTable.ContainsKey(user.UserName) || MatchMeDB.Instance.Users.ContainsKey(user.Id))
                {
                    string existingUser = MatchMeDB.Instance.UserTable[user.UserName].ToString();
                    message = string.Format("Error: duplicate user. Existing User: {0} New User (rejected): {1}", existingUser, user.ToString());
                }
                if (string.IsNullOrEmpty(message))
                {
                    status = MatchMeDB.Instance.AddUser(user);
                    if (status.Equals(enumStatus.UserAdded))
                    {
                        message = string.Format("User Added: {0}", user.ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                ServerLog.LogException(ex, string.Format("Add User: {0}", user.ToString()));
                message = ex.Message;
                status  = enumStatus.UserAddFailed;
            }
            var result = new Dictionary <string, string> {
                { "status", status.ToString() },
                { "message", message }
            };

            return(JsonConvert.SerializeObject(result));
        }
コード例 #20
0
        public static enumStatus ObterEnum(String status)
        {
            enumStatus _enmstatus = enumStatus.EMPTY;

            switch (status.Trim().ToUpper().Substring(0, 1))
            {
            case kStatus_ATIVO_DBValue: _enmstatus = enumStatus.ATIVO; break;

            case kStatus_INATIVO_DBValue: _enmstatus = enumStatus.INATIVO; break;

            case kStatus_EXCLUIDO_DBValue: _enmstatus = enumStatus.EXCLUIDO; break;
            }

            return(_enmstatus);
        }
コード例 #21
0
        public _01HeabCalculatorIO(ref TextBox txtBoxShow)
        {
            db1Temp = null;
            db2Temp = null;
            opeTemp = compute.Operator.Null;
            status  = enumStatus.db1;

            // 显示模块 控制器 开始接管显示器
            tbshow = new TxtBoxShow(ref txtBoxShow);
            // 初始显示一个0
            Button b = new Button();

            b.Text = "0";
            addFactor(b);
        }
コード例 #22
0
        public static enumStatus ObterEnum(String status)
        {
            enumStatus _enmstatus = enumStatus.EMPTY;

            switch (status)
            {
            case kStatus_CASEMANAGER_DBValue: _enmstatus = enumStatus.CASEMANAGER; break;

            case kStatus_CASE_DBValue: _enmstatus = enumStatus.CASE; break;

            case kStatus_CASEMANAGERNEURAL_DBValue: _enmstatus = enumStatus.CASEMANAGERNEURAL; break;
            }

            return(_enmstatus);
        }
コード例 #23
0
        public static String ObterDBValue(enumStatus enmstatus)
        {
            String _dbvalue = String.Empty;

            switch (enmstatus)
            {
            case enumStatus.CASEMANAGER: _dbvalue = kStatus_CASEMANAGER_DBValue; break;

            case enumStatus.CASE: _dbvalue = kStatus_CASE_DBValue; break;

            case enumStatus.CASEMANAGERNEURAL: _dbvalue = kStatus_CASEMANAGERNEURAL_DBValue; break;
            }

            return(_dbvalue);
        }
コード例 #24
0
        private void readAGS()
        {
            if (ags_fileNameIN.Length > 0 && ags_data.Length == 0)
            {
                readFileAGS();
            }

            if (db_selectAGS.Length > 0 && ags_data.Length == 0)
            {
                readDatabaseAGS();
            }
            if (ags_data.Length >= 0)
            {
                status = AGS_Client.enumStatus.AGSReceived;
            }
        }
コード例 #25
0
        private void readXML()
        {
            // recieve xml data from ags_server
            // https://stackoverflow.com/questions/5867227/convert-streamreader-to-byte

            try {
                Boolean IsXMLData = false;
                int     read;
                byte[]  buffer = new byte[MAX_BUFFER_SIZE];
                // MemoryStream ms = new MemoryStream();
                StringBuilder sb = null;
                while ((read = s_in.BaseStream.Read(buffer, 0, MAX_BUFFER_SIZE)) > 0)
                {
                    // ms.Write(buffer, 0, read);
                    string s = System.Text.Encoding.UTF8.GetString(buffer, 0, read);
                    if (IsXMLData == false)
                    {
                        if (s.IndexOf(XML_START) == 0)
                        {
                            IsXMLData = true;
                            sb        = new StringBuilder();
                            sb.Append(s.Substring(XML_START.Length + 1));
                        }
                    }
                    else
                    {
                        if (s.IndexOf(XML_END) > 0)
                        {
                            sb.Append(s.Substring(0, s.Length - (XML_END.Length + 1)));
                            break;
                        }
                        else
                        {
                            sb.Append(s);
                        }
                    }
                }

                //    xml_data = Encoding.UTF8.GetString(ms.ToArray());

                xml_data = sb.ToString();

                status = enumStatus.XMLReceived;
            } catch (Exception e) {
                Console.WriteLine(e.Message);
            }
        }
コード例 #26
0
ファイル: PEPDataPlugin.cs プロジェクト: aticucu/projects
    /// <summary>
    /// Gets the value.
    /// </summary>
    /// <returns>The value.</returns>
    /// <param name="name">Name.</param>
    /// <param name="def">Def.</param>
    private enumStatus GetValue(string name, enumStatus def)
    {
        string tmp = string.Empty;

        try
        {
            tmp = _MyActivityObject.Get <string> (name);
        }
        catch {
        }
        if (string.IsNullOrEmpty(tmp))
        {
            return(def);
        }
        else
        {
            return((enumStatus)(int.Parse(tmp)));
        }
    }
コード例 #27
0
        public static enumStatus ObterEnum(String status)
        {
            enumStatus _enmstatus = enumStatus.EMPTY;

            if (status.Trim().Length == 0)
            {
                _enmstatus = enumStatus.EMPTY;
            }
            else
            {
                switch (status)
                {
                case kStatus_ATIVO_DBValue: _enmstatus = enumStatus.ATIVO; break;

                case kStatus_INATIVO_DBValue: _enmstatus = enumStatus.INATIVO; break;
                }
            }
            return(_enmstatus);
        }
コード例 #28
0
        public static String ObterTexto(enumStatus enmStatus)
        {
            String texto = String.Empty;

            System.Globalization.CultureInfo myCultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture;
            System.Resources.ResourceManager myResManager  = new System.Resources.ResourceManager("CaseBusiness.Resources.CtrlAcesso.UsuarioStatus", System.Reflection.Assembly.GetExecutingAssembly());

            switch (enmStatus)
            {
            case enumStatus.ATIVO: texto = myResManager.GetString("Ativo", myCultureInfo); break;

            case enumStatus.INATIVO: texto = myResManager.GetString("Inativo", myCultureInfo); break;

            case enumStatus.EXCLUIDO: texto = myResManager.GetString("Excluído", myCultureInfo); break;
            }

            myCultureInfo = null;
            myResManager  = null;

            return(texto);
        }
コード例 #29
0
        public static String ObterTexto(enumStatus enmStatus)
        {
            String texto = String.Empty;

            System.Globalization.CultureInfo myCultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture;
            System.Resources.ResourceManager myResManager  = new System.Resources.ResourceManager("CaseBusiness.Resources.CC.Global.StatusOrganizacao", System.Reflection.Assembly.GetExecutingAssembly());


            switch (enmStatus)
            {
            case enumStatus.ATIVA: texto = myResManager.GetString("Status_Texto_ATIVA", myCultureInfo); break;

            case enumStatus.INATIVA: texto = myResManager.GetString("Status_Texto_INATIVA", myCultureInfo); break;
            }


            myCultureInfo = null;
            myResManager  = null;

            return(texto);
        }
コード例 #30
0
        public static String ObterDBValue(enumStatus enmStatus)
        {
            String DBValue = String.Empty;

            switch (enmStatus)
            {
            case enumStatus.ATIVA: DBValue = kStatus_ATIVA; break;

            case enumStatus.INATIVA: DBValue = kStatus_INATIVA; break;

            case enumStatus.ELABORACAO: DBValue = kStatus_ELABORACAO; break;

            case enumStatus.TESTE: DBValue = kStatus_TESTE; break;

            case enumStatus.TSTEXECUTADO: DBValue = kStatus_TSTEXECUTADO; break;

            case enumStatus.EMEXECUCAO: DBValue = kStatus_EMEXECUCAO; break;

            case enumStatus.TSTEXECUTANDO: DBValue = kStatus_TSTEXECUTANDO; break;
            }

            return(DBValue);
        }
コード例 #31
0
 public void setSua()
 {
     status = enumStatus.Sua;
 }
コード例 #32
0
        public frmMuonTraNo(enumStatus status, clsPhieuNhapKho phieunhap)
        {
            try
            {
                InitializeComponent();

                InitFormComponent();

                //this.staTus = status;
                PanelButton.setClickStatus((enumButton2)status);

                //if (status == enumStatus.Sua || status == enumStatus.Xoa)
                if (PanelButton.isClickSua() || PanelButton.isClickXoa())
                {
                    this.phieuNhapKho = phieunhap;

                    DataTable chiTietPhieuNhap = (DataTable)new clsChi_Tiet_Phieu_Nhap_Vat_Tu().GetAll(phieunhap.Ma_phieu_nhap);
                    gridMaster.DataSource = chiTietPhieuNhap;
                    //chitiet.get
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Utilities.clsThamSoUtilities.COException(ex));
            }
        }
コード例 #33
0
 public cls_Status()
 {
     status = enumStatus.None;
 }
コード例 #34
0
 public void Reset()
 {
     status = enumStatus.None;
 }
コード例 #35
0
 public void setXoa()
 {
     status = enumStatus.Xoa;
 }
コード例 #36
0
 public void setThem()
 {
     status = enumStatus.Them;
 }
コード例 #37
0
 public void setClose()
 {
     status = enumStatus.Close;
 }
コード例 #38
0
 public void setLuu()
 {
     status = enumStatus.Luu;
 }
コード例 #39
0
 public void setLamMoi()
 {
     status = enumStatus.LamMoi;
 }