コード例 #1
0
//
// Called when the user clicks the Delete button.
// Removes all selected lines from the access spec.
//
void CAccessDialog::OnBDelete()
{
	int first_highlighted_item;

	// Return immediately if nothing is selected.
	if ((first_highlighted_item = m_LAccess.GetNextItem(-1, LVNI_SELECTED)) == -1)
		return;

	// Loop through all selected items and delete them.
	while ((item_being_changed = m_LAccess.GetNextItem(-1, LVNI_SELECTED)) != -1)
		DeleteLine();

	item_being_changed = first_highlighted_item;

	if (item_being_changed != -1 && item_being_changed < m_LAccess.GetItemCount()) {
		m_LAccess.SetItemState(item_being_changed, LVIS_SELECTED, LVIS_SELECTED);
		SetAll((Access_Spec *) m_LAccess.GetItemData(item_being_changed));
	} else if (m_LAccess.GetItemCount()) {
		item_being_changed = m_LAccess.GetItemCount() - 1;
		m_LAccess.SetItemState(item_being_changed, LVIS_SELECTED, LVIS_SELECTED);
		SetAll((Access_Spec *) m_LAccess.GetItemData(item_being_changed));
	} else {
		// No more items left in the list.
		item_being_changed = -1;
	}
}
コード例 #2
0
ファイル: main.cpp プロジェクト: mexus/limited-executing
int main(int argc, char **argv) {
        logxx::GlobalLogLevel(logxx::warning);
        bool res(true);
        
        AddTest<TestServer>(true);
        AddTest<TestTask>(true);
        AddTest<TestPool>(true);
        AddTest<TestExecutor>(true);
        AddTest<TestExecutorsPool>(true);
        
        if (argc < 2)
                SetAll(true);
        else {
                for (int i = 1; i < argc; ++i){
                        std::string arg(argv[i]);
                        if (arg == "all")
                                SetAll(true);
                        else if (arg == "none")
                                SetAll(false);
                        else
                                Set(arg);
                }
        }
        
        log(logxx::info) << "Starting tests" << logxx::endl;
        
        std::vector<std::string> passed, failed;
        
        for (auto &pair : tests){
                if (pair.second){
                        std::string label = pair.first->GetLabel();
                        bool testRes = pair.first->RunTests();
                        if (testRes)
                                passed.push_back(label);
                        else
                                failed.push_back(label);
                        res &= testRes;
                }
        }
        
        if (!passed.empty()){
                auto &s = log(logxx::info) << "PASSED tests: ";
                PrintStrings(s, passed);
                s << logxx::endl;
        } else
                log(logxx::info) << "No tests passed" << logxx::endl;
        
        if (!failed.empty()){
                auto &s = log(logxx::info) << "FAILED tests: ";
                PrintStrings(s, passed);
                s << logxx::endl;
        } else
                log(logxx::info) << "No tests failed" << logxx::endl;
        
        return res ? 0 : 1;
}
コード例 #3
0
ファイル: my_win.cpp プロジェクト: nodep/wht
Font::Font(const wchar_t* name, const int height, const bool is_bold, const bool is_italic)
	: _hFont(0)
{
	Clear();

	SetAll(name, height, is_bold, is_italic);
}
コード例 #4
0
PixelArray::PixelArray(int size)
{
    pbufsize = size;
    pbuf = new int[pbufsize];
    SetAll(0x0); // initialise memory to zeros

}
コード例 #5
0
//
// A change has occurred in the access spec list.  Update the GUI
// to reflect the current selection, if necessary.
//
void CAccessDialog::OnChangeLAccess(NMHDR * pNMHDR, LRESULT * pResult)
{
	// If no item is selected or the same item was reselected, ignore the action.
	int new_selection = m_LAccess.GetNextItem(-1, LVNI_SELECTED);

	if ((new_selection == -1) || (new_selection == item_being_changed))
		return;

	// Updating the last selected access spec line before possibly selecting
	// a new line.  This is needed or the newly selected item will receive the
	// same update as the previously selected item.
	if (item_being_changed != -1) {
		// Force all the other controls' OnKillfocus handlers to be called
		m_LAccess.SetFocus();
	}
	// Determine if a new item has been selected.  If not, keep the
	// currently selected item with the focus.
	if (m_LAccess.GetNextItem(-1, LVNI_SELECTED) != -1)
		item_being_changed = m_LAccess.GetNextItem(-1, LVNI_SELECTED);

	m_LAccess.SetItemState(item_being_changed, LVIS_SELECTED, LVIS_SELECTED);
	SetAll((Access_Spec *) m_LAccess.GetItemData(item_being_changed));

	*pResult = 0;
}
コード例 #6
0
CDuergarDwarfReference::CDuergarDwarfReference() : CRacialReference()
{
	SetAll();
	m_nSize = SIZE_SMALL;
	m_lStartRoom = GEN_EVIL_START_ROOM;
	//build our racial based wear positions
	//ONLY HAND POSITIONS CAN HAVE MULTI-BITS
	//SHIELD SHOULD NOT BE WITH PRIMARY HAND
	m_nWearPositions [0]= WEAR_POS_BADGE;
	m_nWearPositions [1]= WEAR_POS_HEAD;
	m_nWearPositions [2]= WEAR_POS_EAR;
	m_nWearPositions [3]= WEAR_POS_EAR;
	m_nWearPositions [4]= WEAR_POS_EYES;
	m_nWearPositions [5]= WEAR_POS_FACE;
	m_nWearPositions [6]= WEAR_POS_NECK;
	m_nWearPositions [7]= WEAR_POS_NECK;
	m_nWearPositions [8]= WEAR_POS_BODY;
	m_nWearPositions [9]= WEAR_POS_ABOUT_BODY;
	m_nWearPositions [10] = WEAR_POS_ON_BACK;
	m_nWearPositions [11]= WEAR_POS_ARMS;
	m_nWearPositions [12]= WEAR_POS_WRIST;
	m_nWearPositions [13]= WEAR_POS_WRIST;
	m_nWearPositions [14]= WEAR_POS_RING;
	m_nWearPositions [15]= WEAR_POS_RING;
	m_nWearPositions [16]= WEAR_POS_HANDS;
	m_nWearPositions [17] = WEAR_POS_WIELD | WEAR_POS_HOLD | WEAR_POS_WIELD_TWO_HANDED;
	m_nWearPositions [18]= WEAR_POS_SHIELD | WEAR_POS_HOLD | WEAR_POS_DUAL_WIELD;
	m_nWearPositions [19]= WEAR_POS_WAIST;
	m_nWearPositions [20]= WEAR_POS_LEGS;
	m_nWearPositions [21]= WEAR_POS_FEET; //22
	CalcTotalWeaponPositions();
}
コード例 #7
0
  void Normalize()
  {
    T magnitude = Magnitude();
    if(magnitude != 0)
    {
      ScaleAll(1.0/magnitude);
    }
    else

    {
      SetAll(0);
    }
  }
