Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

296
 
298
 
298
 
MainForm.cs
_>119119             // First, make sure the user has accept the Terms and Conditions
 120120             string agreement = ConfigurationManager.AppSettings["UserAgreementStatus"];
 121121            
<>122 -            //StringBuilder name = new StringBuilder();
 123 -            //string name = GetCameraDeviceName();
 124 -            //int retval = GetFirstCameraDriver(name);
 125 -            //string s = Marshal.PtrToStringBSTR(name);
 126 -            //IntPtr camera = (IntPtr)0;
 127 -            //InitializeComponent();
 128 -
129122             if (agreement == null || agreement != "Accepted")
 130123             {
 131124                 // Show Terms and Conditions dialog
     
 !
150143                 }
 151144             }
 152145            
<>153 -            //
154146             // Required for Windows Form Designer support
<>155 -            //
156147             _delegateStatusUpdate = new DelegateStatusUpdate(StatusUpdate);
 157148             _delegateFeedbackUpdate = new DelegateFeedbackUpdate(FeedbackUpdate);
 158149             _delegateUploadUpdate = new DelegateUploadUpdate(UploadUpdate);
 159150 
 160151             _sensorDataManager = new SensorDataManager();
 161152             _feedbackManager = new FeedbackManager();
<>162 -            //_sensorDataManager.Log = true; // log events
163153 
 164154             // Set the folder where campaignr will save the file (deprecated)
 165155             //_sensorDataManager.SaveFileFolder = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
 166156            
 167157             InitializeComponent();
 168158 
<>169 -            // Must be called after
 170 -            if (menuCollectUpload.Checked)
 171 -                menuCollectUpload_Click(null, null);
 172 -            else if (menuCollect.Checked)
 173 -                menuCollect_Click(null, null);
 174 -            else if (menuUpload.Checked)
 175 -                menuUpload_Click(null, null);
 176 -
 177 -            loadConfiguration(null, null);
  159+            LoadConfiguration(true);
178160         }
 179161 
 180162         /// <summary>
     
 !
240222             // menuConfig
 241223             //
 242224             this.menuConfig.Text = "Change Configuration";
<>243 -            this.menuConfig.Click += new System.EventHandler(this.loadConfiguration);
  225+            this.menuConfig.Click += new System.EventHandler(this.LoadConfiguration);
244226             //
 245227             // exitMenuItem
 246228             //
     
 !
321303         /// <summary>
 322304         /// The main entry point for the application.
 323305         /// </summary>
<>324 -
325306         static void Main()
 326307         {
 327308             ThreadPool.SetMaxThreads(10, 10);
     
 !
448429             }
 449430         }
 450431 
<>451 -        //! what do do when the exit menu item is selected
  432+        // What do do when the exit menu item is selected
452433         private void exitMenuItem_Click(object sender, EventArgs e)
 453434         {
 454435             if (_sensorDataManager != null)
     
 !
468449             }
 469450         }
 470451 
<>471 -        //! Called when MainForm loads
  452+        // Called when MainForm loads
472453         private void MainForm_Load(object sender, System.EventArgs e)
 473454         {
 474455             status.Width = Screen.PrimaryScreen.WorkingArea.Width;
     
 !
481462             closeSensors();
 482463         }
 483464 
<>484 -        //! Start upload monitor thread
  465+        // Start upload monitor thread
