fix: rebuild MES as compilable go-zero+ent backend (renamed bj_power_mes), restore 3 workstation projects from pristine original, align naming; all Go projects go build clean
This commit is contained in:
@@ -0,0 +1,190 @@
|
||||
package robot
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestRobotDock2TempStation(t *testing.T) {
|
||||
setup(t, "192.168.1.130:102")
|
||||
defer teardown()
|
||||
|
||||
err := robot.FetchWorkpieceFromDock(context.Background(), 1, 1, 1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(3 * time.Second)
|
||||
err = robot.PlaceWorkpieceToTempStation(context.Background(), 1, 1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(3 * time.Second)
|
||||
err = robot.FetchWorkpieceFromDock(context.Background(), 1, 1, 2)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(3 * time.Second)
|
||||
err = robot.PlaceWorkpieceToTempStation(context.Background(), 1, 2)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
//err = robot.FetchWorkpieceFromDock(context.Background(), 1, 1, 3)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//err = robot.PlaceWorkpieceToTempStation(context.Background(), 1, 3)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//err = robot.FetchWorkpieceFromDock(context.Background(), 1, 1, 4)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//err = robot.PlaceWorkpieceToTempStation(context.Background(), 1, 4)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
}
|
||||
|
||||
func TestRobotTempStation2CNC(t *testing.T) {
|
||||
setup(t, "192.168.1.130:102")
|
||||
defer teardown()
|
||||
|
||||
// 上料
|
||||
//err := robot.FetchWorkpieceFromTempStation(context.Background(), 1, 1)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//time.Sleep(3 * time.Second)
|
||||
//err = robot.PlaceWorkpieceToMachine(context.Background(), 1, 4)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
|
||||
// 换料
|
||||
//err := robot.FetchWorkpieceFromTempStation(context.Background(), 1, 2)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//time.Sleep(3 * time.Second)
|
||||
//err := robot.ExchangeWorkpieceToMachine(context.Background(), 1, 4)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//time.Sleep(3 * time.Second)
|
||||
//err := robot.PlaceWorkpieceToTempStation(context.Background(), 1, 2)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
|
||||
//下料
|
||||
err := robot.FetchWorkpieceFromMachine(context.Background(), 1, 4)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(3 * time.Second)
|
||||
err = robot.PlaceWorkpieceToTempStation(context.Background(), 1, 1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRobotTempStation2Washer(t *testing.T) {
|
||||
setup(t, "192.168.1.130:102")
|
||||
defer teardown()
|
||||
|
||||
// 上料
|
||||
//err := robot.FetchWorkpieceFromTempStation(context.Background(), 1, 2)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//time.Sleep(6 * time.Second)
|
||||
//err = robot.PlaceWorkpieceToMachine(context.Background(), 1, 5, 2)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
|
||||
// 换料
|
||||
//err := robot.FetchWorkpieceFromTempStation(context.Background(), 1, 2)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//time.Sleep(6 * time.Second)
|
||||
//err = robot.ExchangeWorkpieceToMachine(context.Background(), 1, 5, 1)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//time.Sleep(6 * time.Second)
|
||||
//err = robot.PlaceWorkpieceToTempStation(context.Background(), 1, 1)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
|
||||
//下料
|
||||
err := robot.FetchWorkpieceFromMachine(context.Background(), 1, 5, 1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(6 * time.Second)
|
||||
err = robot.PlaceWorkpieceToTempStation(context.Background(), 1, 2)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRobotTempStation2Durr(t *testing.T) {
|
||||
setup(t, "192.168.1.130:102")
|
||||
defer teardown()
|
||||
|
||||
// 上料
|
||||
//err := robot.FetchWorkpieceFromTempStation(context.Background(), 1, 1)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//time.Sleep(6 * time.Second)
|
||||
//err = robot.PlaceWorkpieceToMachine(context.Background(), 1, 6)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
|
||||
//下料
|
||||
err := robot.FetchWorkpieceFromMachine(context.Background(), 1, 6)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(6 * time.Second)
|
||||
// 去毛刺机,放到随行暂存台时 slot位置需要+8
|
||||
err = robot.PlaceWorkpieceToTempStation(context.Background(), 1, 9)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRobotTempStation2Sampling(t *testing.T) {
|
||||
setup(t, "192.168.1.130:102")
|
||||
defer teardown()
|
||||
|
||||
// 上料
|
||||
//err := robot.FetchWorkpieceFromTempStation(context.Background(), 1, 1)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//time.Sleep(6 * time.Second)
|
||||
//err = robot.PlaceWorkpieceToMachine(context.Background(), 1, 6)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
|
||||
//下料
|
||||
err := robot.FetchWorkpieceFromMachine(context.Background(), 1, 6)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(6 * time.Second)
|
||||
// 去毛刺机,放到随行暂存台时 slot位置需要+8
|
||||
err = robot.PlaceWorkpieceToTempStation(context.Background(), 1, 9)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user