コード例 #1
0
        private void AddPlatformButton_Click(object sender, EventArgs e)
        {
            var form = new AddArgosPlatformForm(Program);

            form.DatabaseChanged += (o, x) => PlatformDataChanged();
            form.Show(this);
        }
コード例 #2
0
        private void AddPlatformButton_Click(object sender, EventArgs e)
        {
            var index      = TpfDataGridView.SelectedRows[0].Index;
            var collar     = _collars[index];
            var platform   = (string)TpfDataGridView.SelectedRows[0].Cells[2].Value;
            var platformId = (string)TpfDataGridView.SelectedRows[0].Cells[3].Value;
            var start      = (DateTime)TpfDataGridView.SelectedRows[0].Cells[5].Value;

            if (platform == "Argos")
            {
                if (Database.ArgosPlatforms.Any(a => a.PlatformId == platformId))
                {
                    AddArgosDeployment(platformId, collar, start);
                }
                else
                {
                    //First add the Argosplatform
                    var form = new AddArgosPlatformForm();
                    form.SetDefaultPlatform(platformId);
                    form.DatabaseChanged += (o, x) => AddArgosDeployment(platformId, collar, start);
                    form.Show(this);
                }
            }
            if (platform == "Argos")
            {
                //TODO: implement support for Iridium
            }
        }
コード例 #3
0
        private void AddPlatformButton_Click(object sender, EventArgs e)
        {
            var program = ((ProgramListItem)ProgramsListBox.SelectedItem).Program;
            var form    = new AddArgosPlatformForm(program);

            form.DatabaseChanged += (o, x) => ArgosDataChanged();
            form.Show(this);
        }
コード例 #4
0
        private ArgosPlatform CreatePlatform(string argosId)
        {
            var platformAdded = false;
            var form          = new AddArgosPlatformForm();

            form.DatabaseChanged += (o, x) => platformAdded = true;
            form.SetDefaultPlatform(argosId);
            form.ShowDialog(this);
            if (!platformAdded)
            {
                return(null);
            }
            return(Database.ArgosPlatforms.FirstOrDefault(p => p.PlatformId == argosId));
        }
コード例 #5
0
        private void CollarAdded(string id)
        {
            var collar = Database.Collars.FirstOrDefault(c => c.CollarManufacturer == "Telonics" && c.CollarId == id);

            if (collar == null)
            {
                return;
            }
            //Add Parameter
            var start = (DateTime)TpfDataGridView.SelectedRows[0].Cells[5].Value;
            //Since this is a new collar, I don't need to worry about any parameter conflicts.
            var param = new CollarParameter
            {
                Collar = collar,
                CollarParameterFile = File,
                StartDate           = start
            };

            Database.CollarParameters.InsertOnSubmit(param);
            if (SubmitChanges())
            {
                TpfDataChanged();
            }

            //Add PlatformDeployment
            var platformType = (string)TpfDataGridView.SelectedRows[0].Cells[2].Value;
            var platformId   = (string)TpfDataGridView.SelectedRows[0].Cells[3].Value;

            if (platformType == "Argos")
            {
                var platform = Database.ArgosPlatforms.FirstOrDefault(a => a.PlatformId == platformId);
                if (platform == null)
                {
                    var form = new AddArgosPlatformForm();
                    form.DatabaseChanged += (o, x) => ArgosAdded(platformId, collar, start);
                    form.SetDefaultPlatform(platformId);
                    form.Show(this);
                }
                else
                {
                    AddArgosDeployment(platformId, collar, start);
                }
            }
            if (platformType == "Iridium")
            {
                //TODO: implement support for Iridium
            }
        }
コード例 #6
0
 private ArgosPlatform CreatePlatform(string argosId)
 {
     var platformAdded = false;
     var form = new AddArgosPlatformForm();
     form.DatabaseChanged += (o, x) => platformAdded = true;
     form.SetDefaultPlatform(argosId);
     form.ShowDialog(this);
     if (!platformAdded)
         return null;
     return Database.ArgosPlatforms.FirstOrDefault(p => p.PlatformId == argosId);
 }
コード例 #7
0
        private void CollarAdded(string id)
        {
            var collar = Database.Collars.FirstOrDefault(c => c.CollarManufacturer == "Telonics" && c.CollarId == id);
            if (collar == null)
                return;
            //Add Parameter
            var start = (DateTime) TpfDataGridView.SelectedRows[0].Cells[5].Value;
            //Since this is a new collar, I don't need to worry about any parameter conflicts.
            var param = new CollarParameter
                {
                    Collar = collar,
                    CollarParameterFile = File,
                    StartDate = start
                };
            Database.CollarParameters.InsertOnSubmit(param);
            if (SubmitChanges())
                TpfDataChanged();

            //Add PlatformDeployment
            var platformType = (string)TpfDataGridView.SelectedRows[0].Cells[2].Value;
            var platformId = (string)TpfDataGridView.SelectedRows[0].Cells[3].Value;
            if (platformType == "Argos")
            {
                var platform = Database.ArgosPlatforms.FirstOrDefault(a => a.PlatformId == platformId);
                if (platform == null)
                {
                    var form = new AddArgosPlatformForm();
                    form.DatabaseChanged += (o, x) => ArgosAdded(platformId, collar, start);
                    form.SetDefaultPlatform(platformId);
                    form.Show(this);
                }
                else
                {
                    AddArgosDeployment(platformId, collar, start);
                }
            }
            if (platformType == "Iridium")
            {
                //TODO: implement support for Iridium
            }
        }
コード例 #8
0
 private void AddPlatformButton_Click(object sender, EventArgs e)
 {
     var index = TpfDataGridView.SelectedRows[0].Index;
     var collar = _collars[index];
     var platform = (string)TpfDataGridView.SelectedRows[0].Cells[2].Value;
     var platformId = (string)TpfDataGridView.SelectedRows[0].Cells[3].Value;
     var start = (DateTime)TpfDataGridView.SelectedRows[0].Cells[5].Value;
     if (platform == "Argos")
     {
         if (Database.ArgosPlatforms.Any(a => a.PlatformId == platformId))
             AddArgosDeployment(platformId, collar, start);
         else
         {
             //First add the Argosplatform
             var form = new AddArgosPlatformForm();
             form.SetDefaultPlatform(platformId);
             form.DatabaseChanged += (o, x) => AddArgosDeployment(platformId, collar, start);
             form.Show(this);
         }
     }
     if (platform == "Argos")
     {
         //TODO: implement support for Iridium
     }
 }
コード例 #9
0
 private void AddPlatformButton_Click(object sender, EventArgs e)
 {
     var program = ((ProgramListItem)ProgramsListBox.SelectedItem).Program;
     var form = new AddArgosPlatformForm(program);
     form.DatabaseChanged += (o, x) => ArgosDataChanged();
     form.Show(this);
 }
コード例 #10
0
 private void AddPlatformButton_Click(object sender, EventArgs e)
 {
     var form = new AddArgosPlatformForm(Program);
     form.DatabaseChanged += (o, x) => PlatformDataChanged();
     form.Show(this);
 }