云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 沁工-PLC梯形图转指令表的算法源代码

沁工-PLC梯形图转指令表的算法源代码

  • 62 次阅读
  • 3 次下载
  • 2025/5/3 9:25:25

172. {}

173. OR():IOPOINT() 174. {

175. setcode(\); 176. }

177. void put_img(int x,int y,CDC *pDC); 178. void print(int x,int y,CDC *pDC); 179. };

180. class ORI :public IOPOINT 181. { 182. public:

183. ORI(int x,int y,int flg,CString cd=\,CString nm=\,CString ad=\) 184. :IOPOINT(x,y,flg,cd,nm,ad) 185. {}

186. ORI():IOPOINT() 187. {

188. setcode(\); 189. }

190. void put_img(int x,int y,CDC *pDC); 191. void print(int x,int y,CDC *pDC); 192. };

193. class HOR :public IOPOINT 194. { 195. public:

196. HOR(int x,int y,int flg,CString cd=\,CString nm=\,CString ad=\) 197. :IOPOINT(x,y,flg,cd,nm,ad) 198. {}

199. HOR():IOPOINT() 200. {}

201. int testaddr();

202. void print(int x,int y,CDC *pDC); 203. };

204. class ERECT :public IOPOINT 205. { 206. public:

207. ERECT(int x,int y,int flg,CString cd=\,CString nm=\,CString ad=\

\)

208. :IOPOINT(x,y,flg,cd,nm,ad) 209. {}

210. ERECT():IOPOINT() 211. {}

212. int testaddr() 213. {

214. return 0;

215. }

216. void print(int x,int y,CDC *pDC); 217. };

218. class OUTPOINT :public IOPOINT 219. { 220. public:

221. OUTPOINT(int x,int y,int flg,CString cd=\,CString nm=\,CString ad=

\)

222. :IOPOINT(x,y,flg,cd,nm,ad) 223. {}

224. OUTPOINT():IOPOINT() 225. {

226. setcode(\); 227. }

228. int testaddr() 229. {

230. return 0; 231. }

232. void put_img(int x,int y,CDC *pDC); 233. void print(int x,int y,CDC *pDC); 234. };

235. class ADDTION:public IOPOINT 236. { 237. public:

238. ADDTION(int x,int y,int flg,CString cd=\,CString nm=\,CString ad=\)

239. :IOPOINT(x,y,flg,cd,nm,ad) 240. {}

241. ADDTION():IOPOINT() 242. {}

243. int testaddr();

244. void put_img(int x,int y,CDC *pDC); 245. void print(int x,int y,CDC *pDC); 246. };

247. class LIST:public CObject 248. {

249. friend class PLC; 250. private:

251. IOPOINT *root; 252. public: 253. LIST() 254. {

255. root=0; 256. }

257. IOPOINT * ANBtest(IOPOINT *p);

258. IOPOINT * ANBcompile(IOPOINT *p,IOPOINT *endpoint); 259. IOPOINT * ORBtest(IOPOINT *p,IOPOINT *q); 260. IOPOINT * ORBcompile(IOPOINT *p); 261. int compile(IOPOINT *); 262. };

263. class PLC:public CObject 264. {

265. friend class CLADDoc; 266. private: 267. int Cols; 268. int Rows;

269. IOPOINT * point_array[m_nAreRow][m_nAreCol]; 270. LIST list_array[20]; 271. int step; 272. public:

273. IOPOINT * getpoint(int row,int col); 274. int getcols(); 275. int getrows();

276. void SetRowCol(int row,int col); 277. PLC();

278. void getstep();

279. int syntax(CString &m_strlist); 280. int testpoint(int row,int col); 281. void insert_point(IOPOINT *n); 282. void remove_point(int x,int y); 283. int compiled(CString &m_strlist); 284. void newfile(); 285. }; 286. #endif

IOPOINT.cpp

[cpp] view plain copy print?

1. //FILE:iopoint.CPP 2. #include \ 3. #include \ 4. //extern int CurrentCols; 5. extern FILE *fp; 6. extern int CurH;

7. extern int CurW;

8. extern CString filename; 9. IMPLEMENT_SERIAL(CIO,CObject,1) 10. CIO::CIO() 11. {

12. name=\; 13. addr=\; 14. code=\; 15. Rows=0; 16. Cols=0; 17. flag=0; 18. fiveflag=0; 19. xpoint=0; 20. ypoint=0; 21. } 22. /*

23. IOPOINT 判断无件地址是否有效 24. */

25. int IOPOINT::testaddr() 26. {

27. char ch;

28. if ((addr.GetLength()!=4)

29. || addr[2]>'7' || addr[3]>'7') 30. return 1; 31. else 32. {

33. ch=addr[0]; 34. switch (ch) 35. {

36. case 'X':

37. if (addr<\ || addr>\) 38. return 1; 39. else

40. break; 41. case 'Y':

42. if (addr<\ || addr>\) 43. return 1; 44. else 45. break; 46. case 'M':

47. if (addr<\ || addr>\) 48. return 1; 49. else 50. break;

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

172. {} 173. OR():IOPOINT() 174. { 175. setcode(\); 176. } 177. void put_img(int x,int y,CDC *pDC); 178. void print(int x,int y,CDC *pDC); 179. }; 180. class ORI :public IOPOINT 181. { 182. public: 183. ORI(int x,int y,int flg,CString cd=\,CString nm=\,CString ad=\) 184. :IOPOINT(x,y,flg,cd,nm

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com