9 using namespace Microsoft::Office::Interop::Excel;
10 #define Excel Microsoft::Office::Interop::Excel
39 Excel::Worksheet^ getWorksheet(std::string sn);
45 void saveRTC(std::vector<std::string> sf);
51 std::vector<std::string> loadRTC();
60 void resetCellColor(
int c, std::string l, std::string sn, std::string leng);
71 void setCellStringSingle(
int c, std::string l, std::string sn, std::string val);
81 void setCellValueSingle(
int c, std::string l, std::string sn, T val)
84 Excel::Worksheet^ws = getWorksheet(sn);
89 Excel::Range^c1 = safe_cast<Excel::Range^>(ws->Cells[c,t_l]);
103 std::string getCellValueSingle(
int c, std::string l, std::string sn)
106 Excel::Worksheet^ws = getWorksheet(sn);
111 Excel::Range^c1 = safe_cast<Excel::Range^>(ws->Cells[c,t_l]);
127 template <
typename T>
128 void setCellValue(
int c, std::string l, std::string sn,
bool state, std::vector<std::vector<T>> v)
130 Excel::Worksheet^ws = getWorksheet(sn);
140 for(
int i=0;i < mnum;i++)
142 if(c+i > 0 && t_l > 0)
144 Excel::Range^c1 = safe_cast<Excel::Range^>(ws->Cells[c+i,t_l]);
145 Excel::Range^c2 = safe_cast<Excel::Range^>(ws->Cells[c+i,t_l+v[i].size()-1]);
148 Excel::Range^mr = ws->Range[c1,c2];
150 array<T>^dt =
gcnew array<T>(v[i].size());
152 for(
int j=0;j < v[i].size();j++)
186 template <
typename T>
187 std::vector<T> getCellValue(
int c, std::string l, std::string sn, std::string leng)
189 Excel::Worksheet^ws = getWorksheet(sn);
214 if(c > 0 && t_l > 0 && t_leng >= t_l)
221 Excel::Range^c1 = safe_cast<Excel::Range^>(ws->Cells[c-1,t_l]);
222 Excel::Range^c2 = safe_cast<Excel::Range^>(ws->Cells[c-1,t_leng]);
225 Excel::Range^mr = ws->Range[c1,c2];
227 mr->Interior->ColorIndex = 0;
231 Excel::Range^c1 = safe_cast<Excel::Range^>(ws->Cells[c,t_l]);
232 Excel::Range^c2 = safe_cast<Excel::Range^>(ws->Cells[c,t_leng]);
235 Excel::Range^mr = ws->Range[c1,c2];
237 mr->Interior->ColorIndex = 6;
251 for(
int i=0;i < t_leng-t_l+1;i++)
253 if(c > 0 && t_l+i > 0)
255 Excel::Range^c1 = safe_cast<Excel::Range^>(ws->Cells[c,t_l+i]);
266 v.push_back(string2binary<T>(
MarshalString(c1->Value2->ToString()),10));
298 void Open(System::String^ fn);
311 void setColor(
int r,
int g,
int b);
321 System::Collections::Generic::List<Excel::Worksheet^>^
xlWorksheet;