syntax = "proto3";

import "SiLAFramework.proto";

package sila2.io.unitelabs.weighing.weighingservice.v1;

/* This feature contains commands and properties used for common functions required when weighing things. The feature enables access to the current net weight (stable and dynamic) and the tare weight. Commands for zeroing and taring are provided. */
service WeighingService {
  /* Get the stable net weight in gram. */
  rpc GetStableWeight (sila2.io.unitelabs.weighing.weighingservice.v1.GetStableWeight_Parameters) returns (sila2.io.unitelabs.weighing.weighingservice.v1.GetStableWeight_Responses) {}
  /* Tare with the current net weight, executed immediately (Not stable). */
  rpc Tare (sila2.io.unitelabs.weighing.weighingservice.v1.Tare_Parameters) returns (sila2.io.unitelabs.weighing.weighingservice.v1.Tare_Responses) {}
  /* Tare with the stable net weight. */
  rpc TareStable (sila2.io.unitelabs.weighing.weighingservice.v1.TareStable_Parameters) returns (sila2.io.unitelabs.weighing.weighingservice.v1.TareStable_Responses) {}
  /* Set a new, custom tare weight in gram. */
  rpc SetTareWeight (sila2.io.unitelabs.weighing.weighingservice.v1.SetTareWeight_Parameters) returns (sila2.io.unitelabs.weighing.weighingservice.v1.SetTareWeight_Responses) {}
  /* Clears the currently stored tare weight. */
  rpc ClearTareWeight (sila2.io.unitelabs.weighing.weighingservice.v1.ClearTareWeight_Parameters) returns (sila2.io.unitelabs.weighing.weighingservice.v1.ClearTareWeight_Responses) {}
  /* Zero the balance immediately. */
  rpc Zero (sila2.io.unitelabs.weighing.weighingservice.v1.Zero_Parameters) returns (sila2.io.unitelabs.weighing.weighingservice.v1.Zero_Responses) {}
  /* Zero the balance with a stable measurement. */
  rpc ZeroStable (sila2.io.unitelabs.weighing.weighingservice.v1.ZeroStable_Parameters) returns (sila2.io.unitelabs.weighing.weighingservice.v1.ZeroStable_Responses) {}
  /* The current net weight in gram, accessed immediately. */
  rpc Subscribe_Weight (sila2.io.unitelabs.weighing.weighingservice.v1.Subscribe_Weight_Parameters) returns (stream sila2.io.unitelabs.weighing.weighingservice.v1.Subscribe_Weight_Responses) {}
  /* The stored tare weight in gram. */
  rpc Subscribe_TareWeight (sila2.io.unitelabs.weighing.weighingservice.v1.Subscribe_TareWeight_Parameters) returns (stream sila2.io.unitelabs.weighing.weighingservice.v1.Subscribe_TareWeight_Responses) {}
}

/* Parameters for GetStableWeight */
message GetStableWeight_Parameters {
}

/* Responses of GetStableWeight */
message GetStableWeight_Responses {
  sila2.org.silastandard.Real Weight = 1;  /* The stable net weight in gram. */
}

/* Parameters for Tare */
message Tare_Parameters {
}

/* Responses of Tare */
message Tare_Responses {
  sila2.org.silastandard.Real TareWeight = 1;  /* The stored tare weight in gram. */
}

/* Parameters for TareStable */
message TareStable_Parameters {
}

/* Responses of TareStable */
message TareStable_Responses {
  sila2.org.silastandard.Real TareWeight = 1;  /* The stored tare weight in gram. */
}

/* Parameters for SetTareWeight */
message SetTareWeight_Parameters {
  sila2.org.silastandard.Real TareWeight = 1;  /* The tare weight to be stored in gram. */
}

/* Responses of SetTareWeight */
message SetTareWeight_Responses {
}

/* Parameters for ClearTareWeight */
message ClearTareWeight_Parameters {
}

/* Responses of ClearTareWeight */
message ClearTareWeight_Responses {
}

/* Parameters for Zero */
message Zero_Parameters {
}

/* Responses of Zero */
message Zero_Responses {
}

/* Parameters for ZeroStable */
message ZeroStable_Parameters {
}

/* Responses of ZeroStable */
message ZeroStable_Responses {
}

/* Parameters for Weight */
message Subscribe_Weight_Parameters {
}

/* Responses of Weight */
message Subscribe_Weight_Responses {
  sila2.org.silastandard.Real Weight = 1;  /* The current net weight in gram, accessed immediately. */
}

/* Parameters for TareWeight */
message Subscribe_TareWeight_Parameters {
}

/* Responses of TareWeight */
message Subscribe_TareWeight_Responses {
  sila2.org.silastandard.Real TareWeight = 1;  /* The stored tare weight in gram. */
}
