00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4QParaItem.h"
00017
00018 #include "Go4CommandsAnalysis/TGo4ComGetParameter.h"
00019 #include "Go4GUIRegistry/TGo4GUIRegistry.h"
00020 #include "Go4GUI/TGo4ParaEditSlots.h"
00021
00022 TGo4QParaItem::TGo4QParaItem( QListViewItem* parent, const QString & text, const QString & text1, const QString & text2)
00023 :TGo4QItem (parent, "parameter.png", text, text1, text2)
00024 {
00025 }
00026
00027 TGo4QParaItem::TGo4QParaItem( QListView* parent, const QString & text, const QString & text1, const QString & text2)
00028 :TGo4QItem (parent, "parameter.png", text, text1, text2)
00029 {
00030 }
00031
00032 TGo4QParaItem::~TGo4QParaItem(){}
00033
00034 void TGo4QParaItem::ItemDBkRemote()
00035 {
00036 TGo4ParaEditSlots *fxTGo4ParaEditSlots=GetParaEditor();
00037 TGo4ComGetParameter* com = new TGo4ComGetParameter(text(0).data());
00038 fxTGo4GUIRegistry->SubmitCommand(com, text(0).data(),fxTGo4ParaEditSlots);
00039 }
00040 void TGo4QParaItem::ItemDBkLocal()
00041 {
00042 TGo4ParaEditSlots *fxTGo4ParaEditSlots=GetParaEditor();
00043 fxTGo4ParaEditSlots->AddObject(dynamic_cast<TNamed*>(GetWorkObject()));
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 }
00056
00057
00058 TGo4ParaEditSlots *TGo4QParaItem::GetParaEditor()
00059 {
00060 char SlotName[256];
00061 snprintf(SlotName,255,"%s%s",text(0).data(),"_Slots" );
00062 TGo4ParaEditSlots *fxTGo4ParaEditSlots= dynamic_cast <TGo4ParaEditSlots *>
00063 (fxTGo4GUIRegistry->GetSlotClass(SlotName));
00064 if(fxTGo4ParaEditSlots==0){
00065 fxTGo4ParaEditSlots = new TGo4ParaEditSlots(SlotName, "Parameter Editor");
00066 }
00067
00068 return fxTGo4ParaEditSlots;
00069
00070 }
00071