コード例 #8
0
ファイル: main.c プロジェクト: SmallRoomLabs/TraId
void SetMode(uint8_t mode) {
	if (mode==1) SetAll(HLL, III);	
	if (mode==2) SetAll(LHL, III);	
	if (mode==3) SetAll(HHL, III);	
	if (mode==4) SetAll(LLH, III);	
	if (mode==5) SetAll(HLH, III);	
	if (mode==6) SetAll(LHH, III);	
}
コード例 #9
0
/***************************************************************************
 * Student Constructor (non-default)
 * -------------------------------------------------------------------------
 * This is the non-default constructor for the student class and will
 * initialize private members to the parameters being passed in
 *
 * Returns: All private members initialized to respective parameter
 ***************************************************************************/
Student::Student(string 	    newName,
				 string 	    newStanding,
				 string 	    newNumber,
				 long 		    newId,
				 unsigned short newAge,
				 double 	    newGpa,
				 char 		    newGender,
				 int			month,
				 int            day,
				 int            year)
{
	SetAll(newName, newStanding, newNumber, newId, newAge, newGpa, newGender,
			month, day, year);
}
コード例 #10
0
ファイル: CShiftPWM.cpp プロジェクト: delaneys73/personal
void CShiftPWM::OneByOne_core(int delaytime){
	int pin,brightness;
	SetAll(0);
	for(int pin=0;pin<m_amountOfOutputs;pin++){
		for(brightness=0;brightness<m_maxBrightness;brightness++){
			m_PWMValues[pin]=brightness;
			delay(delaytime);          
		} 
		for(brightness=m_maxBrightness;brightness>=0;brightness--){
			m_PWMValues[pin]=brightness;
			delay(delaytime);
		} 
	}
}
コード例 #11
0
ファイル: bitfield.cpp プロジェクト: timpalpant/dtorrent
void Bitfield::Or(const Bitfield &bf)
{
    if( !_isempty_sp(bf) && !_isfull() ) {
        if( _isfull_sp(bf) ) {
            SetAll();
        } else if( _isempty() ) {
            memcpy(b, bf.b, nbytes);
            nset = bf.nset;
        } else {
            bt_index_t i;
            for( i = 0; i < nbytes; i++ )
                b[i] |= bf.b[i];
            _recalc();
        }
    }
}
コード例 #12
0
ファイル: bitfield.cpp プロジェクト: timpalpant/dtorrent
void Bitfield::Invert()
{
    if( _isempty() ) {
        SetAll();
    } else if( _isfull() ) {
        Clear();
    } else {
        bt_index_t i = 0;
        bt_index_t s = nset;
        for( ; i < nbytes - 1; i++ ) b[i] = ~b[i];

        if( nbits % 8 ) {
            for( i = 8 * (nbytes - 1); i < nbits; i++ ) {
                if( _isset(i) ) UnSet(i);
                else _set(i);
            }
        } else b[nbytes - 1] = ~b[nbytes - 1];

        nset = nbits - s;
    }
}
コード例 #13
0
XmlRelationError::XmlRelationError(const QString& absoluteFileName, XmlRelation* xmlRelation, const QString& identifierNumber,
                                   const QString& key, XML_RELATION_ERROR_TYPE errorType)
{
    SetAll(absoluteFileName, xmlRelation, identifierNumber, key, errorType);
}
コード例 #14
0
//
// Inserting a line into the access specification list.
//
BOOL CAccessDialog::InsertLine(Access_Spec * access_spec, int line_no)
{
	int current_line;

	// Verify that we can handle a new line into the access spec.
	if (m_LAccess.GetItemCount() == MAX_ACCESS_SPECS) {
		ErrorMessage("Can not add another entry to the access spec: the access spec is full");
		return FALSE;
	}
	// Unselect all selected lines to select only the new line.
	current_line = m_LAccess.GetNextItem(-1, LVNI_SELECTED);
	while (current_line != -1) {
		m_LAccess.SetItemState(current_line, !LVIS_SELECTED, LVIS_SELECTED);
		current_line = m_LAccess.GetNextItem(current_line, LVNI_SELECTED);
	}

	// Insert the new spec line and mark it as selected.
	item_being_changed = line_no;
	m_LAccess.InsertItem(LVIF_IMAGE | LVIF_STATE | LVIF_PARAM,
			     item_being_changed, NULL, LVIS_SELECTED | LVIS_FOCUSED,
			     LVIS_SELECTED | LVIS_FOCUSED, 1, (ULONG_PTR) access_spec);

	// Update the controls to reflect the newly inserted line.
	SetAll(access_spec);

	m_LAccess.EnsureVisible(item_being_changed, FALSE);

	// Re-enable all of the controls if this is the first item added to the list.
	if (m_LAccess.GetItemCount() == 1) {
		m_EMegabytes.EnableWindow(TRUE);
		m_EKilobytes.EnableWindow(TRUE);
		m_EBytes.EnableWindow(TRUE);
		m_SMegabytes.EnableWindow(TRUE);
		m_SKilobytes.EnableWindow(TRUE);
		m_SBytes.EnableWindow(TRUE);
		m_SAccess.EnableWindow(TRUE);
		m_SRead.EnableWindow(TRUE);
		m_SRandom.EnableWindow(TRUE);
		m_EDelayTime.EnableWindow(TRUE);
		m_EBurstLength.EnableWindow(TRUE);
		m_RAlignBytes.EnableWindow(TRUE);
		m_RAlignSector.EnableWindow(TRUE);
		m_RReplySize.EnableWindow(TRUE);
		m_RNoReply.EnableWindow(TRUE);
		m_BInsertBefore.EnableWindow(TRUE);
		m_BDelete.EnableWindow(TRUE);
		m_BOk.EnableWindow(TRUE);

		if (GetCheckedRadioButton(RAlignSector, RAlignBytes) == RAlignBytes) {
			m_EAlignMegabytes.EnableWindow(TRUE);
			m_EAlignKilobytes.EnableWindow(TRUE);
			m_EAlignBytes.EnableWindow(TRUE);
			m_SAlignMegabytes.EnableWindow(TRUE);
			m_SAlignKilobytes.EnableWindow(TRUE);
			m_SAlignBytes.EnableWindow(TRUE);
		}

		if (GetCheckedRadioButton(RNoReply, RReplySize) == RReplySize) {
			m_EReplyMegabytes.EnableWindow(TRUE);
			m_EReplyKilobytes.EnableWindow(TRUE);
			m_EReplyBytes.EnableWindow(TRUE);
			m_SReplyMegabytes.EnableWindow(TRUE);
			m_SReplyKilobytes.EnableWindow(TRUE);
			m_SReplyBytes.EnableWindow(TRUE);
		}
	}

	return TRUE;
}
コード例 #15
0
void CFailingRulesDialog::OnReset()
{
  SetAll(true);
}
コード例 #16
0
/////////////////////////////////////////////////////////////////////////////
// CAccessDialog message handlers
BOOL CAccessDialog::OnInitDialog()
{
	CDialog::OnInitDialog();

	m_SMegabytes.SetRange(0, MAX_SIZE_RANGE);
	m_SKilobytes.SetRange(0, MAX_SIZE_RANGE);
	m_SBytes.SetRange(0, MAX_SIZE_RANGE);
	m_SAlignMegabytes.SetRange(0, MAX_SIZE_RANGE);
	m_SAlignKilobytes.SetRange(0, MAX_SIZE_RANGE);
	m_SAlignBytes.SetRange(0, MAX_SIZE_RANGE);
	m_SAlignBytes.SetPos(512);
	m_SReplyMegabytes.SetRange(0, MAX_SIZE_RANGE);
	m_SReplyKilobytes.SetRange(0, MAX_SIZE_RANGE);
	m_SReplyBytes.SetRange(0, MAX_SIZE_RANGE);

	m_SAccess.SetRange(1, 100);
	m_SAccess.SetPageSize(10);
	m_SRead.SetRange(0, 100);
	m_SRead.SetPageSize(10);
	m_SRandom.SetRange(0, 100);
	m_SRandom.SetPageSize(10);

	size_controls.EBytesCtrl = &m_EBytes;
	size_controls.EKilobytesCtrl = &m_EKilobytes;
	size_controls.EMegabytesCtrl = &m_EMegabytes;
	size_controls.EBytesID = EBytes;
	size_controls.EKilobytesID = EKilobytes;
	size_controls.EMegabytesID = EMegabytes;
	size_controls.SBytesCtrl = &m_SBytes;
	size_controls.SKilobytesCtrl = &m_SKilobytes;
	size_controls.SMegabytesCtrl = &m_SMegabytes;
	size_controls.SBytesID = SBytes;
	size_controls.SKilobytesID = SKilobytes;
	size_controls.SMegabytesID = SMegabytes;
	size_controls.RSelectedID = 0;
	size_controls.RNotSelectedID = 0;

	// 2462 SDK compiler didn't like the "this->" for Win64 so we'll just remove it
	//  since it really isn't needed anyway...
	//size_controls.GetFunc                 = this->GetSize;
	//size_controls.SetFunc                 = this->SetSize;
	size_controls.GetFunc = GetSize;
	size_controls.SetFunc = SetSize;

	align_controls.EBytesCtrl = &m_EAlignBytes;
	align_controls.EKilobytesCtrl = &m_EAlignKilobytes;
	align_controls.EMegabytesCtrl = &m_EAlignMegabytes;
	align_controls.EBytesID = EAlignBytes;
	align_controls.EKilobytesID = EAlignKilobytes;
	align_controls.EMegabytesID = EAlignMegabytes;
	align_controls.SBytesCtrl = &m_SAlignBytes;
	align_controls.SKilobytesCtrl = &m_SAlignKilobytes;
	align_controls.SMegabytesCtrl = &m_SAlignMegabytes;
	align_controls.SBytesID = SAlignBytes;
	align_controls.SKilobytesID = SAlignKilobytes;
	align_controls.SMegabytesID = SAlignMegabytes;
	align_controls.RSelectedID = RAlignBytes;
	align_controls.RNotSelectedID = RAlignSector;

	// 2462 SDK compiler didn't like the "this->" for Win64 so we'll just remove it
	//  since it really isn't needed anyway...
	//align_controls.GetFunc                        = this->GetAlign;
	//align_controls.SetFunc                        = this->SetAlign;
	align_controls.GetFunc = GetAlign;
	align_controls.SetFunc = SetAlign;

// RSelectedID MUST be greater than RNotSelectedID, for the sake of GetCheckedRadioButton().
#if !(RAlignBytes > RAlignSector)
#error RAlignBytes is not greater than RAlignSector in resource.h!
#endif

	reply_controls.EBytesCtrl = &m_EReplyBytes;
	reply_controls.EKilobytesCtrl = &m_EReplyKilobytes;
	reply_controls.EMegabytesCtrl = &m_EReplyMegabytes;
	reply_controls.EBytesID = EReplyBytes;
	reply_controls.EKilobytesID = EReplyKilobytes;
	reply_controls.EMegabytesID = EReplyMegabytes;
	reply_controls.SBytesCtrl = &m_SReplyBytes;
	reply_controls.SKilobytesCtrl = &m_SReplyKilobytes;
	reply_controls.SMegabytesCtrl = &m_SReplyMegabytes;
	reply_controls.SBytesID = SReplyBytes;
	reply_controls.SKilobytesID = SReplyKilobytes;
	reply_controls.SMegabytesID = SReplyMegabytes;
	reply_controls.RSelectedID = RReplySize;
	reply_controls.RNotSelectedID = RNoReply;

	// 2462 SDK compiler didn't like the "this->" for Win64 so we'll just remove it
	//  since it really isn't needed anyway...
	//reply_controls.GetFunc                        = this->GetReply;
	//reply_controls.SetFunc                        = this->SetReply;
	reply_controls.GetFunc = GetReply;
	reply_controls.SetFunc = SetReply;

// RSelectedID MUST be greater than RNotSelectedID, for the sake of GetCheckedRadioButton().
#if !(RReplySize > RNoReply)
#error RReplySize is not greater than RNoReply in resource.h!
#endif

	UpdateData(FALSE);

	// Initialize the listbox object.
	InitializeList();

	// Get listbox display data from AccessSpecList.
	LoadList();

	// If there are any entries in the list, highlight the first one.
	if (m_LAccess.GetItemCount()) {
		item_being_changed = 0;
		m_LAccess.SetItemState(m_LAccess.GetItemCount() - 1, !LVIS_SELECTED, LVIS_SELECTED);
		m_LAccess.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);
		SetAll((Access_Spec *) m_LAccess.GetItemData(0));
	}

	UpdateData(TRUE);

	return TRUE;		// return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
