Browse Source

update

master
zhaohe 1 year ago
parent
commit
2cf017488b
  1. 2
      a8000_protocol
  2. 3
      iflytop_canbus/iflytop_canbus_master.cpp
  3. 2
      iflytop_canbus/iflytop_canbus_master.hpp
  4. 50
      src/mainwindow.ui
  5. 13
      src/tab/mini_servo_tab.cpp

2
a8000_protocol

@ -1 +1 @@
Subproject commit f41c0ba7a5ca666a6038621f813001a530316a97
Subproject commit a71358065a9e7359f5a282d687d430ae4e2a324e

3
iflytop_canbus/iflytop_canbus_master.cpp

@ -134,6 +134,9 @@ void IflytopCanbusMaster::callcmd(int32_t device_id, int32_t cmdid, uint8_t *par
zcr_cmd_header_t *frame = (zcr_cmd_header_t *)m_txbuf;
frame->cmdMainId = cmdid >> 8;
frame->cmdSubId = cmdid & 0xff;
if (m_txindex < 60000) {
m_txindex = 60000;
}
frame->packetindex = m_txindex;
frame->subModuleid = device_id;

2
iflytop_canbus/iflytop_canbus_master.hpp

@ -69,7 +69,7 @@ class IflytopCanbusMaster {
mutex m_tx_lock;
uint8_t m_txbuf[1024];
int32_t m_rxsize;
uint8_t m_txindex = 0;
uint16_t m_txindex = 0;
WaveshareCan m_waveCan;

50
src/mainwindow.ui

@ -921,6 +921,56 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
<attribute name="title">
<string>基础页</string>
</attribute>
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>30</x>
<y>20</y>
<width>541</width>
<height>611</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'SimSun'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt;10  机械臂 &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; XY机械臂模块(11)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt;20  板夹仓模块 &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 板夹仓平移电机(21)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 板夹枪推杆电机(22)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt;30  摇匀模组&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 31:步进夹爪&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 32:步进升降(正转向下,0.1mm)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 33:步进摇匀&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 34:舵机-试管帽夹爪-水平移动(舵机一圈3600,中点1800)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 35:舵机-试管帽夹爪(夹紧点为1800)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 36:舵机-试管扫码夹紧(舵机一圈3600)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 37:舵机-试管旋转&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt;40  孵育盘加热 加热模块&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt;50  板夹仓加热&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt;60  进出料 &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 进料电机(61)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 出料电机(63)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 转移电机(62)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 扫码器(64)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt;70  孵育盘 &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 孵育盘转盘(71)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt;80  机械臂Z轴 &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; Z轴升降(81)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 移液枪(82)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 扫码器(83)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt;90  光学模组 &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 拍照电机(91)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 推杆电机(92)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 光学模块(93)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 光学板(90)&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt;100 ID卡读卡器 &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:11pt; color:#ff0000;&quot;&gt; 读卡器(101)&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</widget>
</widget>
</item>

13
src/tab/mini_servo_tab.cpp

@ -38,8 +38,11 @@ void MiniServoTab::construct(QTabWidget *fathertab) {
});
box->newFunc("激活配置", {}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), kmini_servo_active_cfg); });
box->newFunc("停止", {"breakstop"}, [this](int argn, const char **args) { ICM->callcmd1(getDeviceId(), kmini_servo_stop, atoi(args[0])); });
box->newFunc("旋转", {"direction"}, [this](int argn, const char **args) { ICM->callcmd1(getDeviceId(), kmini_servo_rotate, atoi(args[0])); });
box->newFunc("移动到", {"position"}, [this](int argn, const char **args) { ICM->callcmd1(getDeviceId(), kmini_servo_move_to, atoi(args[0])); });
box->newFunc("位置模式-运动到", {"position"}, [this](int argn, const char **args) { ICM->callcmd1(getDeviceId(), kmini_servo_move_to, atoi(args[0])); });
box->newFunc("速度模式-旋转", {"velocity"}, [this](int argn, const char **args) { ICM->callcmd1(getDeviceId(), kmini_servo_rotate, atoi(args[0])); });
box->newFunc("扭矩模式-旋转", {"torque"}, [this](int argn, const char **args) { ICM->callcmd1(getDeviceId(), kmini_servo_rotate_with_torque, atoi(args[0])); });
box->newFunc("设置中点", {}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), kmini_servo_set_mid_point); });
box->newFunc("读取IO状态", {"ioindex"}, [this](int argn, const char **args) {
ICM->callcmd1(getDeviceId(), kmini_servo_read_io_state, atoi(args[0]));
@ -68,9 +71,9 @@ void MiniServoTab::construct(QTabWidget *fathertab) {
tableBox->addReg("mod-errorcode", kreg_module_errorcode, ZRegItem::krw | ZRegItem::kdec);
tableBox->addReg("pos", kreg_mini_servo_pos, ZRegItem::krw | ZRegItem::kdec);
tableBox->addReg("limit-velocity", kreg_mini_servo_limit_velocity, ZRegItem::krw | ZRegItem::kdec);
tableBox->addReg("limit-torque", kreg_mini_servo_limit_torque, ZRegItem::krw | ZRegItem::kdec);
tableBox->addReg("protective-torque", kreg_mini_servo_protective_torque, ZRegItem::krw | ZRegItem::kdec);
tableBox->addReg("limit-torque(位置模式,速度模式有效)", kreg_mini_servo_limit_torque, ZRegItem::krw | ZRegItem::kdec);
tableBox->addReg("limit-velocity(位置模式有效)", kreg_mini_servo_limit_velocity, ZRegItem::krw | ZRegItem::kdec);
tableBox->addReg("protective-torque(暂时无效)", kreg_mini_servo_protective_torque, ZRegItem::krw | ZRegItem::kdec);
tableBox->addSpacer();
}

Loading…
Cancel
Save