void VLStepExpress::SetValue(const std::string & command, VLStepExpress::Axis axis, int value) { std::ostringstream os; os << command << " " << GetAxisName(axis) << " " << value; this->SendCommand(os.str()); }
void VLStepExpress::GetValue(const std::string & command, VLStepExpress::Axis axis, std::string & value) { std::ostringstream os; os << command << " " << GetAxisName(axis); this->SendCommand(os.str()); this->ReceiveString(value); }
std::string GetKeyOrAxisName(int keyCode) { if (keyCode >= AXIS_BIND_NKCODE_START) { int direction; int axis = TranslateKeyCodeToAxis(keyCode, direction); std::string temp = GetAxisName(axis); if (direction == 1) temp += "+"; else if (direction == -1) temp += "-"; return temp; } return FindName(keyCode, key_names, ARRAY_SIZE(key_names)); }
void VLStepExpress::GetValue(const std::string & command, VLStepExpress::Axis axis, double & value) { std::ostringstream os; os << command << " " << GetAxisName(axis); this->SendCommand(os.str()); std::string buffer; double temp; this->ReceiveString(buffer); std::istringstream is(buffer); is >> temp; value = temp; }
void VLStepExpress::GetValue(const std::string & command, VLStepExpress::Axis axis, std::vector<double> & values) { std::ostringstream os; os << command << " " << GetAxisName(axis); this->SendCommand(os.str()); std::string buffer; double temp; this->ReceiveString(buffer); values.clear(); std::istringstream is(buffer); while (is >> temp){ values.push_back(temp); } }