예제 #1
0
        private void abmProducto_Load(object sender, EventArgs e)
        {
            estado = ABM.Nada;
            categorias = Devuelve.Categorias();
            proveedores = Devuelve.Proveedores();
            auxProduct = new Producto();

            foreach (Proveedor pr in proveedores)
            {
                cbProveedor.Items.Add(pr.Nombre);
            }

            cbCatModifProd.Items.Add("Todo");
            foreach (Categoria c in categorias)
            {
                cbCatModifProd.Items.Add(c.Descripcion);
                cbCategoria.Items.Add(c.Descripcion);
            }

            cbTalleModificPr.Items.Add("Todo");
            foreach (String p in Enum.GetNames(typeof(eTalle)))
            {
                cbTalleModificPr.Items.Add(p);
                cbTalle.Items.Add(p);
            }

            cbTalleModificPr.SelectedIndex = 0;
            cbCatModifProd.SelectedIndex = 0;
        }
예제 #2
0
    public static void Main(string[] args)
    {
        var terrainFilePaths = new string[] { "./layers/grid.csv", "./layers/gradient.csv", "./layers/landscape.csv" };
        // var terrainFilePaths = new string[] { "./layers/landscape.csv", "./layers/landscape.csv", "./layers/grid.csv" };
        var fitnessVals = new List <List <float> >();

        foreach (string terrainFilePath in terrainFilePaths)
        {
            FileUtils.ChangeTerrainFilePath(terrainFilePath);

            List <List <float> > trainGenomes = null;
            if (terrainFilePath != terrainFilePaths[0])
            {
                trainGenomes = FileUtils.ReadGenomesFromFile(".\\output\\genomes.csv");
            }
            HillClimberFCM fcm = new HillClimberFCM(population: 96, numberOfValues: 486, STEPS, OUTPUT_FILENAME, FITNESS_COLUMNNAME, trainGenomes);

            ABM abm = new ABM(modelDescription: GetModelDescription());

            abm.Train(fcm, 10, 200, true, args);

            // var genomes = FileUtils.ReadGenomesFromFile(".\\output\\good.csv");
            fcm = new HillClimberFCM(population: 96, numberOfValues: 486, STEPS, OUTPUT_FILENAME, FITNESS_COLUMNNAME, trainGenomes);
            fitnessVals.Add(abm.Test(fcm, 1, args));
        }
    }
예제 #3
0
    public dlgABMBase(ABM CRUDType, System.Data.DataRow row)
    {
      InitializeComponent();
      _CRUDType = CRUDType;
      _row = row;

    }
예제 #4
0
        private void aBMToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ABM frmABM = new ABM();

            frmABM.MdiParent = this;
            frmABM.Show();
        }
예제 #5
0
 private void ctrlABM1_Alta(object sender)
 {
     auxCliente = new Cliente();
     estado = ABM.Alta;
     pnlBuscaProducto.Enabled = false;
     pnlEditaProducto.Enabled = true;
     limpia();
 }
예제 #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string SQL = "INSERT INTO articulo (Art_Descripcion, Art_CodBarra,Art_Stock, Art_NumPartOrg, Art_Familia, Art_PrecioDolar) VALUES ('Prueba de turbo','035478',2,'66666','GRUPO', 25.03)";

            ABM SQL2 = new ABM();

            label_estado.Text = SQL2.UpdateArticuloStock(2, 8);
        }
예제 #7
0
    public static void Main(string[] args)
    {
        var            testGenmoes = FileUtils.ReadGenomesFromFile(".\\output\\genomes.csv");
        HillClimberFCM fcm         = new HillClimberFCM(population: 96, numberOfValues: 486, STEPS, OUTPUT_FILENAME, FITNESS_COLUMNNAME, testGenmoes);

        ModelDescription description = new ModelDescription();

        description.AddLayer <Terrain>();
        description.AddAgent <Animal, Terrain>();


        ABM abm = new ABM(modelDescription: description);

        abm.Train(fcm, 30, 45, true, args);

        testGenmoes = FileUtils.ReadGenomesFromFile(".\\output\\genomes.csv");
        fcm         = new HillClimberFCM(population: 96, numberOfValues: 486, STEPS, OUTPUT_FILENAME, FITNESS_COLUMNNAME, testGenmoes);
        abm.Test(fcm, 2, args);
    }