485466         private void startMonitor()
 486467         {
 487468             status.Text = "";
     
 !
562543         private void menuCollect_Click(object sender, EventArgs e)
 563544         {
 564545             this.Mode = OperationModes.Collect;
<>565 -            /*if (menuUpload.Checked)
 566 -                menuUpload_Click(null, null);
 567 -            else if (menuCollectUpload.Checked)
 568 -                menuCollectUpload_Click(null, null);
 569 -
 570 -            if (!menuCollect.Checked)
 571 -            {
 572 -                _delegateMenus = new DelegateMenus(menuCollect_Click);
 573 -               
 574 -                _sensorDataManager.Collect(false);
 575 -
 576 -                startMonitor();
 577 -            }
 578 -            else
 579 -            {
 580 -                closeSensors();
 581 -            }
 582 -
 583 -            menuCollect.Checked = !menuCollect.Checked;*/
584546         }
 585547 
 586548         //! Collect data and upload to server
 587549         public void menuCollectUpload_Click(object sender, EventArgs e)
 588550         {
 589551             this.Mode = OperationModes.CollectUpload;
<>590 -            /*if (menuUpload.Checked)
 591 -                menuUpload_Click(null, null);
 592 -            else if (menuCollect.Checked)
 593 -                menuCollect_Click(null, null);
 594 -
 595 -            if (!menuCollectUpload.Checked)
 596 -            {
 597 -                _delegateMenus = new DelegateMenus(menuCollectUpload_Click);
 598 -
 599 -                if (_manualCapture == false)
 600 -                    _sensorDataManager.Collect(true);
 601 -
 602 -                startMonitor();
 603 -            }
 604 -            else
 605 -            {
 606 -                closeSensors();
 607 -            }
 608 -
 609 -            menuCollectUpload.Checked = !menuCollectUpload.Checked;*/
610552         }
 611553 
<>612 -
613554         // Upload to server
 614555         private void menuUpload_Click(object sender, EventArgs e)
 615556         {
 616557             this.Mode = OperationModes.Upload;
<>617 -            /*if (menuCollectUpload.Checked)
 618 -                menuCollectUpload_Click(null, null);
 619 -            else if (menuCollect.Checked)
 620 -                menuCollect_Click(null, null);
 621 -
 622 -            if (!menuUpload.Checked)
 623 -            {
 624 -                _delegateMenus = new DelegateMenus(menuUpload_Click);
 625 -                _sensorDataManager.UploadOnly();
 626 -
 627 -                startMonitor();
 628 -            }
 629 -            else
 630 -            {
 631 -                closeSensors();
 632 -            }
 633 -
 634 -            menuUpload.Checked = !menuUpload.Checked;*/
635558         }
 636559 
 637560         // Reads the configuration xml file for campaignr
     
 !
10881011             return sensor;
 10891012         }
 10901013 
<>1091 -        private void loadConfiguration(object sender, EventArgs e)
  1014+        private void LoadConfiguration(object sender, EventArgs e)
10921015         {
<> 1016+            LoadConfiguration(false);
  1017+        }
  1018+
  1019+        private void LoadConfiguration(bool startUp)
  1020+        {
10931021             string fileToLoad = "";
 10941022 
 10951023             try
     
 !
11041032                 {
 11051033                     bool manualLoad = false;
 11061034 
<>1107 -                    if (sender == null) // if this method was invoked at startup, then only check for autoload*, otherwise show file chooser
  1035+                    if (startUp) // if this method was invoked at startup, then only check for autoload*, otherwise show file chooser
11081036                     {
 11091037                         // Check if Global.xml exists
 11101038                         GlobalConfigurationParser globalParser = new GlobalConfigurationParser(dirname);
     
 !
12331161                     this.Mode = OperationModes.Upload;
 12341162             }
 12351163 
<>1236 -            /*if (_uploadOnStart)
 1237 -            {
 1238 -                // The configuration expects the upload to start immediately
 1239 -                _uploadManager.StartUpload();
 1240 -                startMonitor();
 1241 -            }
 1242 -            else
 1243 -            {
 1244 -                _killUploadMonitor = false;
 1245 -
 1246 -                // Update the screen in case a session has not started
 1247 -                monitorUpload(null);
 1248 -            }*/
 1249 -
<_12501164             progressBar1.Value = 100;
 12511165 
 12521166             loadingPanel.Visible = false;
Atlassian FishEye, Subversion, CVS & Perforce analysis. (Version:1.5.4 Build:build-307 2008-07-31 ) - Administration - Page generated 2009-11-23 15:19 -0800