OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [configtool/] [common/] [win32/] [Thermometer.cpp] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
2
// -------------------------------------------                              
3
// This file is part of the eCos host tools.                                
4
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
5
//
6
// This program is free software; you can redistribute it and/or modify     
7
// it under the terms of the GNU General Public License as published by     
8
// the Free Software Foundation; either version 2 or (at your option) any   
9
// later version.                                                           
10
//
11
// This program is distributed in the hope that it will be useful, but      
12
// WITHOUT ANY WARRANTY; without even the implied warranty of               
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
14
// General Public License for more details.                                 
15
//
16
// You should have received a copy of the GNU General Public License        
17
// along with this program; if not, write to the                            
18
// Free Software Foundation, Inc., 51 Franklin Street,                      
19
// Fifth Floor, Boston, MA  02110-1301, USA.                                
20
// -------------------------------------------                              
21
// ####ECOSHOSTGPLCOPYRIGHTEND####                                          
22
// Thermometer.cpp: implementation of the CThermometer class.
23
//
24
//////////////////////////////////////////////////////////////////////
25
 
26
#include "stdafx.h"
27
#include "Thermometer.h"
28
#include "ConfigTool.h"
29
 
30
#ifdef PLUGIN
31
  #define INCLUDEFILE "ide.common.h"
32
  #include "IncludeSTL.h"
33
  #include "common/StatusBar.h"
34
#else
35
  #include "MainFrm.h"
36
#endif
37
 
38
#ifdef _DEBUG
39
#undef THIS_FILE
40
static char THIS_FILE[]=__FILE__;
41
#define new DEBUG_NEW
42
#endif
43
 
44
//////////////////////////////////////////////////////////////////////
45
// Construction/Destruction
46
//////////////////////////////////////////////////////////////////////
47
 
48
CThermometer::CThermometer(int nMax,LPCTSTR psz)
49
{
50
    TRACE(_T("Create thermometer nMax=%d string='%s'\n"),nMax,psz?psz:_T("<null>"));
51
    #ifdef PLUGIN
52
#ifndef _AFXEXT
53
  AFX_MANAGE_STATE(CConfigTool::CallerModuleState);
54
#endif
55
    AppInstance::getAppManager()->getStatusBar()->showProgressBar(psz?psz:_T(""), 0, nMax);
56
    #else
57
        if(CConfigTool::GetMain()){
58
                CConfigTool::GetMain()->SetThermometerMax(nMax);
59
        if(psz){
60
                CConfigTool::GetMain()->SetIdleMessage(psz);
61
        }
62
    }
63
    #endif
64
}
65
 
66
CThermometer::~CThermometer()
67
{
68
    TRACE(_T("Destroy thermometer\n"));
69
    #ifdef PLUGIN
70
#ifndef _AFXEXT
71
  AFX_MANAGE_STATE(CConfigTool::CallerModuleState);
72
#endif
73
    AppInstance::getAppManager()->getStatusBar()->hideProgressBar();
74
    #else
75
        if(CConfigTool::GetMain()){
76
                CConfigTool::GetMain()->SetThermometerMax(0);
77
                CConfigTool::GetMain()->SetIdleMessage(NULL);
78
    }
79
    #endif
80
}
81
 
82
void CThermometer::Set(int n)
83
{
84
    #ifdef PLUGIN
85
#ifndef _AFXEXT
86
  AFX_MANAGE_STATE(CConfigTool::CallerModuleState);
87
#endif
88
    AppInstance::getAppManager()->getStatusBar()->updateProgressBar(n);
89
    #else
90
        if(CConfigTool::GetMain()){
91
                CConfigTool::GetMain()->UpdateThermometer(n);
92
        }
93
    #endif
94
}
95
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.