예제 #8
0
 private void ctrlABM1_Cancelar(object sender)
 {
     switch (estado)
     {
         case ABM.Alta:
             {
                 pnlEditaProducto.Enabled = false;
                 limpia();
             } break;
         case ABM.Modificacion:
             {
                 pnlBuscaProducto.Enabled = false;
                 pnlEditaProducto.Enabled = false;
                 limpia();
             } break;
         case ABM.Baja:
             {
                 pnlBuscaProducto.Enabled = false;
             } break;
         default: break;
     }
     estado = ABM.Nada;
 }
예제 #9
0
 public static extern IntPtr SHAppBarMessage(ABM dwMessage,
                                             [In] ref APPBARDATA pData);
예제 #10
0
 private static extern IntPtr SHAppBarMessage(
     ABM dwMessage,
     ref APPBARDATA pData);
예제 #11
0
 public static extern uint SHAppBarMessage(ABM dwMessage, ref APPBARDATA pData);
예제 #12
0
 public static IntPtr SHAppBarMessage(ABM message, ref APPBARDATA data)
 {
     return NativeMethods.SHAppBarMessage((uint)message, ref data);
 }
예제 #13
0
 private void abmProveedor_Load(object sender, EventArgs e)
 {
     estado = ABM.Nada;
     auxProvee = new Proveedor();
     refresca();
 }
예제 #14
0
 private void ctrlABM1_Modificacion(object sender)
 {
     estado = ABM.Modificacion;
     auxProvee = new Proveedor();
     pnlBuscaProducto.Enabled = true;
 }
