17 this->varInputMode()->attach(callback);
18 this->varCount()->attach(callback);
19 this->varFixHeight()->attach(callback);
20 this->varMax()->attach(callback);
21 this->varMin()->attach(callback);
22 this->inFrameNumber()->attach(callback);
23 this->varOutputFile()->attach(callback);
25 this->varCount()->setRange(-50000,50000);
26 this->inFrameNumber()->tagOptional(
false);
28 isOut = this->varOutputFile()->getValue();
40 if (this->varInputMode()->getValue()==ImChart::InputMode::Array)
43 this->inArray()->tagOptional(
true);
44 auto mSinks = this->inArray()->getSinks();
47 for (
auto it : mSinks)
49 this->inArray()->disconnect(it);
53 else if(this->varInputMode()->getValue() == ImChart::InputMode::Var)
57 this->inValue()->tagOptional(
true);
58 auto mSinks = this->inValue()->getSinks();
61 for (
auto it : mSinks)
63 this->inValue()->disconnect(it);
69 bool pFixed = this->varFixHeight()->getValue();
70 float lowLimit = this->varMin()->getData();
71 float upLimit = this->varMax()->getData();
73 if (this->varCount()->getValue() >= 1)
74 count = this->varCount()->getValue();
77 if (!this->inArray()->isEmpty() && this->varInputMode()->getValue() == InputMode::Array)
79 auto& pArray = this->inArray()->getData();
83 lowLimit = m_reduce_real.minimum(pArray.begin(), pArray.size());
84 upLimit = m_reduce_real.maximum(pArray.begin(), pArray.size());
100 if (this->varInputMode()->getValue() == ImChart::InputMode::Array)
104 else if (this->varInputMode()->getValue() == ImChart::InputMode::Var)
140 char* label =
"Label";
142 ImGui::Begin(label, NULL, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize);
143 ImGui::PopStyleColor();
145 std::string checklabel =
"Output_" + this->varTitle()->getValue();
147 ImGui::Checkbox(checklabel.data(), &
isOut);
149 printf(
"isout : %d \n",
int(
isOut));
151 char overlay[2] =
" ";
152 ImGui::PlotLines(this->varTitle()->getValue().c_str(),
valuePtr,
count, 0, overlay,
min,
max, ImVec2(0, 80.0f));
255 int out_number = this->inFrameNumber()->getValue();
257 std::stringstream ss; ss << out_number;
258 std::string filename = this->varOutputPath()->getData() +
"_" + this->varTitle()->getValue() + ss.str() + this->
file_postfix;
259 std::ofstream output(filename.c_str(), std::ios::out);
261 if (!output.is_open())
263 printf(
"------OutputTxt: open file failed \n");
267 std::cout <<
"------Writer Action!------ " << std::endl;
270 output <<
"x" <<
"," <<
"y" << std::endl;
273 output << i+1 <<
"," <<
c_Value[i] << std::endl;