コード例 #17
0
void CFailingRulesDialog::OnConflictsNone() 
{
  SetAll(false);
}
コード例 #18
0
CDArray::CDArray(const int Size, double Init)
{
    SetSize(Size);
    SetAll(Init);
}
コード例 #19
0
ファイル: conflictsdlg.cpp プロジェクト: 0xCA5A/dd-wrt
void ecResolveConflictsDialog::OnNone(wxCommandEvent& event)
{
    SetAll(FALSE);
}
コード例 #20
0
ファイル: ccpanose.cpp プロジェクト: vata/xarino
void CCPanose::SetAllToAny()
{
	SetAll(PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY);
}
コード例 #21
0
ファイル: Line.cpp プロジェクト: dikiigr/code-editor-sdl2
void Line::IncrementParams( int inc )
{
    active += inc;
    SetAll( all + inc );
    SetWidth( width + inc * FONT_WIDTH );
}
コード例 #22
0
ファイル: dialog_export.cpp プロジェクト: seawaveT/Aegisub
DialogExport::DialogExport(agi::Context *c)
: wxDialog(c->parent, -1, _("Export"), wxDefaultPosition, wxSize(200, 100), wxCAPTION | wxCLOSE_BOX)
, c(c)
, exporter(new AssExporter(c))
{
	SetIcon(GETICON(export_menu_16));
	SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);

	std::vector<std::string> filters = exporter->GetAllFilterNames();
	filter_list = new wxCheckListBox(this, -1, wxDefaultPosition, wxSize(200, 100), to_wx(filters));
	filter_list->Bind(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, [=](wxCommandEvent&) { RefreshOptions(); });
	filter_list->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, &DialogExport::OnChange, this);

	// Get selected filters
	std::string selected = c->ass->GetScriptInfo("Export filters");
	boost::char_separator<char> sep("|");
	for (auto const& token : boost::tokenizer<boost::char_separator<char>>(selected, sep)) {
		auto it = find(begin(filters), end(filters), token);
		if (it != end(filters))
			filter_list->Check(distance(begin(filters), it));
	}

	wxButton *btn_up = new wxButton(this, -1, _("Move &Up"), wxDefaultPosition, wxSize(90, -1));
	wxButton *btn_down = new wxButton(this, -1, _("Move &Down"), wxDefaultPosition, wxSize(90, -1));
	wxButton *btn_all = new wxButton(this, -1, _("Select &All"), wxDefaultPosition, wxSize(80, -1));
	wxButton *btn_none = new wxButton(this, -1, _("Select &None"), wxDefaultPosition, wxSize(80, -1));

	btn_up->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection() - 1, 0); });
	btn_down->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection() - 1, 0); });
	btn_all->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { SetAll(true); });
	btn_none->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { SetAll(false); });

	wxSizer *top_buttons = new wxBoxSizer(wxHORIZONTAL);
	top_buttons->Add(btn_up, wxSizerFlags(1).Expand());
	top_buttons->Add(btn_down, wxSizerFlags(1).Expand().Border(wxRIGHT));
	top_buttons->Add(btn_all, wxSizerFlags(1).Expand());
	top_buttons->Add(btn_none, wxSizerFlags(1).Expand());

	filter_description = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxSize(200, 60), wxTE_MULTILINE | wxTE_READONLY);

	// Charset dropdown list
	wxStaticText *charset_list_label = new wxStaticText(this, -1, _("Text encoding:"));
	charset_list = new wxChoice(this, -1, wxDefaultPosition, wxDefaultSize, agi::charset::GetEncodingsList<wxArrayString>());
	wxSizer *charset_list_sizer = new wxBoxSizer(wxHORIZONTAL);
	charset_list_sizer->Add(charset_list_label, wxSizerFlags().Center().Border(wxRIGHT));
	charset_list_sizer->Add(charset_list, wxSizerFlags(1).Expand());
	if (!charset_list->SetStringSelection(to_wx(c->ass->GetScriptInfo("Export Encoding"))))
		charset_list->SetStringSelection("Unicode (UTF-8)");

	wxSizer *top_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Filters"));
	top_sizer->Add(filter_list, wxSizerFlags(1).Expand());
	top_sizer->Add(top_buttons, wxSizerFlags(0).Expand());
	top_sizer->Add(filter_description, wxSizerFlags(0).Expand().Border(wxTOP));
	top_sizer->Add(charset_list_sizer, wxSizerFlags(0).Expand().Border(wxTOP));

	wxStdDialogButtonSizer *btn_sizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP);
	btn_sizer->GetAffirmativeButton()->SetLabelText(_("Export..."));
	Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogExport::OnProcess, this, wxID_OK);
	Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Export"), wxID_HELP);

	wxSizer *horz_sizer = new wxBoxSizer(wxHORIZONTAL);
	opt_sizer = new wxBoxSizer(wxVERTICAL);
	exporter->DrawSettings(this, opt_sizer);
	horz_sizer->Add(top_sizer, wxSizerFlags().Expand().Border(wxALL & ~wxRIGHT));
	horz_sizer->Add(opt_sizer, wxSizerFlags(1).Expand().Border(wxALL & ~wxLEFT));

	wxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
	main_sizer->Add(horz_sizer, wxSizerFlags(1).Expand());
	main_sizer->Add(btn_sizer, wxSizerFlags().Expand().Border(wxALL & ~wxTOP));
	SetSizerAndFit(main_sizer);
	RefreshOptions();
	CenterOnParent();
}
コード例 #23
0
ファイル: main.c プロジェクト: SmallRoomLabs/TraId
uint8_t Measure(void) {
	uint8_t	low1,low2,low3;
	uint8_t high1,high2,high3;
	uint8_t lows,highs;
	uint8_t result;
	uint8_t delta1,delta2;

	result=RES_NONE;
	low1=low2=low3=0;
	high1=high2=high3=0;

	for (uint8_t i=1; i<7; i++) {
		CLRWDT();
		SetMode(i);
		if (adc1<10) low1++;
		if (adc2<10) low2++;
		if (adc3<10) low3++;
		if (adc1>245) high1++;
		if (adc2>245) high2++;
		if (adc3>245) high3++;
	}
	CLRWDT();
	
	lows=low1+low2+low3;
	highs=high1+high2+high3;
	
	if ((lows==6) && (highs==6)) { // NFET Signature
		result=RES_NCH;
		// Handle this in the most simplistic way according to the measurements
		// of a 2N7000 NFET. This is probably not correct and will possibly not work
		// in all cases.
		if (low1==1) {
			if (low2==2) result+=RES_GDS;
			if (low2==3) result+=RES_DGS;
		}
		if (low1==2) {
			if (low2==1) result+=RES_SDG;
			if (low2==3) result+=RES_SGD;
		}
		if (low1==3) {
			if (low2==1) result+=RES_DSG;
			if (low2==2) result+=RES_GSD;
		}
	}	

	if ((lows==5) && (highs==4)) { // NPN Signature
		result=RES_NPN;
		if (low1==3) {
			delta1=SetAll(ILH, HII); 	// Test BEC
			delta2=SetAll(IHL, HII);	// Test BCE
			if (delta1<delta2) {
				result+=RES_BEC;
			} else {
				result+=RES_BCE;
			}
		}
		if (low2==3) {
			delta1=SetAll(LIH, IHI);	// Test EBC
			delta2=SetAll(HIL, IHI);	// Test CBE
			if (delta1<delta2) {
				result+=RES_EBC;
			} else {
				result+=RES_CBE;
			}
		}
		if (low3==3) {
			delta1=SetAll(LHI, IIH);	// Test ECB
			delta2=SetAll(HLI, IIH);	// Test CEB
			if (delta1<delta2) {
				result+=RES_ECB;
			} else {
				result+=RES_CEB;
			}
		}
		
	}

	//MPSA92 PNP  1=E 2=B 3=C
	if ((lows==4) && (highs==5)) { // PNP Signature
		result=RES_PNP;
		if (high1==3) {
			delta1=SetAll(ILH, LII); 	// Test BEC
			delta2=SetAll(IHL, LII);	// Test BCE
			if (delta1>delta2) {
				result+=RES_BEC;
			} else {
				result+=RES_BCE;
			}
		}
		if (high2==3) {
			delta1=SetAll(LIH, ILI);	// Test EBC
			delta2=SetAll(HIL, ILI);	// Test CBE
			if (delta1>delta2) {
				result+=RES_EBC;
			} else {
				result+=RES_CBE;
			}
		}
		if (high3==3) {
			delta1=SetAll(LHI, IIL);	// Test ECB
			delta2=SetAll(HLI, IIL);	// Test CEB
			if (delta1>delta2) {
				result+=RES_ECB;
			} else {
				result+=RES_CEB;
			}
		}
	}


#ifdef _1LCD 
	LCDCommand(0x01);	// Clear
	if (result>=100 && result<=199) {
		LCDData('N');
		LCDData('P');
		LCDHexAt(delta1,3);
		LCDHexAt(delta2,6);
		LCDCommand(0xD0);
		LCDHexAt(0xB0+base,8);
		LCDHexAt(0xE0+emitter,11);
		LCDHexAt(0xC0+collector,14);
	}
	if (result>=200) {
		LCDData('P');
		LCDData('N');
		LCDHexAt(delta1,3);
		LCDHexAt(delta2,6);
		LCDCommand(0xD0);
		LCDHexAt(0xB0+base,8);
		LCDHexAt(0xE0+emitter,11);
		LCDHexAt(0xC0+collector,14);
	}
#endif

	return result;
}
コード例 #24
0
ファイル: conflictsdlg.cpp プロジェクト: 0xCA5A/dd-wrt
void ecResolveConflictsDialog::OnAll(wxCommandEvent& event)
{
    SetAll(TRUE);
}
コード例 #25
0
ファイル: nat-inl.hpp プロジェクト: tzolnowski/libego
NatMap <Nat, Elt>::NatMap (const Elt& init) {
  SetAll (init);
}
コード例 #26
0
ファイル: Servos.cpp プロジェクト: firmware32/MW32
void Servos::init()
{
	SetAll(SERVO_COMMAND_DEFAULT);

}