예제 #15
0
 private void ctrlABM1_Aceptar(object sender, ref bool cancela)
 {
     switch(estado)
     {
         case ABM.Alta:
             {
                 if (validaForm())
                 {
                     if (controlaRep(tbNombreProducto.Text, cbTalle.Text))
                     {
                         creaProducto();
                         Agrega.Producto(auxProduct);
                         MessageBox.Show("Producto creado satisfactoriamente", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         cancela = true;
                         pnlEditaProducto.Enabled = false;
                         limpia();
                         refresca();
                     }
                 }                        
             } break;
         case ABM.Modificacion:
             {
                 if (validaForm())
                 {
                         creaProducto();
                         Actualiza.Producto(auxProduct);
                         MessageBox.Show("Producto modificado satisfactoriamente", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         cancela = true;
                         pnlBuscaProducto.Enabled = false;
                         pnlEditaProducto.Enabled = false;
                         refresca();
                 }
                 
             } break;
         case ABM.Baja:
             {
                 if (dgvProductosEdit.RowCount < 1 || dgvProductosEdit.CurrentRow == null)
                     MessageBox.Show("Debe selecionar un producto", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 else
                 {
                     Elimina.Producto(Devuelve.Producto((int)dgvProductosEdit.CurrentRow.Cells["IdProducto"].Value));
                     refresca();
                     cancela = true;
                     pnlBuscaProducto.Enabled = false;
                     MessageBox.Show("Producto eliminardo satisfactoriamente", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             } break;
         default: break;
     }
     estado = ABM.Nada;
 }
예제 #16
0
        private void ctrlABM1_Aceptar(object sender, ref bool cancela)
        {
            switch (estado)
            {
                case ABM.Alta:
                    {
                        if (validaForm())
                        {
                            if (controlaRep(tbNombre.Text, tbApellido.Text, tbEmail.Text, tbDomicilio.Text))
                            {
                                creaCliente();
                                if (auxCliente.Telefonos.Count > 0)
                                    Agrega.Telefono(auxCliente.Telefonos[0]);
                                else
                                    auxCliente.Telefonos.Clear();
                                Agrega.Cliente(auxCliente);
                                MessageBox.Show("Cliente creado satisfactoriamente", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                cancela = true;
                                pnlEditaProducto.Enabled = false;
                                limpia();
                                refresca();
                            }
                        }
                    } break;
                case ABM.Modificacion:
                    {
                        if (validaForm())
                        {
                            creaCliente();
                            if (auxCliente.Telefonos.Count > 0)
                                Agrega.Telefono(auxCliente.Telefonos[0]);
                            Actualiza.Cliente(auxCliente);
                            MessageBox.Show("Cliente modificado satisfactoriamente", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            cancela = true;
                            pnlBuscaProducto.Enabled = false;
                            pnlEditaProducto.Enabled = false;
                            limpia();
                            refresca();
                        }

                    } break;
                case ABM.Baja:
                    {
                        if (dgvClientesEdit.RowCount < 1 || dgvClientesEdit.CurrentRow == null)
                            MessageBox.Show("Debe selecionar un cliente", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        else
                        {
                            Elimina.Cliente(Devuelve.Cliente((int)dgvClientesEdit.CurrentRow.Cells["Id"].Value));
                            refresca();
                            cancela = true;
                            pnlBuscaProducto.Enabled = false;
                            MessageBox.Show("Cliente eliminado satisfactoriamente", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    } break;
                default: break;
            }
            estado = ABM.Nada;
        }
예제 #17
0
 public static IntPtr SHAppBarMessage(ABM message, ref APPBARDATA data)
 {
     return(NativeMethods.SHAppBarMessage((uint)message, ref data));
 }
예제 #18
0
 public bool validaForm()
 {
     bool estado = false;
     if (tbNombre.Text != String.Empty && tbApellido.Text != String.Empty)
     {
         if (tbEmail.Text != String.Empty && tbDomicilio.Text != String.Empty)
         {
                 estado = true;
         }
     }
     if (!estado)
         MessageBox.Show("Faltan campos por llenar", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Error);
     return estado;
 }
예제 #19
0
 public static extern UInt32 SHAppBarMessage(ABM dwMessage, ref AppBarData pData);
예제 #20
0
 private void ctrlABM1_Baja(object sender)
 {
     estado = ABM.Baja;
     pnlBuscaProducto.Enabled = true;
 }
예제 #21
0
        private static void Postfix(ref Player __instance, ref Vector3 ___m_moveDir, ref Vector3 ___m_lookDir, ref GameObject ___m_placementGhost, Transform ___m_eye)
        {
            if ((Configuration.Current.Player.IsEnabled && Configuration.Current.Player.queueWeaponChanges) && (ZInput.GetButtonDown("Hide") || ZInput.GetButtonDown("JoyHide")))
            {
                if (__instance.InAttack() && (__instance.GetRightItem() != null || __instance.GetLeftItem() != null))
                {
                    // The game ignores this keypress, so queue it and take care of it when able (Player_FixedUpdate_Patch).
                    EquipPatchState.shouldHideItemsAfterAttack = true;
                }
            }

            if (!__instance.m_nview.IsValid() || !__instance.m_nview.IsOwner())
            {
                return;
            }

            if (Configuration.Current.AdvancedEditingMode.IsEnabled)
            {
                AEM.PlayerInstance = __instance;
                AEM.run();
            }

            if (Configuration.Current.AdvancedBuildingMode.IsEnabled)
            {
                ABM.Run(ref __instance);
            }

            if (Configuration.Current.Hotkeys.IsEnabled)
            {
                ApplyDodgeHotkeys(ref __instance, ref ___m_moveDir, ref ___m_lookDir);
            }


            if (Configuration.Current.GameClock.IsEnabled)
            {
                String hours_str   = "";
                String minutes_str = "";
                String amPM_str    = "";

                Hud hud = Hud.instance;

                Text timeText;
                if (timeObj == null)
                {
                    MessageHud msgHud = MessageHud.instance;

                    timeObj = new GameObject();
                    timeObj.transform.SetParent(hud.m_statusEffectListRoot.transform.parent);
                    timeObj.AddComponent <RectTransform>();

                    timeText = timeObj.AddComponent <Text>();

                    float rRatio = Mathf.Clamp01((float)Configuration.Current.GameClock.textRedChannel / 255f);
                    float gRatio = Mathf.Clamp01((float)Configuration.Current.GameClock.textGreenChannel / 255f);
                    float bRatio = Mathf.Clamp01((float)Configuration.Current.GameClock.textBlueChannel / 255f);
                    float aRatio = Mathf.Clamp01((float)Configuration.Current.GameClock.textTransparencyChannel / 255f);

                    timeText.color              = new Color(rRatio, gRatio, bRatio, aRatio);
                    timeText.font               = msgHud.m_messageCenterText.font;
                    timeText.fontSize           = Configuration.Current.GameClock.textFontSize;
                    timeText.enabled            = true;
                    timeText.alignment          = TextAnchor.MiddleCenter;
                    timeText.horizontalOverflow = HorizontalWrapMode.Overflow;
                }
                else
                {
                    timeText = timeObj.GetComponent <Text>();
                }

                EnvMan env = EnvMan.instance;
                if (savedEnvSeconds != env.m_totalSeconds)
                {
                    float minuteFrac = Mathf.Lerp(0, 24, env.GetDayFraction());
                    float hr24       = Mathf.Floor(minuteFrac);
                    minuteFrac = minuteFrac - hr24;
                    float minutes = Mathf.Lerp(0, 60, minuteFrac);

                    int hours_int   = Mathf.FloorToInt(hr24);
                    int minutes_int = Mathf.FloorToInt(minutes);

                    if (Configuration.Current.GameClock.useAMPM)
                    {
                        amPM_str = (hours_int < 12) ? " AM" : " PM";
                        if (hours_int > 12)
                        {
                            hours_int -= 12;
                        }
                    }

                    if (hours_int < 10)
                    {
                        hours_str = "0" + hours_int;
                    }
                    if (minutes_int < 10)
                    {
                        minutes_str = "0" + minutes_int;
                    }
                    if (hours_int >= 10)
                    {
                        hours_str = hours_int.ToString();
                    }
                    if (minutes_int >= 10)
                    {
                        minutes_str = minutes_int.ToString();
                    }

                    timeText.text = hours_str + ":" + minutes_str + amPM_str;
                    var staminaBarRec      = hud.m_staminaBar2Root.transform as RectTransform;
                    var statusEffictBarRec = hud.m_statusEffectListRoot.transform as RectTransform;
                    timeObj.GetComponent <RectTransform>().position = new Vector2(staminaBarRec.position.x, statusEffictBarRec.position.y);
                    timeObj.SetActive(true);
                    savedEnvSeconds = env.m_totalSeconds;
                }
            }
        }
예제 #22
0
 private void ctrlABM1_Modificacion(object sender)
 {
     estado = ABM.Modificacion;
     auxCliente = new Cliente();
     pnlBuscaProducto.Enabled = true;
 }
예제 #23
0
 internal static IntPtr Shell32SHAppBarMessage(ABM dwMessage, [In] ref APPBARDATA pData)
 {
     return(SHAppBarMessage(dwMessage, ref pData));
 }
예제 #24
0
 private void abmCliente_Load(object sender, EventArgs e)
 {
     estado = ABM.Nada;
     auxCliente = new Cliente();
     refresca();
 }
예제 #25
0
 public static extern IntPtr SHAppBarMessage(ABM dwMessage, [In] ref APPBARDATA pData);
예제 #26
0
 public bool validaForm()
 {
     bool estado = false;
     if (tbNombreProducto.Text != String.Empty && ntbPrecioCosto.Text != String.Empty)
     {
         if (cbProveedor.SelectedItem != null)
         {
             if (cbCategoria.SelectedItem != null && cbTalle.SelectedItem != null)
             {
                 estado = true;
             }
         }
     }
     if(!estado)
         MessageBox.Show("Faltan campos por llenar", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Error);
     return estado;
 }